mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
Merge two if-statements into one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29976b9e12
commit
d16c6e9993
@ -4443,14 +4443,10 @@ Instruction *InstCombiner::FoldOrWithConstants(BinaryOperator &I, Value *Op,
|
||||
APInt Xor = CI1->getValue() ^ CI2->getValue();
|
||||
if (!Xor.isAllOnesValue()) return 0;
|
||||
|
||||
if (V1 == B) {
|
||||
if (V1 == A || V1 == B)
|
||||
Instruction *NewOp =
|
||||
InsertNewInstBefore(BinaryOperator::CreateAnd(A, CI1), I);
|
||||
return BinaryOperator::CreateOr(NewOp, B);
|
||||
} else if (V1 == A) {
|
||||
Instruction *NewOp =
|
||||
InsertNewInstBefore(BinaryOperator::CreateAnd(B, CI1), I);
|
||||
return BinaryOperator::CreateOr(NewOp, A);
|
||||
InsertNewInstBefore(BinaryOperator::CreateAnd((V1 == A) ? B : A, CI1), I);
|
||||
return BinaryOperator::CreateOr(NewOp, V1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user