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

Will Dietz wdietz2 at illinois.edu
Mon May 7 21:16:55 PDT 2012


Author: wdietz2
Date: Mon May  7 23:16:55 2012
New Revision: 156367

URL: http://llvm.org/viewvc/llvm-project?rev=156367&view=rev
Log:
TD: Don't re-process the same graphs over and over when updating Globals Graph.

Drops TD on 403.gcc from 26s to 3s, for example.

Would expect to have even grander effect in EQTD, where it's significantly
more likely to have the same DSGraph for multiple functions /and/ due to
larger graph size that much more expensive to re-process.

Haven't measured that yet, though.

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=156367&r1=156366&r2=156367&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Mon May  7 23:16:55 2012
@@ -171,9 +171,11 @@
 
   // Make sure each graph has updated external information about globals
   // in the globals graph.
+  VisitedGraph.clear();
   for (Module::iterator F = M.begin(); F != M.end(); ++F) {
     if (!(F->isDeclaration())){
       DSGraph *Graph  = getOrCreateGraph(F);
+      if (!VisitedGraph.insert(Graph).second) continue;
 
       cloneGlobalsInto(Graph, DSGraph::DontCloneCallNodes |
                         DSGraph::DontCloneAuxCallNodes);





More information about the llvm-commits mailing list