Fixes#190187
Currently, SeparateConstOffsetFromGEP preserves inbounds attribute if
new sequence of GEPs from the same base pointer has non-negative offsets
in each GEP (this was mentioned in
https://github.com/llvm/llvm-project/pull/159515). This statement seems
correct for me (if the sequence consists from 2 GEPs), but current
implementation has a flaw: it checks that constant byte offset and GEP
indices are non-negative. However, in some corner cases we can have a
situation when the index is non-negative, but its offset (in bytes) is
negative, so we can't preserve inbounds attribute. In the example, GEP
index after transformation can have values
`0x7ffffffffffffffd`/`0x7ffffffffffffffe`/`0x7fffffffffffffff`; they are
all non-negative (sign bit is zero), however, after multiplication on
sizeof(i64) they become negative and inbounds can't be preserved
anymore.
The proposed fix is to check that Idx * ElementStride is non-negative
(instead of checking Idx only).