[InstCombine] fix potential miscompile in select value equivalence
authorSanjay Patel <spatel@rotateright.com>
Mon, 5 Apr 2021 16:14:49 +0000 (12:14 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 5 Apr 2021 16:25:40 +0000 (12:25 -0400)
commitc590a9880d7a660a1c911fce07f3d01ea18be2df
tree526919e4e807b363dc46f5b3ed3c1b119f1b53d7
parentc0b0da4684908b8e8143c0762fc766c1a2a5849f
[InstCombine] fix potential miscompile in select value equivalence

As shown in the example based on:
https://llvm.org/PR49832
...and the existing test, we can't substitute
a vector value because the equality compare
replacement that we are attempting requires
that the comparison is true for the entire
value. Vector select can be partly true/false.
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select-binop-cmp.ll