aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-02-13 22:09:18 +0000
committerDan Gohman <gohman@apple.com>2008-02-13 22:09:18 +0000
commit7649127ec152e226d761845983ba91e69712d7da (patch)
tree63af0b79feb95009a665f8c69053d2e528748eb7 /lib/Transforms/Scalar
parent23067dfeac422d3991690997a9c6a92e11945c48 (diff)
downloadexternal_llvm-7649127ec152e226d761845983ba91e69712d7da.zip
external_llvm-7649127ec152e226d761845983ba91e69712d7da.tar.gz
external_llvm-7649127ec152e226d761845983ba91e69712d7da.tar.bz2
Rename APInt's isPositive to isNonNegative, to reflect what it
actually does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 37c9462..c9ff01b 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5293,12 +5293,12 @@ Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
HiOverflow = LoOverflow = ProdOV;
if (!HiOverflow)
HiOverflow = AddWithOverflow(HiBound, LoBound, DivRHS, false);
- } else if (DivRHS->getValue().isPositive()) { // Divisor is > 0.
+ } else if (DivRHS->getValue().isStrictlyPositive()) { // Divisor is > 0.
if (CmpRHSV == 0) { // (X / pos) op 0
// Can't overflow. e.g. X/2 op 0 --> [-1, 2)
LoBound = cast<ConstantInt>(ConstantExpr::getNeg(SubOne(DivRHS)));
HiBound = DivRHS;
- } else if (CmpRHSV.isPositive()) { // (X / pos) op pos
+ } else if (CmpRHSV.isStrictlyPositive()) { // (X / pos) op pos
LoBound = Prod; // e.g. X/5 op 3 --> [15, 20)
HiOverflow = LoOverflow = ProdOV;
if (!HiOverflow)
@@ -5311,7 +5311,7 @@ Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
HiBound = AddOne(Prod);
HiOverflow = ProdOV ? -1 : 0;
}
- } else { // Divisor is < 0.
+ } else if (DivRHS->getValue().isNegative()) { // Divisor is < 0.
if (CmpRHSV == 0) { // (X / neg) op 0
// e.g. X/-5 op 0 --> [-4, 5)
LoBound = AddOne(DivRHS);
@@ -5320,7 +5320,7 @@ Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
HiOverflow = 1; // [INTMIN+1, overflow)
HiBound = 0; // e.g. X/INTMIN = 0 --> X > INTMIN
}
- } else if (CmpRHSV.isPositive()) { // (X / neg) op pos
+ } else if (CmpRHSV.isStrictlyPositive()) { // (X / neg) op pos
// e.g. X/-5 op 3 --> [-19, -14)
HiOverflow = LoOverflow = ProdOV ? -1 : 0;
if (!LoOverflow)
@@ -5434,8 +5434,8 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
// Extending a relational comparison when we're checking the sign
// bit would not work.
if (Cast->hasOneUse() &&
- (ICI.isEquality() || AndCST->getValue().isPositive() &&
- RHSV.isPositive())) {
+ (ICI.isEquality() || AndCST->getValue().isNonNegative() &&
+ RHSV.isNonNegative())) {
uint32_t BitWidth =
cast<IntegerType>(Cast->getOperand(0)->getType())->getBitWidth();
APInt NewCST = AndCST->getValue();