[Mlir-commits] [mlir] [MLIR] Make IsInLoopPass thread-safe (PR #184036)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 2 02:39:37 PST 2026


================
@@ -27,16 +27,18 @@ struct IsInLoopPass
   }
 
   void runOnOperation() override {
-    mlir::func::FuncOp func = getOperation();
-    func.walk([](mlir::Block *block) {
-      llvm::outs() << "Block is ";
-      if (LoopLikeOpInterface::blockIsInLoop(block))
-        llvm::outs() << "in a loop\n";
-      else
-        llvm::outs() << "not in a loop\n";
-      block->print(llvm::outs());
-      llvm::outs() << "\n";
-    });
+    ModuleOp module = getOperation();
+    for (auto func : module.getOps<func::FuncOp>()) {
----------------
joker-eph wrote:

Why not just walk from the Module?

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


More information about the Mlir-commits mailing list