1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

- instcombine (~(a < b)) into (a >= b)

llvm-svn: 3406
This commit is contained in:
Chris Lattner 2002-08-20 18:24:26 +00:00
parent 0d58102c1c
commit ad92b604b5

View File

@ -328,10 +328,18 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
if (Op1C->isNullValue())
return ReplaceInstUsesWith(I, Op0);
// xor (xor X, -1), -1 = not (not X) = X
if (Op1C->isAllOnesValue())
// Is this a "NOT" instruction?
if (Op1C->isAllOnesValue()) {
// xor (xor X, -1), -1 = not (not X) = X
if (Value *X = dyn_castNotInst(Op0))
return ReplaceInstUsesWith(I, X);
// xor (setcc A, B), true = not (setcc A, B) = setncc A, B
if (SetCondInst *SCI = dyn_cast<SetCondInst>(Op0))
if (SCI->use_size() == 1)
return new SetCondInst(SCI->getInverseCondition(),
SCI->getOperand(0), SCI->getOperand(1));
}
}
return Changed ? &I : 0;