aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit5adecbcb6264aa9292dec7a5f1bfd29e188c0fca (patch)
tree00ab94ad946d4c0182a02d9e1c1cd9bcad70be3d /lib
parent72c812c1b97c2d61745796925cb4462ecf54ff15 (diff)
downloadexternal_llvm-5adecbcb6264aa9292dec7a5f1bfd29e188c0fca.zip
external_llvm-5adecbcb6264aa9292dec7a5f1bfd29e188c0fca.tar.gz
external_llvm-5adecbcb6264aa9292dec7a5f1bfd29e188c0fca.tar.bz2
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')
-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 e208d69..50e9f24 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;
}