The greedy pattern rewrite driver previously only deduplicated constant ops between iterations (via the operation folder). Structurally identical non-constant subexpressions remained distinct SSA values, blocking fold patterns that only fire when operands match. Reaching the true fixpoint required chaining an external `cse,canonicalize,...` pipeline. Add an opt-in `cseBetweenIterations` flag on `GreedyRewriteConfig` that runs full CSE on the scoped region after each pattern-application iteration, and surface it as a `cse-between-iterations` option on the canonicalizer pass. Off by default to preserve existing performance characteristics. Assisted-by: Claude Code
39 KiB
39 KiB