[InstCombine] add DeMorgan folds for logical ops in select form
authorSanjay Patel <spatel@rotateright.com>
Mon, 14 Jun 2021 16:10:48 +0000 (12:10 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 14 Jun 2021 16:54:35 +0000 (12:54 -0400)
commit8591640379ac9175a8a8493126ecf0b44e3bb4af
tree4d53e2a3cde860d70ba5b010472b6707e93d9c50
parent56ae4f23b227897361d2a7c84364a6df81f3c327
[InstCombine] add DeMorgan folds for logical ops in select form

We canonicalized to these select patterns (poison-safe logic)
with D101191, so we need to reduce 'not' ops when possible
as we would with 'and'/'or' instructions.

This is shown in a secondary example in:
https://llvm.org/PR50389

https://alive2.llvm.org/ce/z/BvsESh
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select-and-or.ll