[llvm] [SCEV] Consolidate code for proving wrap flags of controlling finite IVs (PR #101404)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 07:52:33 PDT 2024
preames wrote:
> hough this doesn't really look NFC to me. The old code only handled the power of 2 case, while the new one handles any positive step. These are the same if we get the NW from the power of 2 reasoning, but we should also be able to handle additional cases in case we know NW through some other pathway and the step is not power of 2. Don't know if it's feasible to test this.
You're 100% right here. I was focused on the proof through the power-of-two logic, but in principle, any proof of no-self-wrap is now sufficient. In terms of testing, it's going to be difficult because most of the ways we explicitly prove no-self-wrap during addrec construction will also prove nsw/nuw. I think the most likely path is when we construct an optimized addrec and drop most flags at various places during SCEV construction. I'm going to give that a bit more thought and see if I can find anything.
https://github.com/llvm/llvm-project/pull/101404
More information about the llvm-commits
mailing list