[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h DataStructure.h

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 19 14:13:16 PST 2005



Changes in directory llvm/include/llvm/Analysis/DataStructure:

EquivClassGraphs.h updated: 1.18 -> 1.19
DataStructure.h updated: 1.85 -> 1.86
---
Log message:

Each DS collection now contains an equivalence class of globals values.


---
Diffs of the changes:  (+27 -2)

 DataStructure.h    |   21 +++++++++++++++++++++
 EquivClassGraphs.h |    8 ++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
diff -u llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h:1.18 llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h:1.19
--- llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h:1.18	Tue Mar 15 00:21:40 2005
+++ llvm/include/llvm/Analysis/DataStructure/EquivClassGraphs.h	Sat Mar 19 16:12:33 2005
@@ -16,9 +16,7 @@
 
 #include "llvm/Analysis/DataStructure/DataStructure.h"
 #include "llvm/Analysis/DataStructure/DSGraph.h"
-#include "llvm/ADT/EquivalenceClasses.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/hash_map"
 #include <vector>
 #include <map>
 
@@ -52,6 +50,10 @@
     /// a call site.
     std::map<DSNode*, Function *> OneCalledFunction;
 
+    /// GlobalECs - The equivalence classes for each global value that is merged
+    /// with other global values in the DSGraphs.
+    EquivalenceClasses<GlobalValue*> GlobalECs;
+
   public:
     /// EquivClassGraphs - Computes the equivalence classes and then the
     /// folded DS graphs for each class.
@@ -62,6 +64,8 @@
     ///
     void print(std::ostream &O, const Module *M) const;
 
+    EquivalenceClasses<GlobalValue*> &getGlobalECs() { return GlobalECs; }
+
     /// getDSGraph - Return the data structure graph for the specified function.
     /// This returns the folded graph.  The folded graph is the same as the CBU
     /// graph iff the function is in a singleton equivalence class AND all its 


Index: llvm/include/llvm/Analysis/DataStructure/DataStructure.h
diff -u llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.85 llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.86
--- llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.85	Mon Feb  7 10:09:01 2005
+++ llvm/include/llvm/Analysis/DataStructure/DataStructure.h	Sat Mar 19 16:12:33 2005
@@ -18,11 +18,13 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/ADT/hash_map"
 #include "llvm/ADT/hash_set"
+#include "llvm/ADT/EquivalenceClasses.h"
 
 namespace llvm {
 
 class Type;
 class Instruction;
+class GlobalValue;
 class DSGraph;
 class DSNode;
 class DSNodeHandle;
@@ -46,6 +48,10 @@
   // DSInfo, one graph for each function
   hash_map<Function*, DSGraph*> DSInfo;
   DSGraph *GlobalsGraph;
+
+  /// GlobalECs - The equivalence classes for each global value that is merged
+  /// with other global values in the DSGraphs.
+  EquivalenceClasses<GlobalValue*> GlobalECs;
 public:
   ~LocalDataStructures() { releaseMemory(); }
 
@@ -66,6 +72,8 @@
 
   DSGraph &getGlobalsGraph() const { return *GlobalsGraph; }
 
+  EquivalenceClasses<GlobalValue*> &getGlobalECs() { return GlobalECs; }
+
   /// print - Print out the analysis results...
   ///
   void print(std::ostream &O, const Module *M) const;
@@ -98,6 +106,10 @@
   // This map is only maintained during construction of BU Graphs
   std::map<std::vector<Function*>,
            std::pair<DSGraph*, std::vector<DSNodeHandle> > > *IndCallGraphMap;
+
+  /// GlobalECs - The equivalence classes for each global value that is merged
+  /// with other global values in the DSGraphs.
+  EquivalenceClasses<GlobalValue*> GlobalECs;
 public:
   ~BUDataStructures() { releaseMemory(); }
 
@@ -118,6 +130,9 @@
 
   DSGraph &getGlobalsGraph() const { return *GlobalsGraph; }
 
+  EquivalenceClasses<GlobalValue*> &getGlobalECs() { return GlobalECs; }
+
+
   /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program.
   /// These correspond to the interfaces defined in the AliasAnalysis class.
   void deleteValue(Value *V);
@@ -162,6 +177,10 @@
   hash_map<Function*, DSGraph*> DSInfo;
   hash_set<Function*> ArgsRemainIncomplete;
   DSGraph *GlobalsGraph;
+
+  /// GlobalECs - The equivalence classes for each global value that is merged
+  /// with other global values in the DSGraphs.
+  EquivalenceClasses<GlobalValue*> GlobalECs;
 public:
   ~TDDataStructures() { releaseMyMemory(); }
 
@@ -181,6 +200,8 @@
   }
 
   DSGraph &getGlobalsGraph() const { return *GlobalsGraph; }
+  EquivalenceClasses<GlobalValue*> &getGlobalECs() { return GlobalECs; }
+
 
   /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program.
   /// These correspond to the interfaces defined in the AliasAnalysis class.






More information about the llvm-commits mailing list