[Mlir-commits] [mlir] [mlir][spirv] Fix FuncOpVectorUnroll to process placeholder values in all blocks (PR #142339)

Jakub Kuderski llvmlistbot at llvm.org
Mon Jun 9 08:20:52 PDT 2025


================
@@ -1020,35 +1020,39 @@ struct FuncOpVectorUnroll final : OpRewritePattern<func::FuncOp> {
     SmallVector<Location> locs(convertedTypes.size(), newFuncOp.getLoc());
     entryBlock.addArguments(convertedTypes, locs);
 
-    // Replace the placeholder values with the new arguments. We assume there is
-    // only one block for now.
+    // Replace the placeholder values with the new arguments.
     size_t unrolledInputIdx = 0;
-    for (auto [count, op] : enumerate(entryBlock.getOperations())) {
+    newFuncOp.walk([&](Operation *op) {
----------------
kuhar wrote:

Why do we use `.walk` instead of iterating over all blocks? Is the assumption that there will be no remaining ops with nested regions?

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


More information about the Mlir-commits mailing list