[Mlir-commits] [mlir] [mlir] Check greedy rewrite fingerprints and changed flag (PR #232576)
Hideto Ueno
llvmlistbot at llvm.org
Fri Oct 16 18:09:31 PDT 2026
================
@@ -954,10 +954,23 @@ mlir::applyPatternsGreedily(Region ®ion,
"greedy pattern rewriter input IR failed to verify");
#endif // MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS
+#ifdef EXPENSIVE_CHECKS
+ OperationFingerPrint before(config.getScope()->getParentOp());
+ bool rewriteChanged = false;
+ if (!changed)
+ changed = &rewriteChanged;
+#endif // EXPENSIVE_CHECKS
+
// Start the pattern driver.
RegionPatternRewriteDriver driver(region.getContext(), patterns, config,
region);
LogicalResult converged = std::move(driver).simplify(changed);
+#ifdef EXPENSIVE_CHECKS
+ if (!*changed &&
----------------
uenoku wrote:
Done in https://github.com/llvm/llvm-project/pull/232576/changes/f79fa27e4ad8cf7e8048f40f0a7d2c8fec0c0196.
The local variable rewriteChanged is changed to pass to `simplify` in order to handle cases when callers of applyPatternsGreedily reuse changed flag across multiple invocations.
https://github.com/llvm/llvm-project/pull/232576
More information about the Mlir-commits
mailing list