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

Dan Gohman gohman at apple.com
Tue Jun 29 23:58:35 PDT 2010


Author: djg
Date: Wed Jun 30 01:58:35 2010
New Revision: 107256

URL: http://llvm.org/viewvc/llvm-project?rev=107256&view=rev
Log:
When computing a new ConservativeResult, intersect it with
the old one instead of replacing it, to be more precise.

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=107256&r1=107255&r2=107256&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jun 30 01:58:35 2010
@@ -2958,7 +2958,8 @@
       if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart()))
         if (!C->getValue()->isZero())
           ConservativeResult =
-            ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0));
+            ConservativeResult.intersectWith(
+              ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0)));
 
     // TODO: non-affine addrec
     if (AddRec->isAffine()) {





More information about the llvm-commits mailing list