[llvm] [Analysis] Bail out for negative offsets in isDereferenceableAndAlignedInLoop (PR #99490)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 04:01:50 PDT 2024


david-arm wrote:

> Thanks for splitting this off!
> 
> I think https://llvm.godbolt.org/z/boYbjenvq may serve as a test case; it is using a pointer width of 16 (via the data layout and an alloca that's spanning more than half the available address space) and the GEP computing the address for the conditional load must wrap I think, which would make the `inbounds` GEP poison, so we shouldn't execute this unconditionally.

Thanks a lot for this @fhahn! Your test has actually exposed a genuine bug that's now fixed by this patch. We were treating loads with negative offsets from allocas as being dereferenceable.

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


More information about the llvm-commits mailing list