summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-09 23:36:33 +0000
committerChris Lattner <sabre@nondot.org>2005-08-09 23:36:33 +0000
commitb310ac4a86b8f9957b368eeb41b324644d29c145 (patch)
tree147e83a50c408ad157a213ec91c81342ad1677e4 /llvm/lib/Analysis/ScalarEvolution.cpp
parent67017db5c698feb06477845425999114e2fe29a7 (diff)
downloadbcm5719-llvm-b310ac4a86b8f9957b368eeb41b324644d29c145.tar.gz
bcm5719-llvm-b310ac4a86b8f9957b368eeb41b324644d29c145.zip
implement two helper methods
llvm-svn: 22736
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 9c1beee0425..1f798bc8b09 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1095,6 +1095,20 @@ namespace {
/// expression and create a new one.
SCEVHandle getSCEV(Value *V);
+ /// hasSCEV - Return true if the SCEV for this value has already been
+ /// computed.
+ bool hasSCEV(Value *V) const {
+ return Scalars.count(V);
+ }
+
+ /// setSCEV - Insert the specified SCEV into the map of current SCEVs for
+ /// the specified value.
+ void setSCEV(Value *V, const SCEVHandle &H) {
+ bool isNew = Scalars.insert(std::make_pair(V, H)).second;
+ assert(isNew && "This entry already existed!");
+ }
+
+
/// 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.
@@ -2327,6 +2341,20 @@ SCEVHandle ScalarEvolution::getSCEV(Value *V) const {
return ((ScalarEvolutionsImpl*)Impl)->getSCEV(V);
}
+/// hasSCEV - Return true if the SCEV for this value has already been
+/// computed.
+bool ScalarEvolution::hasSCEV(Value *V) const {
+ ((ScalarEvolutionsImpl*)Impl)->hasSCEV(V);
+}
+
+
+/// setSCEV - Insert the specified SCEV into the map of current SCEVs for
+/// the specified value.
+void ScalarEvolution::setSCEV(Value *V, const SCEVHandle &H) {
+ ((ScalarEvolutionsImpl*)Impl)->setSCEV(V, H);
+}
+
+
SCEVHandle ScalarEvolution::getIterationCount(const Loop *L) const {
return ((ScalarEvolutionsImpl*)Impl)->getIterationCount(L);
}
OpenPOWER on IntegriCloud