summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-19 23:24:04 +0000
committerChris Lattner <sabre@nondot.org>2010-12-19 23:24:04 +0000
commit4fb9dd4c74f1131724b66169ddbe08fc8e03a94d (patch)
treeb4193513ff074a5ed54a6356ea6cdc5af34ce173
parent8e303e896eb8e1bd30611a81028ce6195f1646c7 (diff)
downloadbcm5719-llvm-4fb9dd4c74f1131724b66169ddbe08fc8e03a94d.tar.gz
bcm5719-llvm-4fb9dd4c74f1131724b66169ddbe08fc8e03a94d.zip
fix an oversight caught by Frits!
llvm-svn: 122204
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 5fa930e7541..c679ef4efa3 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1151,9 +1151,10 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
// If the normal result of the add is dead, and the RHS is a constant,
// we can transform this into a range comparison.
// overflow = uadd a, -4 --> overflow = icmp ugt a, 3
- if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getArgOperand(1)))
- return new ICmpInst(ICmpInst::ICMP_UGT, II->getArgOperand(0),
- ConstantExpr::getNot(CI));
+ if (II->getIntrinsicID() == Intrinsic::uadd_with_overflow)
+ if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getArgOperand(1)))
+ return new ICmpInst(ICmpInst::ICMP_UGT, II->getArgOperand(0),
+ ConstantExpr::getNot(CI));
break;
case Intrinsic::usub_with_overflow:
case Intrinsic::ssub_with_overflow:
OpenPOWER on IntegriCloud