[InstCombine] Fold icmp eq of non-inbounds gep with base pointer
authorNikita Popov <npopov@redhat.com>
Tue, 21 Mar 2023 09:16:51 +0000 (10:16 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 21 Mar 2023 09:20:11 +0000 (10:20 +0100)
commite8ec42b80b5dc75186dca543572416f2f2e21475
tree8f9c23c16849996c2667cd7676d03b07e38d8bc4
parent9437bf418a7fdb9a1079f416dd28bb7107161d74
[InstCombine] Fold icmp eq of non-inbounds gep with base pointer

For equality comparisons, we don't need the gep to be inbounds:
https://alive2.llvm.org/ce/z/Fe_kn2
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/compare-alloca.ll
llvm/test/Transforms/InstCombine/icmp-gep.ll