[Mlir-commits] [mlir] [mlir][arith] Restrict mulsi_extended(x, 1) rewrite to integer types (PR #233234)

Prakhar Dixit llvmlistbot at llvm.org
Tue Oct 20 00:21:16 PDT 2026


Prakhar-Dixit wrote:

@kuhar Before reworking this PR, I looked for earlier discussion and found that this has come up before: #85973 and #84986, and more recently #223265, which kept index support in the addui_extended lowering. cc @joker-eph, @gysit, @math-fehr

The underlying issue affects all four extended ops (addui_extended, subui_extended, mulsi_extended, mului_extended), their folders assume a 64-bit index, so results can depend on pass order. For example, mului_extended 65536, 65536 : index folds to high = 0, but lowering it to SPIR-V first (index -> i32) gives high = 1.

I see two consistent options:

1. Disallow index on all four ops, as was done for arith.bitcast in #121455.
2. Keep index - land this canonicalization fix, then make the four folders width safe in a follow-up, folding only when the 32-bit and 64-bit results agree.

Which direction would you prefer? I'm happy to implement either.

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


More information about the Mlir-commits mailing list