[InstCombine] fold gep-of-select-of-constants (PR45084)
authorSanjay Patel <spatel@rotateright.com>
Mon, 9 Mar 2020 21:24:11 +0000 (17:24 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 10 Mar 2020 13:25:13 +0000 (09:25 -0400)
commit467eec09109f37646ada72a4fbb1ef99eec8bb09
tree3d848566ee11fc16b5672086bcbfa35c3a82e107
parent5b465ad29024bc0d89304010da3b4bdb05c24a9e
[InstCombine] fold gep-of-select-of-constants (PR45084)

As shown in:
https://bugs.llvm.org/show_bug.cgi?id=45084
...we failed to combine a gep with constant indexes with a
pointer operand that is a select of constants.

Differential Revision: https://reviews.llvm.org/D75807
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/getelementptr.ll
llvm/test/Transforms/InstCombine/mem-gep-zidx.ll