[InstCombine] change 'not' match for bitwise select
authorSanjay Patel <spatel@rotateright.com>
Tue, 2 Nov 2021 13:42:41 +0000 (09:42 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 2 Nov 2021 14:16:01 +0000 (10:16 -0400)
commit829146164f23701f9c5975fadb10ff2d4d100cdc
treeca3bada957f909f34998d083761bf7b9b1dc7764
parente178b56c12a6d1885b3dd899dbf3ceee526c6ba3
[InstCombine] change 'not' match for bitwise select

The tests diffs are logically equivalent, and so this is
generally NFC, but this makes the code match the code
comment.

It should also be more efficient. If we choose the 'not'
operand (rather than the 'not' instruction) as the select
condition, then we don't have to invert the select
condition/operands as a subsequent transform.
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/logical-select-inseltpoison.ll
llvm/test/Transforms/InstCombine/logical-select.ll