[Mlir-commits] [mlir] [mlir][Affine] Add nuw/nsw to lowering of affine ops. (PR #121535)

Krzysztof Drewniak llvmlistbot at llvm.org
Thu Jan 2 23:42:08 PST 2025


https://github.com/krzysz00 requested changes to this pull request.

Sadly, I don't think this change is correct. If it is correct.

That being said, I think that the broader point about overflows has something to it. I claim that all the additions and multiplications in an affine map (and so also in `AffineExpandIndexOps.cpp` and the other utilities) are `nsw` - assuming we document this - because the result of any operation is guaranteed not to wrap `index` in a signed way (for whatever the eventual width of `index` is)

Now, `nsw && [proof of non-negativity] => nuw`, but I don't think that can be done at this stage of codegen.

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


More information about the Mlir-commits mailing list