[Mlir-commits] [mlir] [MLIR][Arith] Partially fold and / or / xor const tripples (PR #195588)

Max Graey llvmlistbot at llvm.org
Mon May 4 03:11:19 PDT 2026


MaxGraey wrote:

In my head hierarchy of MLIR optimizations looks like this (from simplest to most complex). Please correct me if I’m wrong:

- Folding during op construction, e.g. building `x + 0 --> x` when possible. _(cheapest)_
- Local canonicalization via `fold` hooks and greedy rewrite patterns like  `-canonicalize` with bounded iterations.
- Dedicated optimization passes that require analyses, target/pipeline context, or multiple cleanup rounds like `-arith-int-range-narrowing` plus `canonicalize/cse` _(expensive)_.

https://github.com/llvm/llvm-project/pull/195588


More information about the Mlir-commits mailing list