[ConstantFold] fix inconsistent handling of extractelement with undef index (PR42689)
authorSanjay Patel <spatel@rotateright.com>
Sun, 13 Oct 2019 17:34:08 +0000 (17:34 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 13 Oct 2019 17:34:08 +0000 (17:34 +0000)
commitb32e4664a7156830aa6a5c97d9074269574b1f98
treeb713b63f627689db357b9e8cec46cdea702ba72e
parentf90728c3227d86794819e945ab79f46a6933f95a
[ConstantFold] fix inconsistent handling of extractelement with undef index (PR42689)

Any constant other than zero was already folded to undef if the index is undef.
https://bugs.llvm.org/show_bug.cgi?id=42689

llvm-svn: 374729
llvm/lib/IR/ConstantFold.cpp
llvm/test/Transforms/ConstProp/InsertElement.ll