[InstSimplify] Remove incorrect icmp of gep fold (PR52429)
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Nov 2021 11:54:29 +0000 (12:54 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Nov 2021 20:03:21 +0000 (21:03 +0100)
commite3cec17b2db292227a2b92d46e653372dad711af
tree04cf65e497feb604d19c240e4375359b44d5b3b4
parent859a6d973f3d9c9fde9c7de44b8a215711eb5141
[InstSimplify] Remove incorrect icmp of gep fold (PR52429)

As described in https://bugs.llvm.org/show_bug.cgi?id=52429 this
fold is incorrect, because inbounds only guarantees that the
pointers don't wrap in the unsigned space: It is possible that
the sign boundary is crossed by an object.

I'm dropping the fold entirely rather than adjusting it, because
computePointerICmp() fully subsumes it (just with correct predicate
handling).

Differential Revision: https://reviews.llvm.org/D113343
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
llvm/test/Transforms/InstCombine/icmp.ll
llvm/test/Transforms/InstSimplify/compare.ll