[Mlir-commits] [mlir] [mlir][scf]: Add value bound for the computed upper bound of for loop (PR #126426)

Amir Bishara llvmlistbot at llvm.org
Mon Feb 10 00:55:24 PST 2025


================
@@ -93,9 +99,18 @@ struct ForOpInterface
     auto forOp = cast<ForOp>(op);
 
     if (value == forOp.getInductionVar()) {
-      // TODO: Take into account step size.
       cstr.bound(value) >= forOp.getLowerBound();
       cstr.bound(value) < forOp.getUpperBound();
+      // iv <= lb + ((ub-lb)/step - 1) * step
+      // This bound does not replace the `iv < ub` constraint mentioned above,
+      // since constraints involving the multiplication of two two constraint
----------------
amirBish wrote:

ooh missed it, fixed thanks.

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


More information about the Mlir-commits mailing list