[Mlir-commits] [mlir] [MLIR] Make test-block-is-in-loop pass a module pass (PR #184036)
Mehdi Amini
llvmlistbot at llvm.org
Mon Mar 2 03:56:27 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:
Any example where that would change the output?
https://github.com/llvm/llvm-project/pull/184036
More information about the Mlir-commits
mailing list