Skip to content

Commit ae3e3c6

Browse files
webmicheSuperty
authored andcommitted
[MLIR][Presburger] introduce SetCoalescer
This patch refactors the current coalesce implementation. It introduces the `SetCoalescer`, a class in which all coalescing functionality lives. The main advantage over the old design is the fact that the vectors of constraints do not have to be passed around, but are implemented as private fields of the SetCoalescer. This will become especially important once more inequality types are introduced. Reviewed By: arjunp Differential Revision: https://reviews.llvm.org/D121364
1 parent 26c95ae commit ae3e3c6

File tree

2 files changed

+221
-156
lines changed

2 files changed

+221
-156
lines changed

mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
namespace mlir {
1919
namespace presburger {
2020

21+
/// The SetCoalescer class contains all functionality concerning the coalesce
22+
/// heuristic. It is built from a `PresburgerRelation` and has the `coalesce()`
23+
/// function as its main API.
24+
class SetCoalescer;
25+
2126
/// A PresburgerRelation represents a union of IntegerRelations that live in
2227
/// the same PresburgerSpace with support for union, intersection, subtraction,
2328
/// and complement operations, as well as sampling.
@@ -120,6 +125,8 @@ class PresburgerRelation : public PresburgerSpace {
120125

121126
/// The list of disjuncts that this set is the union of.
122127
SmallVector<IntegerRelation, 2> integerRelations;
128+
129+
friend class SetCoalescer;
123130
};
124131

125132
class PresburgerSet : public PresburgerRelation {

0 commit comments

Comments
 (0)