[SDAG] simplify bitwise logic with repeated operand
authorSanjay Patel <spatel@rotateright.com>
Sun, 13 Mar 2022 15:06:53 +0000 (11:06 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 13 Mar 2022 15:12:30 +0000 (11:12 -0400)
commitc2592c374e469f343ecea82d6728609650924259
tree5e93d507fef89b499b41b00bd1b33481b8bb6745
parent9f4caf55dba417d4d67526d7bc8f23a12090bca9
[SDAG] simplify bitwise logic with repeated operand

We do not have general reassociation here (and probably
do not need it), but I noticed these were missing in
patches/tests motivated by D111530, so we can at
least handle the simplest patterns.

The VE test diff looks correct, but we miss that
pattern in IR currently:
https://alive2.llvm.org/ce/z/u66_PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/logic-reassociate.ll
llvm/test/CodeGen/VE/Scalar/max.ll
llvm/test/CodeGen/X86/legalize-shift.ll
llvm/test/CodeGen/X86/pr32345.ll
llvm/test/CodeGen/X86/pr34137.ll
llvm/test/CodeGen/X86/urem-seteq.ll