[DAGCombiner] match inverted/swapped patterns for vselect of mask of signbit
authorSanjay Patel <spatel@rotateright.com>
Sun, 14 Nov 2021 14:25:00 +0000 (09:25 -0500)
committerSanjay Patel <spatel@rotateright.com>
Sun, 14 Nov 2021 14:35:26 +0000 (09:35 -0500)
commit254c5246e9204f4d799f41c09068243e3a308177
treed97af67e73aac344afb5ad9e18dc327f05b0d8d1
parentfce3eed9f93afac512d809c22234db7be7a9d478
[DAGCombiner] match inverted/swapped patterns for vselect of mask of signbit

This was noted as a follow-up to D113212 / D113426:
4fc1fc4005f7
7e30404c3b6c
11522cfcad6b

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

The canonicalization rules for these IR patterns are complicated,
and we were not matching the expected forms in 2 out of the 3
cases. We can make codegen more robust by matching the swapped
forms (and that will also work if these patterns are created late).
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/cmp-select-sign.ll
llvm/test/CodeGen/AArch64/vselect-constants.ll
llvm/test/CodeGen/X86/vselect-zero.ll