[Mlir-commits] [mlir] [mlir][scf] Fix scf.forall to scf.parallel pass walker (PR #95385)

Adam Siemieniuk llvmlistbot at llvm.org
Thu Jun 13 06:36:54 PDT 2024


================
@@ -71,8 +71,9 @@ struct ForallToParallelLoop final
 
     parentOp->walk([&](scf::ForallOp forallOp) {
       if (failed(scf::forallToParallelLoop(rewriter, forallOp))) {
-        return signalPassFailure();
+        return WalkResult::skip();
----------------
adam-smnk wrote:

The result is not a real failure as it only occurs on match failure.

The main motivation for the change is that simply calling `signalPassFailure()` produces no output when the pass is called (at least from CLI). I'd expect the IR to remain unchanged in such case.
I think I should've captures the walk result and added some error on interruption. But there is no reason to interrupt on this error.

Perhaps a greedy rewriter could be better here instead of walking the graph manually.

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


More information about the Mlir-commits mailing list