mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-20 09:24:58 +00:00
Minor change, no functionality diff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c232870b6f
commit
28ba1aad99
@ -510,11 +510,11 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
|
|||||||
if (Op0I->getOpcode() == Instruction::Or && Op0I->use_size() == 1) {
|
if (Op0I->getOpcode() == Instruction::Or && Op0I->use_size() == 1) {
|
||||||
if (Op0I->getOperand(0) == Op1) // (B|A)^B == (A|B)^B
|
if (Op0I->getOperand(0) == Op1) // (B|A)^B == (A|B)^B
|
||||||
cast<BinaryOperator>(Op0I)->swapOperands();
|
cast<BinaryOperator>(Op0I)->swapOperands();
|
||||||
if (Op0I->getOperand(1) == Op1) { // (A|B)^B == A & ~B
|
if (Op0I->getOperand(1) == Op1) { // (A|B)^B == ~B & A
|
||||||
Value *NotB = BinaryOperator::createNot(Op1, Op1->getName()+".not", &I);
|
Value *NotB = BinaryOperator::createNot(Op1, Op1->getName()+".not", &I);
|
||||||
WorkList.push_back(cast<Instruction>(NotB));
|
WorkList.push_back(cast<Instruction>(NotB));
|
||||||
return BinaryOperator::create(Instruction::And, Op0I->getOperand(0),
|
return BinaryOperator::create(Instruction::And, NotB,
|
||||||
NotB);
|
Op0I->getOperand(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user