[Mlir-commits] [mlir] eff0674 - [MLIR] PresburgerSet subtraction: add documentation and assertion saying we don't support divisions yet

Arjun P llvmlistbot at llvm.org
Tue Apr 13 17:26:44 PDT 2021


Author: Arjun P
Date: 2021-04-14T05:56:35+05:30
New Revision: eff067440e789317664dc2051df838cedd889bea

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

LOG: [MLIR] PresburgerSet subtraction: add documentation and assertion saying we don't support divisions yet

Reviewed By: ftynse

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

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/PresburgerSet.h
    mlir/lib/Analysis/PresburgerSet.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/PresburgerSet.h b/mlir/include/mlir/Analysis/PresburgerSet.h
index 4970adf0f42b6..4863c876745aa 100644
--- a/mlir/include/mlir/Analysis/PresburgerSet.h
+++ b/mlir/include/mlir/Analysis/PresburgerSet.h
@@ -67,14 +67,17 @@ class PresburgerSet {
   void print(raw_ostream &os) const;
   void dump() const;
 
-  /// Return the complement of this set.
+  /// Return the complement of this set. Computing the complement of a set
+  /// containing divisions is not yet supported.
   PresburgerSet complement() const;
 
   /// Return the set 
diff erence of this set and the given set, i.e.,
-  /// return `this \ set`.
+  /// return `this \ set`. Subtracting when either set contains divisions is not
+  /// yet supported.
   PresburgerSet subtract(const PresburgerSet &set) const;
 
   /// Return true if this set is equal to the given set, and false otherwise.
+  /// Checking equality when either set contains divisions is not yet supported.
   bool isEqual(const PresburgerSet &set) const;
 
   /// Return a universe set of the specified type that contains all points.

diff  --git a/mlir/lib/Analysis/PresburgerSet.cpp b/mlir/lib/Analysis/PresburgerSet.cpp
index 7a36e9c584af5..1b30fee36c666 100644
--- a/mlir/lib/Analysis/PresburgerSet.cpp
+++ b/mlir/lib/Analysis/PresburgerSet.cpp
@@ -170,6 +170,8 @@ static void subtractRecursively(FlatAffineConstraints &b, Simplex &simplex,
     return;
   }
   const FlatAffineConstraints &sI = s.getFlatAffineConstraints(i);
+  assert(sI.getNumLocalIds() == 0 &&
+         "Subtracting sets with divisions is not yet supported!");
   unsigned initialSnapshot = simplex.getSnapshot();
   unsigned offset = simplex.numConstraints();
   simplex.intersectFlatAffineConstraints(sI);
@@ -254,6 +256,8 @@ static void subtractRecursively(FlatAffineConstraints &b, Simplex &simplex,
 PresburgerSet PresburgerSet::getSetDifference(FlatAffineConstraints fac,
                                               const PresburgerSet &set) {
   assertDimensionsCompatible(fac, set);
+  assert(fac.getNumLocalIds() == 0 &&
+         "Subtracting sets with divisions is not yet supported!");
   if (fac.isEmptyByGCDTest())
     return PresburgerSet::getEmptySet(fac.getNumDimIds(),
                                       fac.getNumSymbolIds());


        


More information about the Mlir-commits mailing list