[MLIR] Fix iteration counting in greedy pattern application

Previously, checking that a fix point is reached was counted as a full
iteration. As this "iteration" never changes the IR, this seems counter-
intuitive.

Differential Revision: https://reviews.llvm.org/D123641
This commit is contained in:
Frederik Gossen 2022-04-21 15:14:07 -04:00
parent e80ee1829c
commit 673e9828be
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ bool GreedyPatternRewriteDriver::simplify(MutableArrayRef<Region> regions) {
if (config.enableRegionSimplification)
changed |= succeeded(simplifyRegions(*this, regions));
} while (changed &&
(++iteration < config.maxIterations ||
(iteration++ < config.maxIterations ||
config.maxIterations == GreedyRewriteConfig::kNoIterationLimit));
// Whether the rewrite converges, i.e. wasn't changed in the last iteration.