diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-22 01:50:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-22 01:50:42 +0000 |
commit | 250726ec2526f18fb0647882d408d36be20e3a41 (patch) | |
tree | 19e46c1e52013dd091b18710cc64d14b23c956fc /llvm/lib/Analysis/DataStructure/TopDownClosure.cpp | |
parent | e05c633099b728e77d6b2760749f6bba9cf61942 (diff) | |
download | bcm5719-llvm-250726ec2526f18fb0647882d408d36be20e3a41.tar.gz bcm5719-llvm-250726ec2526f18fb0647882d408d36be20e3a41.zip |
When making a clone of a DSGraph from the BU pass, make sure to remember that
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*.
llvm-svn: 20763
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/TopDownClosure.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp index f1aea7982c0..45b2f2b4d2d 100644 --- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -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; } |