[Mlir-commits] [mlir] [mlir] Extend SCF loopUnrollByFactor to return the result loops (PR #114573)

Hongtao Yu llvmlistbot at llvm.org
Sun Nov 3 10:23:35 PST 2024


================
@@ -490,7 +494,8 @@ LogicalResult mlir::loopUnrollByFactor(
       annotateFn, iterArgs, yieldedValues);
   // Promote the loop body up if this has turned into a single iteration loop.
   (void)forOp.promoteIfSingleIteration(rewriter);
-  return success();
+  resultLoops.mainLoopOp = forOp;
----------------
htyu wrote:

Good catch! In this case looks like we cannot rely on when the resulting main loop is null for success or failure, perhaps `resultLoops` should be returned by a byref parameter?

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


More information about the Mlir-commits mailing list