[llvm-commits] [llvm] r71258 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Fri May 8 13:38:54 PDT 2009
Author: djg
Date: Fri May 8 15:38:54 2009
New Revision: 71258
URL: http://llvm.org/viewvc/llvm-project?rev=71258&view=rev
Log:
Make the SCEV* form of getSCEVAtScope public, to allow ScalarEvolution
clients to use it.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=71258&r1=71257&r2=71258&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Fri May 8 15:38:54 2009
@@ -345,11 +345,6 @@
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 @@
///
/// 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
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=71258&r1=71257&r2=71258&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri May 8 15:38:54 2009
@@ -2721,9 +2721,16 @@
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 @@
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);
}
More information about the llvm-commits
mailing list