[InstCombine] Use commutable matchers to reduce some code. NFC

llvm-svn: 301294
This commit is contained in:
Craig Topper 2017-04-25 06:02:11 +00:00
parent 860f0a2bad
commit c4b48a32f0
1 changed files with 2 additions and 4 deletions

View File

@ -1407,11 +1407,9 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
}
// (A&((~A)|B)) -> A&B
if (match(Op0, m_Or(m_Not(m_Specific(Op1)), m_Value(A))) ||
match(Op0, m_Or(m_Value(A), m_Not(m_Specific(Op1)))))
if (match(Op0, m_c_Or(m_Not(m_Specific(Op1)), m_Value(A))))
return BinaryOperator::CreateAnd(A, Op1);
if (match(Op1, m_Or(m_Not(m_Specific(Op0)), m_Value(A))) ||
match(Op1, m_Or(m_Value(A), m_Not(m_Specific(Op0)))))
if (match(Op1, m_c_Or(m_Not(m_Specific(Op0)), m_Value(A))))
return BinaryOperator::CreateAnd(A, Op0);
// (A ^ B) & ((B ^ C) ^ A) -> (A ^ B) & ~C