[llvm-commits] [poolalloc] r57051 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Sat Oct 4 07:17:44 PDT 2008
Author: alenhar2
Date: Sat Oct 4 09:17:43 2008
New Revision: 57051
URL: http://llvm.org/viewvc/llvm-project?rev=57051&view=rev
Log:
Better graph revisit check
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=57051&r1=57050&r2=57051&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Sat Oct 4 09:17:43 2008
@@ -242,6 +242,9 @@
// Find all callee functions.
std::vector<Function*> CalleeFunctions;
GetAnyAuxCallees(Graph, CalleeFunctions);
+ std::sort(CalleeFunctions.begin(), CalleeFunctions.end());
+ std::vector<Function*>::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end());
+ CalleeFunctions.resize(uid - CalleeFunctions.begin());
// The edges out of the current node are the call site targets...
for (unsigned i = 0, e = CalleeFunctions.size(); i != e; ++i) {
@@ -274,10 +277,16 @@
if (MaxSCC < 1) MaxSCC = 1;
// Should we revisit the graph? Only do it if there are now new resolvable
- // callees.
- std::vector<Function*> CalleeFunctionsNew;
- GetAnyAuxCallees(Graph, CalleeFunctionsNew);
- if (CalleeFunctionsNew.size() > CalleeFunctions.size()) {
+ // callees or new callees
+ unsigned oldsize = CalleeFunctions.size();
+ GetAnyAuxCallees(Graph, CalleeFunctions);
+ std::sort(CalleeFunctions.begin(), CalleeFunctions.end());
+ std::vector<Function*>::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end());
+ CalleeFunctions.resize(uid - CalleeFunctions.begin());
+
+ std::vector<Function*> ResolvedFuncs;
+ GetAllAuxCallees(Graph, ResolvedFuncs);
+ if (ResolvedFuncs.size() || CalleeFunctions.size() > oldsize) {
DOUT << "Recalculating " << F->getName() << " due to new knowledge\n";
ValMap.erase(F);
return calculateGraphs(F, Stack, NextID, ValMap);
More information about the llvm-commits
mailing list