[llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp

Zhou Sheng zhousheng00 at gmail.com
Thu Apr 26 09:42:25 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

PredicateSimplifier.cpp updated: 1.70 -> 1.71
---
Log message:

Using APInt more efficiently.


---
Diffs of the changes:  (+4 -5)

 PredicateSimplifier.cpp |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.70 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.71
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.70	Tue Apr 24 23:18:54 2007
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp	Thu Apr 26 11:42:07 2007
@@ -748,14 +748,13 @@
           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 @@
                                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));
         }






More information about the llvm-commits mailing list