[Mlir-commits] [mlir] [mlir][spirv] Fix FuncOpVectorUnroll to process placeholder values in all blocks (PR #142339)
Darren Wihandi
llvmlistbot at llvm.org
Mon Jun 9 23:24:07 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) {
----------------
fairywreath wrote:
There is actually no need for this `.walk`, I have updated the code to just perform a `replaceAllUsesWith` on the placeholder ops.
https://github.com/llvm/llvm-project/pull/142339
More information about the Mlir-commits
mailing list