[PATCH] D94870: [InstSimplify] Handle commutativity for 'and' and 'outer or' for (~A & B) | ~(A | B) --> ~A
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 16 10:13:14 PST 2021
xbolva00 added inline comments.
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2272
match(Op1, m_Not(m_c_Or(m_Specific(A), m_Specific(B)))))
- return cast<BinaryOperator>(Op0)->getOperand(0);
+ return cast<BinaryOperator>(Op0)->getOperand(0) == B
+ ? cast<BinaryOperator>(Op0)->getOperand(1)
----------------
lebedev.ri wrote:
> Just capture it when patternmatching?
Oh yeah, m_CombineAnd :)
Fixed.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94870/new/
https://reviews.llvm.org/D94870
More information about the llvm-commits
mailing list