[llvm-commits] [poolalloc] r76477 - /poolalloc/trunk/lib/DSA/Steensgaard.cpp
Haohui Mai
mai4 at uiuc.edu
Mon Jul 20 14:24:10 PDT 2009
Author: mai4
Date: Mon Jul 20 16:24:09 2009
New Revision: 76477
URL: http://llvm.org/viewvc/llvm-project?rev=76477&view=rev
Log:
Merge globals into the result graph at the final stage of steensgaard DSA, just like what BU does.
Modified:
poolalloc/trunk/lib/DSA/Steensgaard.cpp
Modified: poolalloc/trunk/lib/DSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Steensgaard.cpp?rev=76477&r1=76476&r2=76477&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/DSA/Steensgaard.cpp Mon Jul 20 16:24:09 2009
@@ -62,9 +62,9 @@
GlobalsGraph = new DSGraph(GG, GG->getGlobalECs());
// Create a new, empty, graph...
- ResultGraph = new DSGraph(GlobalECs, getTargetData());
+ ResultGraph = new DSGraph(GG->getGlobalECs(), getTargetData());
ResultGraph->setGlobalsGraph(GlobalsGraph);
-// ResultGraph->spliceFrom(DS->getGlobalsGraph());
+ // ResultGraph->spliceFrom(DS->getGlobalsGraph());
// Loop over the rest of the module, merging graphs for non-external functions
@@ -134,7 +134,25 @@
// Remove any nodes that are dead after all of the merging we have done...
- ResultGraph->removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
+ ResultGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
+
+ GlobalsGraph->removeTriviallyDeadNodes(true);
+ GlobalsGraph->maskIncompleteMarkers();
+
+ // Mark external globals incomplete.
+ GlobalsGraph->markIncompleteNodes(DSGraph::IgnoreGlobals);
+
+ formGlobalECs();
+
+ // Clone the global nodes into this graph.
+ ReachabilityCloner RC(ResultGraph, GlobalsGraph,
+ DSGraph::DontCloneCallNodes |
+ DSGraph::DontCloneAuxCallNodes);
+ for (DSScalarMap::global_iterator I = GlobalsGraph->getScalarMap().global_begin(),
+ E = GlobalsGraph->getScalarMap().global_end(); I != E; ++I)
+ if (isa<GlobalVariable>(*I))
+ RC.getClonedNH(GlobalsGraph->getNodeForValue(*I));
+
print(DOUT, &M);
return false;
More information about the llvm-commits
mailing list