[llvm-commits] [poolalloc] r118664 - /poolalloc/trunk/lib/DSA/TopDownClosure.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Tue Nov 9 17:20:05 PST 2010


Author: aggarwa4
Date: Tue Nov  9 19:20:05 2010
New Revision: 118664

URL: http://llvm.org/viewvc/llvm-project?rev=118664&view=rev
Log:
Move the code that propogates information to the globals graph
to be after the Incomplete/External flag calculation.

This ensures that the globals graph does not get I, in the cases
when the graph itself does not mark I on the same node in its
graph. 

This was happening when a global was merged with a formal 
parameter to the function, which was I till the end of TD
for that graph.

Modified:
    poolalloc/trunk/lib/DSA/TopDownClosure.cpp

Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=118664&r1=118663&r2=118664&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Tue Nov  9 19:20:05 2010
@@ -86,7 +86,6 @@
   init(useEQBU ? &getAnalysis<EquivBUDataStructures>()
        : &getAnalysis<BUDataStructures>(), 
        true, true, true, false);
-
   // Figure out which functions must not mark their arguments complete because
   // they are accessible outside this compilation unit.  Currently, these
   // arguments are functions which are reachable by incomplete or external
@@ -249,6 +248,7 @@
   DEBUG(errs() << "[TD] Inlining callers into '" 
 	<< DSG->getFunctionNames() << "'\n");
 
+  DSG->maskIncompleteMarkers();
   // Iteratively inline caller graphs into this graph.
   while (!EdgesFromCaller.empty()) {
     DSGraph* CallerGraph = EdgesFromCaller.back().CallerGraph;
@@ -286,20 +286,9 @@
   }
 
 
-  {
-    DSGraph* GG = DSG->getGlobalsGraph();
-    ReachabilityCloner RC(GG, DSG,
-                          DSGraph::DontCloneCallNodes |
-                          DSGraph::DontCloneAuxCallNodes);
-    for (DSScalarMap::global_iterator
-           GI = DSG->getScalarMap().global_begin(),
-           E = DSG->getScalarMap().global_end(); GI != E; ++GI)
-      RC.getClonedNH(DSG->getNodeForValue(*GI));
-  }
 
   // Next, now that this graph is finalized, we need to recompute the
   // incompleteness markers for this graph and remove unreachable nodes.
-  DSG->maskIncompleteMarkers();
 
   // If any of the functions is externally callable, treat everything in its
   // SCC as externally callable.
@@ -323,6 +312,17 @@
     = isExternallyCallable ? DSGraph::MarkFormalsExternal : DSGraph::DontMarkFormalsExternal;
   DSG->computeExternalFlags(ExtFlags);
 
+  {
+    DSGraph* GG = DSG->getGlobalsGraph();
+    ReachabilityCloner RC(GG, DSG,
+                          DSGraph::DontCloneCallNodes |
+                          DSGraph::DontCloneAuxCallNodes);
+    for (DSScalarMap::global_iterator
+           GI = DSG->getScalarMap().global_begin(),
+           E = DSG->getScalarMap().global_end(); GI != E; ++GI)
+      RC.getClonedNH(DSG->getNodeForValue(*GI));
+  }
+ 
   //
   // Delete dead nodes.  Treat globals that are unreachable as dead also.
   //





More information about the llvm-commits mailing list