aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-21 00:30:28 +0000
committerChris Lattner <sabre@nondot.org>2004-02-21 00:30:28 +0000
commit3567937f16643b80f995ee9c9cd3e3f75027d460 (patch)
tree4c7fff6f64e241342f298609c260b40b7218a963 /lib/Analysis/DataStructure
parentd10b5fd395e2c4390c669e1caad98f5f491eb7b6 (diff)
Instead of cloning the globals for main into the globals graph at the end of
BU propagation, clone the globals into the GG of EACH FUNCTION that finishes processing! The GlobalsGraph *must* include all globals and effects from all functions in the program. Fixing this makes pool allocation work better on 175.vpr, but it still ultimately crashes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index fceb1ded59..2125064030 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -57,23 +57,6 @@ bool BUDataStructures::run(Module &M) {
NumCallEdges += ActualCallees.size();
-
- // At the end of the BU phase, clone the BU graph for main into the globals
- // graph to make sure it has everything.
- if (MainFunc) {
- DSGraph &MainGraph = getOrCreateGraph(MainFunc);
- DSScalarMap &MainSM = MainGraph.getScalarMap();
- ReachabilityCloner RC(*GlobalsGraph, MainGraph, DSGraph::StripAllocaBit);
-
- // Clone everything reachable from globals in the "main" graph into the
- // globals graph.
- for (DSScalarMap::global_iterator I = MainSM.global_begin(),
- E = MainSM.global_end(); I != E; ++I)
- RC.getClonedNH(MainSM[*I]);
-
-
- }
-
// At the end of the bottom-up pass, the globals graph becomes complete.
// FIXME: This is not the right way to do this, but it is sorta better than
// nothing! In particular, externally visible globals and unresolvable call
@@ -329,5 +312,16 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
// reach live nodes as live.
Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
+ // When this graph is finalized, clone the globals in the graph into the
+ // globals graph to make sure it has everything, from all graphs.
+ DSScalarMap &MainSM = Graph.getScalarMap();
+ ReachabilityCloner RC(*GlobalsGraph, Graph, DSGraph::StripAllocaBit);
+
+ // Clone everything reachable from globals in the "main" graph into the
+ // globals graph.
+ for (DSScalarMap::global_iterator I = MainSM.global_begin(),
+ E = MainSM.global_end(); I != E; ++I)
+ RC.getClonedNH(MainSM[*I]);
+
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
}