[llvm-commits] [poolalloc] r159065 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
Will Dietz
wdietz2 at illinois.edu
Fri Jun 22 19:56:59 PDT 2012
Author: wdietz2
Date: Fri Jun 22 21:56:59 2012
New Revision: 159065
URL: http://llvm.org/viewvc/llvm-project?rev=159065&view=rev
Log:
BU: Change the way we process function list while inlining.
Instead of TempFCS and splicing/erasing each element at a time,
make a pass through and copy over the DSC's we want to keep.
No significant impact on runtime/memory across BU on CINT2006.
(Other than 471.omnetpp which goes 175M->150M and saves .4s heh)
Does change the order in which we inline graphs a tad, however.
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=159065&r1=159064&r2=159065&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Fri Jun 22 21:56:59 2012
@@ -614,22 +614,21 @@
DSGraph::FunctionListTy &AuxCallsList = Graph->getAuxFunctionCalls();
TempFCs.swap(AuxCallsList);
- while (!TempFCs.empty()) {
+ for(DSGraph::FunctionListTy::iterator I = TempFCs.begin(), E = TempFCs.end();
+ I != E; ++I) {
DEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK());
-
- DSCallSite &CS = *TempFCs.begin();
-
+
+ DSCallSite &CS = *I;
+
// Fast path for noop calls. Note that we don't care about merging globals
// in the callee with nodes in the caller here.
if (!CS.isIndirectCall() && CS.getRetVal().isNull()
&& CS.getNumPtrArgs() == 0 && !CS.isVarArg()) {
- TempFCs.erase(TempFCs.begin());
continue;
}
// If this callsite is unresolvable, get rid of it now.
if (CS.isUnresolvable()) {
- TempFCs.erase(TempFCs.begin());
continue;
}
@@ -643,7 +642,8 @@
if (CS.isIndirectCall())
++NumIndUnresolved;
// Remember that we could not resolve this yet!
- AuxCallsList.splice(AuxCallsList.end(), TempFCs, TempFCs.begin());
+ DSGraph::FunctionListTy::iterator S = I++;
+ AuxCallsList.splice(AuxCallsList.end(), TempFCs, S);
continue;
}
// If we get to this point, we know the callees, and can inline.
@@ -685,8 +685,8 @@
++NumInlines;
DEBUG(Graph->AssertGraphOK(););
}
- TempFCs.erase(TempFCs.begin());
}
+ TempFCs.clear();
// Recompute the Incomplete markers
Graph->maskIncompleteMarkers();
More information about the llvm-commits
mailing list