File: Transforms/InstSimplify/compare.ll define i1 @gep_same_base_constant_indices(i8* %a) { ; CHECK-NEXT: ret i1 true ; %arrayidx1 = getelementptr inbounds i8, i8* %a, i64 1 %arrayidx2 = getelementptr inbounds i8, i8* %a, i64 10 %cmp = icmp slt i8* %arrayidx1, %arrayidx2 ret i1 %cmp } Folding such unsigned comparisons is correct, but not for signed as an object may cross the unsigned/signed line, e.g: ptr = malloc(42) // 0x7fff..ff0 ptr + 42 // 0x8....
https://reviews.llvm.org/D113343
Fixed by https://github.com/llvm/llvm-project/commit/e3cec17b2db292227a2b92d46e653372dad711af.