[InstCombine] In visitXor, use m_Not on the instruction itself instead of looking for all ones in Op1. This is consistent with 3 other not checks before this one. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2017-06-29 00:07:08 +00:00
parent bde81f144d
commit 01c9f8cd03

View File

@ -2456,10 +2456,9 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
}
}
// xor (cmp A, B), true = not (cmp A, B) = !cmp A, B
// not (cmp A, B) = !cmp A, B
ICmpInst::Predicate Pred;
if (match(Op0, m_OneUse(m_Cmp(Pred, m_Value(), m_Value()))) &&
match(Op1, m_AllOnes())) {
if (match(&I, m_Not(m_OneUse(m_Cmp(Pred, m_Value(), m_Value()))))) {
cast<CmpInst>(Op0)->setPredicate(CmpInst::getInversePredicate(Pred));
return replaceInstUsesWith(I, Op0);
}