mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-25 15:41:05 +00:00
[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:
parent
bde81f144d
commit
01c9f8cd03
@ -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;
|
ICmpInst::Predicate Pred;
|
||||||
if (match(Op0, m_OneUse(m_Cmp(Pred, m_Value(), m_Value()))) &&
|
if (match(&I, m_Not(m_OneUse(m_Cmp(Pred, m_Value(), m_Value()))))) {
|
||||||
match(Op1, m_AllOnes())) {
|
|
||||||
cast<CmpInst>(Op0)->setPredicate(CmpInst::getInversePredicate(Pred));
|
cast<CmpInst>(Op0)->setPredicate(CmpInst::getInversePredicate(Pred));
|
||||||
return replaceInstUsesWith(I, Op0);
|
return replaceInstUsesWith(I, Op0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user