[llvm-commits] [llvm] r60402 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Bill Wendling
isanbard at gmail.com
Mon Dec 1 22:22:05 PST 2008
Author: void
Date: Tue Dec 2 00:22:04 2008
New Revision: 60402
URL: http://llvm.org/viewvc/llvm-project?rev=60402&view=rev
Log:
Merge two if-statements into one.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=60402&r1=60401&r2=60402&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Dec 2 00:22:04 2008
@@ -4443,14 +4443,10 @@
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;
More information about the llvm-commits
mailing list