[InstCombine] Make indexed compare fold opaque ptr compatible
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 24 Jun 2021 20:31:06 +0000 (22:31 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 24 Jun 2021 20:33:01 +0000 (22:33 +0200)
commit5cb20ef8a235c2027489a196bba27630ca21a00b
tree93883bfa6c963a45346ea3069054bc961f73eb15
parent4c8174f54b4ec3c6dac8ad446567174442bf3c29
[InstCombine] Make indexed compare fold opaque ptr compatible

Rather than relying on pointer type equality (which, for a change,
is silently incorrect with opaque pointers) check that the GEP
source element types match.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/indexed-gep-compares.ll