[Mlir-commits] [mlir] [SCF] Fixed epilogue predicates in loop pipelining (PR #108964)

Thomas Raoux llvmlistbot at llvm.org
Tue Sep 17 05:10:51 PDT 2024


================
@@ -671,9 +674,9 @@ LoopPipelinerInternal::emitEpilogue(RewriterBase &rewriter,
     setValueMapping(forOp.getInductionVar(), newlastIter, maxStage - i);
 
     if (dynamicLoop) {
-      // pred = iterI >= lb
+      // pred = iterI < 0
       predicates[i + 1] = rewriter.create<arith::CmpIOp>(
-          loc, arith::CmpIPredicate::sge, iterI, lb);
+          loc, arith::CmpIPredicate::slt, iterI, zero);
----------------
ThomasRaoux wrote:

shouldn't this be `pred = iterI >= 0`? So the predicate is true only when iterI is negative seems odd considering `iterI = total_iters - 1 - i`?

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


More information about the Mlir-commits mailing list