[Mlir-commits] [mlir] [mlir][scf] Revisit affected loops during range folding (PR #230961)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Oct 11 08:57:39 PDT 2026
Michael-Chen-NJU wrote:
> I wonder if we should convert this to `RewritePattern` so greedy driver can handle all the fixed point iteration for us. It will also be better composable with the existing canonicalization patterns.
Thanks for the suggestion! I've updated the PR to use `OpRewritePattern` with the greedy driver.
I noticed two potential trade-offs. First is that the greedy driver can remove dead scf.for loops even when no range folding is performed. And the second is on a synthetic 1000-level nested-loop test, the greedy version takes ~39s vs. ~0.18s with the targeted worklist (measured as mlir-opt wall-clock time). This is an extreme stress case, but it suggests significant overhead from ancestor re-enqueuing.
The performance case is admittedly extreme, but I'm wondering whether these trade-offs are acceptable, or if there's a better way to use the pattern infrastructure here?
https://github.com/llvm/llvm-project/pull/230961
More information about the Mlir-commits
mailing list