When making a clone of a DSGraph from the BU pass, make sure to remember that
authorChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 01:50:42 +0000 (01:50 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 01:50:42 +0000 (01:50 +0000)
this clone is supposed to be used for *ALL* of the functions in the SCC.

This fixes the memory explosion problem the TD pass was having, reducing the
memory growth from 24MB -> 3.5MB on povray and 270MB ->8.3MB on perlbmk!
This obviously also speeds up the TD pass *a lot*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20763 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/TopDownClosure.cpp

index f1aea7982c0a2695800f396c70724b0ffc155632..45b2f2b4d2df00225f01cb65c8fb87b6e230dad6 100644 (file)
@@ -105,8 +105,8 @@ bool TDDataStructures::runOnModule(Module &M) {
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal())
       getOrCreateDSGraph(*I);
+  return false;
 }
-//return false;
 #endif
 
 
@@ -154,6 +154,13 @@ DSGraph &TDDataStructures::getOrCreateDSGraph(Function &F) {
     assert(G->getAuxFunctionCalls().empty() && "Cloned aux calls?");
     G->setPrintAuxCalls();
     G->setGlobalsGraph(GlobalsGraph);
+
+    // Note that this graph is the graph for ALL of the function in the SCC, not
+    // just F.
+    for (DSGraph::retnodes_iterator RI = G->retnodes_begin(),
+           E = G->retnodes_end(); RI != E; ++RI)
+      if (RI->first != &F)
+        DSInfo[RI->first] = G;
   }
   return *G;
 }