[Mlir-commits] [mlir] [MLIR][Presburger] Fix Gaussian elimination (PR #164437)

Arjun P llvmlistbot at llvm.org
Mon Dec 1 08:37:29 PST 2025


================
@@ -725,3 +725,17 @@ TEST(IntegerRelationTest, addLocalModulo) {
     EXPECT_TRUE(rel.containsPointNoLocal({x, x % 32}));
   }
 }
+
+TEST(IntegerRelationTest, simplify) {
+  IntegerRelation rel =
+      parseRelationFromSet("(x, y, z): (2*x + y - 4*z - 3 == 0, "
+                           "3*x - y - 3*z + 2 == 0, x + 3*y - 5*z - 8 == 0,"
+                           "x - y + z >= 0)",
+                           2);
+  IntegerRelation copy = rel;
+  rel.simplify();
+
+  EXPECT_TRUE(rel.isEqual(copy));
+  // The third equality is redundant and should be removed.
----------------
Superty wrote:

Can you explain here why the third equality is redundant? Just a line or two.

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


More information about the Mlir-commits mailing list