[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
llvm-svn: 306617
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index d3d8cef..fe98443 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -2456,10 +2456,9 @@
}
}
- // 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);
}