[Mlir-commits] [mlir] Make index computation used divsi/remsi (PR #124390)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 24 20:16:33 PST 2025


MaheshRavishankar wrote:

> It does prevent some folding. AFAIU this is legal
> 
> ```
> %0 = arith.muli %a, %b : index
> %1 = arith.divsi %0, %b : index
> ```
> 
> To just be `%a` when I add `nsw` on the `muli`. But I cant really add `nuw` to index computations without analysis. My understanding is that it's just better to keep all indexing math signed 


At the very least there needs to be some analysis to prove that you can used unsigned math, and that isn't happening here.


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


More information about the Mlir-commits mailing list