[InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non...
authorCraig Topper <craig.topper@intel.com>
Thu, 9 Jul 2020 18:01:11 +0000 (11:01 -0700)
committerCraig Topper <craig.topper@intel.com>
Thu, 9 Jul 2020 18:01:12 +0000 (11:01 -0700)
commit122b0640fc97202bacb630744dfc6da58f11af42
tree37871bc96e5b99aa7f93b38f39742c41c1db2936
parentf5f58f1f733b880decfb8f12ebba6126da818496
[InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison

We can't fold to the non-undef value unless we know it isn't poison. So check each element with isGuaranteedNotToBeUndefOrPoison. This currently rules out all constant expressions.

Differential Revision: https://reviews.llvm.org/D83442
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/select.ll