Skip to content

Commit 9d4f202

Browse files
authored
Switch to bottom up traversal in parallel reset (#227)
Yields a roughly 3x performance improvement on my local machine.
1 parent 0bb92da commit 9d4f202

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/Dialect/QUIR/Transforms/MergeParallelResets.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ void MergeResetsLexicographicPass::runOnOperation() {
104104
mlir::RewritePatternSet patterns(&getContext());
105105
mlir::GreedyRewriteConfig config;
106106

107-
// use cheaper top-down traversal (in this case, bottom-up would not behave
108-
// any differently)
109-
config.useTopDownTraversal = true;
107+
// Bottom up traversal is 3x as fast
108+
config.useTopDownTraversal = false;
110109
// Disable to improve performance
111110
config.enableRegionSimplification = false;
112111

@@ -214,9 +213,8 @@ void MergeResetsTopologicalPass::runOnOperation() {
214213
mlir::RewritePatternSet patterns(&getContext());
215214
mlir::GreedyRewriteConfig config;
216215

217-
// use cheaper top-down traversal (in this case, bottom-up would not behave
218-
// any differently)
219-
config.useTopDownTraversal = true;
216+
// Bottom up traversal is 3x as fast
217+
config.useTopDownTraversal = false;
220218
// Disable to improve performance
221219
config.enableRegionSimplification = false;
222220

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Parallel reset merging passes have been switched to a bottom up traversal
5+
as this is roughly 3x faster.

0 commit comments

Comments
 (0)