From: Chris Lattner Date: Sun, 19 Dec 2010 23:24:04 +0000 (+0000) Subject: fix an oversight caught by Frits! X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f2a97ed13d8aa23fab6d141b3c633e6ae513233e;p=oota-llvm.git fix an oversight caught by Frits! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 5fa930e7541..c679ef4efa3 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/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(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(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: