[llvm] [DA] Rewrite the formula in the Strong SIV test (PR #179665)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 04:03:08 PST 2026


nikic wrote:

Can we express the condition proposed here like this instead?
```
ConstantRange SrcRange = SE->getSignedRange(Src);
ConstantRange DstRange = SE->getSignedRange(Dst);
return SrcRange.intersectWith(DstRange).isEmptySet();
```
This leaves the heavy lifting to SCEV and does not require nowrap flags -- not that I expect it to be useful, but we *can* prove disjointness of wrapping ranges as well. It's also not specific to *strong* SIV in particular. This seems like something we should just be checking upfront to discharge the "obvious" cases that BasicAA does not catch itself.

(Note that this does not take into account overlap due to the size of the final access -- but it looks like DA does isKnownMultipleOf checks early on to not have to deal with this.)

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


More information about the llvm-commits mailing list