aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-01-02 16:14:56 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-01-02 16:14:56 +0000
commitf994bf00b5d1b0b74e70cfcf65414b8aa401d3ea (patch)
tree00ab94ad946d4c0182a02d9e1c1cd9bcad70be3d /lib/Transforms/Scalar/InstructionCombining.cpp
parent546d63176eecb2786f9fcd587ccb2c1ef604278b (diff)
Fix logic error in previous commit. The != case needs to become an or, not an
and. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index e208d69f7c..50e9f24cc1 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7324,9 +7324,13 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
Constant::getNullValue(P->getType()));
Value *ICIQ = Builder->CreateICmp(ICI.getPredicate(), Q,
Constant::getNullValue(Q->getType()));
- Instruction *And = BinaryOperator::CreateAnd(ICIP, ICIQ, "");
- And->takeName(&ICI);
- return And;
+ Instruction *Op;
+ if (ICI.getPredicate() == ICmpInst::ICMP_EQ)
+ Op = BinaryOperator::CreateAnd(ICIP, ICIQ, "");
+ else
+ Op = BinaryOperator::CreateOr(ICIP, ICIQ, "");
+ Op->takeName(&ICI);
+ return Op;
}
break;
}