Remove duplicated ConditonOp args, remove unused init/yield args
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/SCF/IR/SCF.cpp | ||
---|---|---|
3815 | Will do in separate review |
mlir/lib/Dialect/SCF/IR/SCF.cpp | ||
---|---|---|
3796 | This isn't used before the early exit, can you move this closer to its use? | |
3798 | There is a getConditionOp() method on WhileOp. | |
3801 | Shall we reserve() these before the loop? I'm also not sure if we could do better to filter out the "do nothing case" (which is the most important one to optimize for). | |
3841 | mergeBlocks is pretty expensive: it is possible to steal the block as the new body of the region instead? Isn't the destination block empty? | |
mlir/test/Dialect/SCF/canonicalize.mlir | ||
1249 | Do we need that many checks? Seems like a CHECK-NOT: test.val1 would do the job here, potentially after a CHECK: scf.while : () -> i32. The rest seems spurious. |
There is a another issue, there is an existing WhileUnusedArg pattern, but it is not added anywhere, and test which was supposed to check it passes because of unrelated pattern. I'll do another PR to clean thing up
mlir/test/Dialect/SCF/canonicalize.mlir | ||
---|---|---|
1249 | I still want to check general structure of the loop is preserved. |
mlir/lib/Dialect/SCF/IR/SCF.cpp | ||
---|---|---|
3841 | mergeBlocks just doing replaceAllUsesWith + getOperations().splice, is it really that expensive? |
This isn't used before the early exit, can you move this closer to its use?