[llvm-commits] [llvm] r100993 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dan Gohman gohman at apple.com
Sun Apr 11 15:12:18 PDT 2010


Author: djg
Date: Sun Apr 11 17:12:18 2010
New Revision: 100993

URL: http://llvm.org/viewvc/llvm-project?rev=100993&view=rev
Log:
When creating a ConstantRange for [n,UINT_MAX], special case n == 0, because
ConstantRange(0, 0) creates an empty range rather than a full one.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=100993&r1=100992&r2=100993&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Apr 11 17:12:18 2010
@@ -2920,9 +2920,10 @@
     // initial value.
     if (AddRec->hasNoUnsignedWrap())
       if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart()))
-        ConservativeResult =
-          ConstantRange(C->getValue()->getValue(),
-                        APInt(getTypeSizeInBits(C->getType()), 0));
+        if (!C->isZero())
+          ConservativeResult =
+            ConstantRange(C->getValue()->getValue(),
+                          APInt(getTypeSizeInBits(C->getType()), 0));
 
     // TODO: non-affine addrec
     if (AddRec->isAffine()) {





More information about the llvm-commits mailing list