[llvm] [DA] Add tests for nsw doesn't hold on entire iteration space (NFC) (PR #162281)
Ehsan Amiri via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 27 19:46:15 PST 2025
================
----------------
amehsan wrote:
> It is guaranteed that the nowrap property holds within the defining scope of the SCEV. This means that the nowrap property of an addrec holds on all executed iterations of the loop. It is therefore reasonable to rely on this contract. I'd recommend to read [this article](https://www.npopov.com/2023/10/03/LLVM-Scalar-evolution.html#nowrap-flags) and [#159846 (comment)](https://github.com/llvm/llvm-project/issues/159846#issuecomment-3380981125).
If we rely on SCEV behavior, I may be able to simplify my proofs too. Let me check if it is possible. Also I need to look into the compile time issue a little more. Give me some time for that.
> [this article](https://www.npopov.com/2023/10/03/LLVM-Scalar-evolution.html#nowrap-flags)
Not directly related to your proposed change, but: the article explains the design, but it doesn't say why it is designed this way. By any chance do you have an example that something breaks if we keep IR's nsw flag for subscripts that are executed under a condition (Assume the load/store that uses the subscript is also under the same condition)
https://github.com/llvm/llvm-project/pull/162281
More information about the llvm-commits
mailing list