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

Nick Lewycky nicholas at mxc.ca
Thu Feb 21 01:14:53 PST 2008


Author: nicholas
Date: Thu Feb 21 03:14:53 2008
New Revision: 47434

URL: http://llvm.org/viewvc/llvm-project?rev=47434&view=rev
Log:
Simplify this code, no functionality change.

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=47434&r1=47433&r2=47434&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Feb 21 03:14:53 2008
@@ -2600,11 +2600,8 @@
   // If the value is a constant, check to see if it is known to be non-zero
   // already.  If so, the backedge will execute zero times.
   if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
-    Constant *Zero = Constant::getNullValue(C->getValue()->getType());
-    Constant *NonZero = 
-      ConstantExpr::getICmp(ICmpInst::ICMP_NE, C->getValue(), Zero);
-    if (NonZero == ConstantInt::getTrue())
-      return getSCEV(Zero);
+    if (!C->getValue()->isNullValue())
+      return SE.getIntegerSCEV(0, C->getType());
     return UnknownValue;  // Otherwise it will loop infinitely.
   }
 





More information about the llvm-commits mailing list