aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-12-02 06:24:20 +0000
committerBill Wendling <isanbard@gmail.com>2008-12-02 06:24:20 +0000
commit286a054908fc88858269b0520c516a44adac382e (patch)
tree28cd71b87119b368763b67480598117b92501e6f
parentd16c6e999366ccd3ec7dc982a72df203d3aab406 (diff)
downloadexternal_llvm-286a054908fc88858269b0520c516a44adac382e.zip
external_llvm-286a054908fc88858269b0520c516a44adac382e.tar.gz
external_llvm-286a054908fc88858269b0520c516a44adac382e.tar.bz2
Remove some errors that crept in. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60403 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index b382731..4914c11 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4437,13 +4437,14 @@ Instruction *InstCombiner::FoldOrWithConstants(BinaryOperator &I, Value *Op,
ConstantInt *CI1 = dyn_cast<ConstantInt>(C);
if (!CI1) return 0;
- Value *V1 = 0, *C2 = 0;
- if (!match(Op, m_And(m_Value(V1), m_ConstantInt(C2)))) return 0;
+ Value *V1 = 0;
+ ConstantInt *CI2 = 0;
+ if (!match(Op, m_And(m_Value(V1), m_ConstantInt(CI2)))) return 0;
APInt Xor = CI1->getValue() ^ CI2->getValue();
if (!Xor.isAllOnesValue()) return 0;
- if (V1 == A || V1 == B)
+ if (V1 == A || V1 == B) {
Instruction *NewOp =
InsertNewInstBefore(BinaryOperator::CreateAnd((V1 == A) ? B : A, CI1), I);
return BinaryOperator::CreateOr(NewOp, V1);