[llvm-commits] [poolalloc] r135732 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Thu Jul 21 17:35:22 PDT 2011


Author: aggarwa4
Date: Thu Jul 21 19:35:22 2011
New Revision: 135732

URL: http://llvm.org/viewvc/llvm-project?rev=135732&view=rev
Log:
Recalculate globals graph information after processing
the ctors exactly as we would at the end of BU. As it is the
end of one inlining phase.

The addition of the IgnoreGlobals flag seems to be key, as
otherwise all globals without initializers seem to be getting
marked I at the end of this phase. Either we do not revisit
the globals graph, but if we do we should use the IgnoreGlobals
flag.

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

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=135732&r1=135731&r2=135732&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Thu Jul 21 19:35:22 2011
@@ -258,15 +258,34 @@
            CloneAuxIntoGlobal(getDSGraph(*F));
           }
         }
-        // propogte information calculated 
-        // from the globals graph to the other graphs.
-        for (Module::iterator F = M.begin(); F != M.end(); ++F) {
-          if (!(F->isDeclaration())){
-            DSGraph *Graph  = getDSGraph(*F);
-            cloneGlobalsInto(Graph, DSGraph::DontCloneCallNodes |
-                        DSGraph::DontCloneAuxCallNodes);
-          }
+      GlobalsGraph->removeTriviallyDeadNodes();
+      GlobalsGraph->maskIncompleteMarkers();
+
+      // Mark external globals incomplete.
+      GlobalsGraph->markIncompleteNodes(DSGraph::IgnoreGlobals);
+      GlobalsGraph->computeExternalFlags(DSGraph::DontMarkFormalsExternal);
+      GlobalsGraph->computeIntPtrFlags();
+
+      //
+      // Create equivalence classes for aliasing globals so that we only need to
+      // record one global per DSNode.
+      //
+      formGlobalECs();
+      // propogte information calculated 
+      // from the globals graph to the other graphs.
+      for (Module::iterator F = M.begin(); F != M.end(); ++F) {
+        if (!(F->isDeclaration())){
+          DSGraph *Graph  = getDSGraph(*F);
+          cloneGlobalsInto(Graph, DSGraph::DontCloneCallNodes |
+                           DSGraph::DontCloneAuxCallNodes);
+          Graph->buildCallGraph(callgraph, GlobalFunctionList, filterCallees);
+          Graph->maskIncompleteMarkers();
+          Graph->markIncompleteNodes(DSGraph::MarkFormalArgs |
+                                     DSGraph::IgnoreGlobals);
+          Graph->computeExternalFlags(DSGraph::DontMarkFormalsExternal);
+          Graph->computeIntPtrFlags();
         }
+      }
     }
   }
  





More information about the llvm-commits mailing list