[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 17 13:08:04 PST 2004
Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.74 -> 1.75
---
Log message:
When we complete the bottom-up pass, make sure to merge the globals in 'main' into
the globals graph.
---
Diffs of the changes: (+17 -0)
Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.74 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.75
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.74 Sat Feb 7 19:51:48 2004
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Tue Feb 17 13:06:47 2004
@@ -57,6 +57,23 @@
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
More information about the llvm-commits
mailing list