llvm-project/llvm/test/Transforms/SeparateConstOffsetFromGEP
Fabian Ritter 3cc1b7c2e0
[SeparateConstOffsetFromGEP] Check if non-extracted indices may be negative when preserving inbounds (#159515)
If we know that the initial GEP was inbounds, and we change it to a sequence of
GEPs from the same base pointer where every offset is non-negative, then the
new GEPs are inbounds. So far, the implementation only checked if the extracted
offsets are non-negative. In cases where non-extracted offsets can be negative,
this would cause the inbounds flag to be wrongly preserved.

Fixes an issue in #130617 found by nikic.
2025-09-19 09:01:14 +02:00
..