[Mlir-commits] [mlir] [mlir][arith] Fix multiplication canonicalizations (PR #144787)

Mehdi Amini llvmlistbot at llvm.org
Fri Jun 20 05:17:22 PDT 2025


joker-eph wrote:

> Thanks for fixing this. I think we should drop these canon patterns all together -- the issue is that one of the results is always unused so it's probably too aggressive to be enabled by default without a clear benefit.

Why is it a problem? Seems like the cost-model thing is a lowering problem.
At the arithmetic level: having less op is generally beneficial. If mulsi_extended is considered differently then it probably should move out of the arith dialect.

> Similarly, it doesn't allow us to decompose muli_extended to plain muli without being folded back again.

That is completely expected: this kind of decomposition are "lowering" (or "codegen prepare") and as such aren't expected to be resilient to canonicalization.


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


More information about the Mlir-commits mailing list