[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 9 16:36:44 PDT 2005



Changes in directory llvm/lib/Analysis:

ScalarEvolution.cpp updated: 1.38 -> 1.39
---
Log message:

implement two helper methods


---
Diffs of the changes:  (+28 -0)

 ScalarEvolution.cpp |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+)


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.38 llvm/lib/Analysis/ScalarEvolution.cpp:1.39
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.38	Thu Apr 21 16:04:58 2005
+++ llvm/lib/Analysis/ScalarEvolution.cpp	Tue Aug  9 18:36:33 2005
@@ -1095,6 +1095,20 @@
     /// 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 @@
   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);
 }






More information about the llvm-commits mailing list