[Mlir-commits] [mlir] [MLIR][Presburger][WIP] Implement vertex enumeration and chamber decomposition for polytope generating function computation. (PR #78987)

Arjun P llvmlistbot at llvm.org
Mon Jan 22 08:11:28 PST 2024


================
@@ -2498,6 +2498,50 @@ void IntegerRelation::printSpace(raw_ostream &os) const {
   os << getNumConstraints() << " constraints\n";
 }
 
+void IntegerRelation::removeTrivialEqualities() {
+  bool flag;
+  for (unsigned i = 0, e = getNumInequalities(); i < e; i++) {
+    flag = true;
+    for (unsigned j = 0, f = getNumVars(); j < f + 1; j++)
+      if (atEq(i, j) != 0)
+        flag = false;
+    if (flag)
+      removeEquality(i);
+  }
----------------
Superty wrote:

this is not correct. when you remove a row, the row that was initiall after it will get moved to position `i`. then you will check `i + 1` directly so you will end up missing it.

https://github.com/llvm/llvm-project/pull/78987


More information about the Mlir-commits mailing list