aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r--lib/Transforms/Scalar/PredicateSimplifier.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/PredicateSimplifier.cpp b/lib/Transforms/Scalar/PredicateSimplifier.cpp
index 7eef9ac691..289f9c9655 100644
--- a/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/lib/Transforms/Scalar/PredicateSimplifier.cpp
@@ -748,14 +748,13 @@ namespace {
return ConstantRange(APInt::getSignedMinValue(W), CR.getSignedMax());
case ICmpInst::ICMP_ULE: {
APInt UMax(CR.getUnsignedMax());
- if (UMax == APInt::getMaxValue(W))
+ if (UMax.isMaxValue())
return ConstantRange(W);
return ConstantRange(APInt::getMinValue(W), UMax + 1);
}
case ICmpInst::ICMP_SLE: {
APInt SMax(CR.getSignedMax());
- if (SMax == APInt::getSignedMaxValue(W) ||
- SMax + 1 == APInt::getSignedMaxValue(W))
+ if (SMax.isMaxSignedValue() || (SMax+1).isMaxSignedValue())
return ConstantRange(W);
return ConstantRange(APInt::getSignedMinValue(W), SMax + 1);
}
@@ -766,13 +765,13 @@ namespace {
APInt::getSignedMinValue(W));
case ICmpInst::ICMP_UGE: {
APInt UMin(CR.getUnsignedMin());
- if (UMin == APInt::getMinValue(W))
+ if (UMin.isMinValue())
return ConstantRange(W);
return ConstantRange(UMin, APInt::getNullValue(W));
}
case ICmpInst::ICMP_SGE: {
APInt SMin(CR.getSignedMin());
- if (SMin == APInt::getSignedMinValue(W))
+ if (SMin.isMinSignedValue())
return ConstantRange(W);
return ConstantRange(SMin, APInt::getSignedMinValue(W));
}