[Mlir-commits] [mlir] bab2a4f - [MLIR][Presburger] Use PresburgerSpace in SetCoalescer

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Apr 2 15:38:39 PDT 2022


Author: Groverkss
Date: 2022-04-03T04:06:47+05:30
New Revision: bab2a4f2fbc183fb5899a915e37d0276a7662bd6

URL: https://github.com/llvm/llvm-project/commit/bab2a4f2fbc183fb5899a915e37d0276a7662bd6
DIFF: https://github.com/llvm/llvm-project/commit/bab2a4f2fbc183fb5899a915e37d0276a7662bd6.diff

LOG: [MLIR][Presburger] Use PresburgerSpace in SetCoalescer

This patch changes the implementation of SetCoalescer to use PresburgerSpace
instead of reimplementing parts of PresburgerSpace.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D122984

Added: 
    

Modified: 
    mlir/lib/Analysis/Presburger/PresburgerRelation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
index 62768c6eb4e40..12e0792dc9dd3 100644
--- a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
+++ b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
@@ -377,10 +377,8 @@ class presburger::SetCoalescer {
   SetCoalescer(const PresburgerRelation &s);
 
 private:
-  /// The dimensionality of the set the SetCoalescer is coalescing.
-  unsigned numDomainIds;
-  unsigned numRangeIds;
-  unsigned numSymbolIds;
+  /// The space of the set the SetCoalescer is coalescing.
+  PresburgerSpace space;
 
   /// The current list of `IntegerRelation`s that the currently coalesced set is
   /// the union of.
@@ -449,7 +447,7 @@ class presburger::SetCoalescer {
 
 /// Constructs a `SetCoalescer` from a `PresburgerRelation`. Only adds non-empty
 /// `IntegerRelation`s to the `disjuncts` vector.
-SetCoalescer::SetCoalescer(const PresburgerRelation &s) {
+SetCoalescer::SetCoalescer(const PresburgerRelation &s) : space(s.getSpace()) {
 
   disjuncts = s.disjuncts;
 
@@ -466,9 +464,6 @@ SetCoalescer::SetCoalescer(const PresburgerRelation &s) {
     ++i;
     simplices.push_back(simp);
   }
-  numDomainIds = s.getNumDomainIds();
-  numRangeIds = s.getNumRangeIds();
-  numSymbolIds = s.getNumSymbolIds();
 }
 
 /// Simplifies the representation of a PresburgerSet.
@@ -503,9 +498,7 @@ PresburgerRelation SetCoalescer::coalesce() {
       ++i;
   }
 
-  PresburgerRelation newSet =
-      PresburgerRelation::getEmpty(PresburgerSpace::getRelationSpace(
-          numDomainIds, numRangeIds, numSymbolIds));
+  PresburgerRelation newSet = PresburgerRelation::getEmpty(space);
   for (unsigned i = 0, e = disjuncts.size(); i < e; ++i)
     newSet.unionInPlace(disjuncts[i]);
 


        


More information about the Mlir-commits mailing list