From: Reid Spencer Date: Wed, 6 Dec 2006 20:39:57 +0000 (+0000) Subject: Update ConstantIntegral Max/Min tests for new interface. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=62700f250fc23d02a1c9350586ae803a430f0878;p=oota-llvm.git Update ConstantIntegral Max/Min tests for new interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32288 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index de11c52d496..5073bde0bae 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2889,7 +2889,7 @@ Instruction *InstCombiner::InsertRangeTest(Value *V, Constant *Lo, Constant *Hi, if (Inside) { if (Lo == Hi) // Trivially false. return new SetCondInst(Instruction::SetNE, V, V); - if (cast(Lo)->isMinValue()) + if (cast(Lo)->isMinValue(Lo->getType()->isSigned())) return new SetCondInst(Instruction::SetLT, V, Hi); Constant *AddCST = ConstantExpr::getNeg(Lo); @@ -2909,7 +2909,7 @@ Instruction *InstCombiner::InsertRangeTest(Value *V, Constant *Lo, Constant *Hi, Hi = SubOne(cast(Hi)); // V < 0 || V >= Hi ->'V > Hi-1' - if (cast(Lo)->isMinValue()) + if (cast(Lo)->isMinValue(Lo->getType()->isSigned())) return new SetCondInst(Instruction::SetGT, V, Hi); // Emit X-Lo > Hi-Lo-1 @@ -4165,7 +4165,7 @@ Instruction *InstCombiner::visitSetCondInst(SetCondInst &I) { // can be folded into the comparison. if (ConstantInt *CI = dyn_cast(Op1)) { // Check to see if we are comparing against the minimum or maximum value... - if (CI->isMinValue()) { + if (CI->isMinValue(CI->getType()->isSigned())) { if (I.getOpcode() == Instruction::SetLT) // A < MIN -> FALSE return ReplaceInstUsesWith(I, ConstantBool::getFalse()); if (I.getOpcode() == Instruction::SetGE) // A >= MIN -> TRUE @@ -4175,7 +4175,7 @@ Instruction *InstCombiner::visitSetCondInst(SetCondInst &I) { if (I.getOpcode() == Instruction::SetGT) // A > MIN -> A != MIN return BinaryOperator::createSetNE(Op0, Op1); - } else if (CI->isMaxValue()) { + } else if (CI->isMaxValue(CI->getType()->isSigned())) { if (I.getOpcode() == Instruction::SetGT) // A > MAX -> FALSE return ReplaceInstUsesWith(I, ConstantBool::getFalse()); if (I.getOpcode() == Instruction::SetLE) // A <= MAX -> TRUE