[InstCombine] canonicalize branch with logical-and-not condition
authorSanjay Patel <spatel@rotateright.com>
Mon, 31 Oct 2022 19:49:03 +0000 (15:49 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 31 Oct 2022 19:51:45 +0000 (15:51 -0400)
commit115d2f69a515cd756fa51969f5dba433475c459c
treefa77c362fc71d95b6e25df133d0b57663c8dcfb8
parenta7265f910242bb9bfea4717574a38cff436e34c9
[InstCombine] canonicalize branch with logical-and-not condition

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

In the motivating case from issue #58313,
this allows forming a duplicate 'not' op
which then gets CSE'd and simplifyCFG'd
and combined into the expected 'xor'.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/branch.ll
llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll