[Mlir-commits] [mlir] [mlir] Allow unroll & jam on SCF loops with results (PR #98887)

Aviad Cohen llvmlistbot at llvm.org
Mon Jul 22 00:39:06 PDT 2024


================
@@ -486,12 +486,15 @@ LogicalResult mlir::loopUnrollByFactor(
 }
 
 /// Check if bounds of all inner loops are defined outside of `forOp`
-/// and return false if not.
+/// or defined by constants, and return false if not.
 static bool areInnerBoundsInvariant(scf::ForOp forOp) {
   auto walkResult = forOp.walk([&](scf::ForOp innerForOp) {
-    if (!forOp.isDefinedOutsideOfLoop(innerForOp.getLowerBound()) ||
-        !forOp.isDefinedOutsideOfLoop(innerForOp.getUpperBound()) ||
-        !forOp.isDefinedOutsideOfLoop(innerForOp.getStep()))
+    if (!(forOp.isDefinedOutsideOfLoop(innerForOp.getLowerBound()) ||
----------------
AviadCo wrote:

yes

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


More information about the Mlir-commits mailing list