[llvm-commits] [poolalloc] r122697 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Sun Jan 2 09:40:46 PST 2011
Author: aggarwa4
Date: Sun Jan 2 11:40:46 2011
New Revision: 122697
URL: http://llvm.org/viewvc/llvm-project?rev=122697&view=rev
Log:
Recalculate after inlining all callees in an SCCGraph.
New knowledge might be gotten. Fixes infinite loop in
test/dsa/callgraph/scc3.ll
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=122697&r1=122696&r2=122697&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Sun Jan 2 11:40:46 2011
@@ -407,12 +407,14 @@
//
// SCCFunctions - Keep track of the functions in the current SCC
//
- std::vector<DSGraph*> SCCGraphs;
+ std::vector<const Function*> SCCFunctions;
unsigned SCCSize = 1;
const Function *NF = Stack.back();
- ValMap[NF] = ~0U;
+ if(NF != F)
+ ValMap[NF] = ~0U;
DSGraph* SCCGraph = getDSGraph(*NF);
+ SCCFunctions.push_back(NF);
//
// First thing first: collapse all of the DSGraphs into a single graph for
@@ -422,7 +424,9 @@
while (NF != F) {
Stack.pop_back();
NF = Stack.back();
- ValMap[NF] = ~0U;
+ SCCFunctions.push_back(NF);
+ if(NF != F)
+ ValMap[NF] = ~0U;
DSGraph* NFG = getDSGraph(*NF);
@@ -455,6 +459,14 @@
DEBUG(errs() << " [BU] Done inlining SCC [" << SCCGraph->getGraphSize()
<< "+" << SCCGraph->getAuxFunctionCalls().size() << "]\n"
<< "DONE with SCC #: " << MyID << "\n");
+ getAllAuxCallees(SCCGraph, CalleeFunctions);
+ if (!CalleeFunctions.empty()) {
+ DEBUG(errs() << "Recalculating SCC Graph " << F->getName() << " due to new knowledge\n");
+ ValMap.erase(F);
+ return calculateGraphs(F, Stack, NextID, ValMap);
+ } else {
+ ValMap[F] = ~0U;
+ }
// We never have to revisit "SCC" processed functions...
return MyID;
More information about the llvm-commits
mailing list