Make the SCEV* form of getSCEVAtScope public, to allow ScalarEvolution
authorDan Gohman <gohman@apple.com>
Fri, 8 May 2009 20:38:54 +0000 (20:38 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 8 May 2009 20:38:54 +0000 (20:38 +0000)
clients to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71258 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp

index 96490229f487390d09fa62544e7e0832c6576188..d6fb8f011b88427ae53605135bbba6f87f8b97ab 100644 (file)
@@ -345,11 +345,6 @@ namespace llvm {
     Constant *getConstantEvolutionLoopExitValue(PHINode *PN, const APInt& BEs,
                                                 const Loop *L);
 
-    /// getSCEVAtScope - Compute the value of the specified expression within
-    /// the indicated loop (which may be null to indicate in no loop).  If the
-    /// expression cannot be evaluated, return UnknownValue itself.
-    SCEVHandle getSCEVAtScope(const SCEV *S, const Loop *L);
-
     /// forgetLoopPHIs - Delete the memoized SCEVs associated with the
     /// PHI nodes in the given loop. This is used when the trip count of
     /// the loop may have changed.
@@ -468,6 +463,10 @@ namespace llvm {
     ///
     /// If this value is not computable at this scope, a SCEVCouldNotCompute
     /// object is returned.
+    SCEVHandle getSCEVAtScope(const SCEV *S, const Loop *L);
+
+    /// getSCEVAtScope - This is a convenience function which does
+    /// getSCEVAtScope(getSCEV(V), L).
     SCEVHandle getSCEVAtScope(Value *V, const Loop *L);
 
     /// isLoopGuardedByCond - Test whether entry to the loop is protected by
index c43aad39875ec2a97e818db7b5322c849b33e2a7..8b48b78da41795078830bb1b01facc783b9a3101 100644 (file)
@@ -2721,9 +2721,16 @@ ComputeBackedgeTakenCountExhaustively(const Loop *L, Value *Cond, bool ExitWhen)
   return UnknownValue;
 }
 
-/// getSCEVAtScope - Compute the value of the specified expression within the
-/// indicated loop (which may be null to indicate in no loop).  If the
-/// expression cannot be evaluated, return UnknownValue.
+/// getSCEVAtScope - Return a SCEV expression handle for the specified value
+/// at the specified scope in the program.  The L value specifies a loop
+/// nest to evaluate the expression at, where null is the top-level or a
+/// specified loop is immediately inside of the loop.
+///
+/// This method can be used to compute the exit value for a variable defined
+/// in a loop by querying what the value will hold in the parent loop.
+///
+/// If this value is not computable at this scope, a SCEVCouldNotCompute
+/// object is returned.
 SCEVHandle ScalarEvolution::getSCEVAtScope(const SCEV *V, const Loop *L) {
   // FIXME: this should be turned into a virtual method on SCEV!
 
@@ -2897,16 +2904,8 @@ SCEVHandle ScalarEvolution::getSCEVAtScope(const SCEV *V, const Loop *L) {
   assert(0 && "Unknown SCEV type!");
 }
 
-/// getSCEVAtScope - Return a SCEV expression handle for the specified value
-/// at the specified scope in the program.  The L value specifies a loop
-/// nest to evaluate the expression at, where null is the top-level or a
-/// specified loop is immediately inside of the loop.
-///
-/// This method can be used to compute the exit value for a variable defined
-/// in a loop by querying what the value will hold in the parent loop.
-///
-/// If this value is not computable at this scope, a SCEVCouldNotCompute
-/// object is returned.
+/// getSCEVAtScope - This is a convenience function which does
+/// getSCEVAtScope(getSCEV(V), L).
 SCEVHandle ScalarEvolution::getSCEVAtScope(Value *V, const Loop *L) {
   return getSCEVAtScope(getSCEV(V), L);
 }