aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-31 21:56:11 +0000
committerChris Lattner <sabre@nondot.org>2004-10-31 21:56:11 +0000
commitab8544aa757c1ca930125a64b0e36bf50dbf8aa9 (patch)
tree079994be4b70c89cd3f33e500928110be6562b16 /include/llvm
parent3b7b81b814fe4cdac0930aca67359b963d2f8fe8 (diff)
downloadexternal_llvm-ab8544aa757c1ca930125a64b0e36bf50dbf8aa9.zip
external_llvm-ab8544aa757c1ca930125a64b0e36bf50dbf8aa9.tar.gz
external_llvm-ab8544aa757c1ca930125a64b0e36bf50dbf8aa9.tar.bz2
Do not do horrible things to the CBU graphs. In particular, we do NOT own
the CBU graphs, copy them instead of hacking on the CBU graphs. Also, instead of forwarding request from ECGraphs clients to the CBU graphs clients, service them ourselves. Finally, remove a broken "optimization" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/DataStructure/EquivClassGraphs.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
index 81b9ac8..ea41ac3 100644
--- a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
+++ b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
@@ -1,4 +1,4 @@
-//===-- EquivClassGraphs.h - Merge equiv-class graphs & inline bottom-up --===//
+//===-- EquivClassGraphs.h - Merge equiv-class graphs -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,14 +7,13 @@
//
//===----------------------------------------------------------------------===//
//
-// This pass is the same as the complete bottom-up graphs, but
-// with functions partitioned into equivalence classes and a single merged
-// DS graph for all functions in an equivalence class. After this merging,
-// graphs are inlined bottom-up on the SCCs of the final (CBU) call graph.
+// This pass is the same as the complete bottom-up graphs, but with functions
+// partitioned into equivalence classes and a single merged DS graph for all
+// functions in an equivalence class. After this merging, graphs are inlined
+// bottom-up on the SCCs of the final (CBU) call graph.
//
//===----------------------------------------------------------------------===//
-
#include "llvm/Analysis/DataStructure/DataStructure.h"
#include "llvm/Analysis/DataStructure/DSGraph.h"
#include "llvm/ADT/EquivalenceClasses.h"
@@ -49,6 +48,8 @@ namespace PA {
struct EquivClassGraphs : public ModulePass {
CompleteBUDataStructures *CBU;
+ DSGraph *GlobalsGraph;
+
// FoldedGraphsMap, one graph for each function
hash_map<const Function*, DSGraph*> FoldedGraphsMap;
@@ -69,7 +70,7 @@ namespace PA {
/// EquivClassGraphs - Computes the equivalence classes and then the
/// folded DS graphs for each class.
///
- virtual bool runOnModule(Module &M) { computeFoldedGraphs(M); return true; }
+ virtual bool runOnModule(Module &M);
/// getCBUDataStructures - Get the CompleteBUDataStructures object
///
@@ -117,15 +118,8 @@ namespace PA {
return GraphInfo;
}
- /// sameAsCBUGraph - Check if the folded graph for this function is
- /// the same as the CBU graph.
- bool sameAsCBUGraph(const Function &F) const {
- DSGraph& foldedGraph = getDSGraph(F);
- return (&foldedGraph == &CBU->getDSGraph(F));
- }
-
DSGraph &getGlobalsGraph() const {
- return CBU->getGlobalsGraph();
+ return *GlobalsGraph;
}
typedef llvm::BUDataStructures::ActualCalleesTy ActualCalleesTy;
@@ -143,8 +137,6 @@ namespace PA {
void print(std::ostream &O, const Module *M) const { CBU->print(O, M); }
private:
- void computeFoldedGraphs(Module &M);
-
void buildIndirectFunctionSets(Module &M);
unsigned processSCC(DSGraph &FG, Function &F, std::vector<Function*> &Stack,