[Mlir-commits] [mlir] [MLIR][Presburger] optimize bound computation by pruning orthogonal constraints (PR #164199)

Arjun P llvmlistbot at llvm.org
Sun Nov 30 11:48:29 PST 2025


================
@@ -1723,12 +1724,78 @@ std::optional<DynamicAPInt> IntegerRelation::getConstantBoundOnDimSize(
   return minDiff;
 }
 
+void IntegerRelation::pruneConstraints(unsigned pos) {
+  llvm::DenseSet<unsigned> relatedCols({pos}), relatedRows;
+
+  // Early quit if constraints is empty.
+  unsigned numConstraints = getNumConstraints();
+  if (numConstraints == 0)
+    return;
+
+  llvm::SmallVector<unsigned> rowStack, colStack({pos});
+  // The following code performs a graph traversal, starting from the target
+  // variable, to identify all variables(recorded in relatedCols) and
+  // constraints(recorded in relatedRows) belonging to the same connected
----------------
Superty wrote:

nit: please leave a space before opening parentheses `(`

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


More information about the Mlir-commits mailing list