summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-04-26 16:42:07 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-04-26 16:42:07 +0000
commit3178736d5052015a620c822cfd34a0a88d0200ac (patch)
tree5993d3f437a9454fb125e0b4f31dc7578231367e /llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
parent476db10261f37e255d2aea40ed1473b7885796e8 (diff)
downloadbcm5719-llvm-3178736d5052015a620c822cfd34a0a88d0200ac.tar.gz
bcm5719-llvm-3178736d5052015a620c822cfd34a0a88d0200ac.zip
Using APInt more efficiently.
llvm-svn: 36475
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
index 7eef9ac6911..289f9c96557 100644
--- a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud