aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-03 20:23:47 +0000
committerDan Gohman <gohman@apple.com>2010-05-03 20:23:47 +0000
commitf16c6803d72401aef50dfffded89edce28e184d3 (patch)
treee59b3a80936d2b1aa5f68b1998f25d609a269fba /lib/Analysis/ScalarEvolution.cpp
parent0b12348ddf54ef2ca96bf807742e1c6622c692d4 (diff)
Silence warnings about -1 being converted to an unsigned value.
Also, pass true for isSigned even when creating constants for unsigned comparisons, because the point is to create an all-ones constant, rather than UINT64_MAX, even for integers wider than 64 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 30303cbbd1..0d44a3f593 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -4952,7 +4952,7 @@ bool ScalarEvolution::SimplifyICmpOperands(ICmpInst::Predicate &Pred,
Pred = ICmpInst::ICMP_SLT;
Changed = true;
} else if (!getSignedRange(LHS).getSignedMin().isMinSignedValue()) {
- LHS = getAddExpr(getConstant(RHS->getType(), -1, true), LHS,
+ LHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), LHS,
/*HasNUW=*/false, /*HasNSW=*/true);
Pred = ICmpInst::ICMP_SLT;
Changed = true;
@@ -4960,7 +4960,7 @@ bool ScalarEvolution::SimplifyICmpOperands(ICmpInst::Predicate &Pred,
break;
case ICmpInst::ICMP_SGE:
if (!getSignedRange(RHS).getSignedMin().isMinSignedValue()) {
- RHS = getAddExpr(getConstant(RHS->getType(), -1, true), RHS,
+ RHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), RHS,
/*HasNUW=*/false, /*HasNSW=*/true);
Pred = ICmpInst::ICMP_SGT;
Changed = true;
@@ -4973,12 +4973,12 @@ bool ScalarEvolution::SimplifyICmpOperands(ICmpInst::Predicate &Pred,
break;
case ICmpInst::ICMP_ULE:
if (!getUnsignedRange(RHS).getUnsignedMax().isMaxValue()) {
- RHS = getAddExpr(getConstant(RHS->getType(), 1, false), RHS,
+ RHS = getAddExpr(getConstant(RHS->getType(), 1, true), RHS,
/*HasNUW=*/true, /*HasNSW=*/false);
Pred = ICmpInst::ICMP_ULT;
Changed = true;
} else if (!getUnsignedRange(LHS).getUnsignedMin().isMinValue()) {
- LHS = getAddExpr(getConstant(RHS->getType(), -1, false), LHS,
+ LHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), LHS,
/*HasNUW=*/true, /*HasNSW=*/false);
Pred = ICmpInst::ICMP_ULT;
Changed = true;
@@ -4986,12 +4986,12 @@ bool ScalarEvolution::SimplifyICmpOperands(ICmpInst::Predicate &Pred,
break;
case ICmpInst::ICMP_UGE:
if (!getUnsignedRange(RHS).getUnsignedMin().isMinValue()) {
- RHS = getAddExpr(getConstant(RHS->getType(), -1, false), RHS,
+ RHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), RHS,
/*HasNUW=*/true, /*HasNSW=*/false);
Pred = ICmpInst::ICMP_UGT;
Changed = true;
} else if (!getUnsignedRange(LHS).getUnsignedMax().isMaxValue()) {
- LHS = getAddExpr(getConstant(RHS->getType(), 1, false), LHS,
+ LHS = getAddExpr(getConstant(RHS->getType(), 1, true), LHS,
/*HasNUW=*/true, /*HasNSW=*/false);
Pred = ICmpInst::ICMP_UGT;
Changed = true;