Skip to content

Commit 677ae42

Browse files
authored
[Global Opt] Fix transpose propagation failure (#19322)
When applying the "bubbling" patterns in the transpose propagation pass, the greedy rewriter was failing because it reached 10 iterations before converging. This PR sets the iteration limit to `kNoLimit` which is the same config used for the "sinking" patterns that are applied afterwards. This is needed because these patterns take a bit to converge. Fixes #19320 Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
1 parent ad4cf1a commit 677ae42

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/iree/compiler/GlobalOptimization/PropagateLinalgTranspose.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,11 @@ void PropagateLinalgTransposePass::runOnOperation() {
11041104
context, /*benefit=*/2);
11051105
bubblingPatterns.insert<ComposeTransposes>(context);
11061106
populateCommonCanonicalizationPatterns(context, bubblingPatterns);
1107-
if (failed(applyPatternsAndFoldGreedily(funcOp,
1108-
std::move(bubblingPatterns)))) {
1107+
1108+
GreedyRewriteConfig config;
1109+
config.maxIterations = GreedyRewriteConfig::kNoLimit;
1110+
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(bubblingPatterns),
1111+
config))) {
11091112
funcOp.emitError("Transpose bubbling patterns failed");
11101113
return signalPassFailure();
11111114
}

0 commit comments

Comments
 (0)