[DAGCombiner] add fold for vselect based on mask of signbit, part 2
authorSanjay Patel <spatel@rotateright.com>
Fri, 5 Nov 2021 17:28:35 +0000 (13:28 -0400)
committerSanjay Patel <spatel@rotateright.com>
Fri, 5 Nov 2021 19:02:12 +0000 (15:02 -0400)
commit7e30404c3b6c3610a0d704e8433a3a3134ce982a
tree74dab0ae16a02b02e3b76fdb14fd54f5fd505d26
parent4d513f2527ffe1cc279012bbc8008671194429c1
[DAGCombiner] add fold for vselect based on mask of signbit, part 2

This is the 'or' sibling for the fold added with:
D113212

https://alive2.llvm.org/ce/z/tgnp7K

Note that neither of these transforms is poison-safe,
but it does not seem to matter at this level. We have
had the scalar version of D113212 for a long time, so
this is just making optimizer behavior consistent.

We do not have the scalar version of *this* fold,
however, so that is another follow-up.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/vselect-constants.ll
llvm/test/CodeGen/Thumb2/mve-vselect-constants.ll
llvm/test/CodeGen/X86/vselect-zero.ll