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.
Details
Details
Diff Detail
Diff Detail
|  Differential  D83442  
[InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison Authored by craig.topper on Jul 8 2020, 4:41 PM. 
Details 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. 
Diff Detail |