[llvm-commits] [poolalloc] r126859 - in /poolalloc/trunk/lib/DSA: BottomUpClosure.cpp CompleteBottomUp.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Wed Mar 2 11:13:55 PST 2011
Author: aggarwa4
Date: Wed Mar 2 13:13:55 2011
New Revision: 126859
URL: http://llvm.org/viewvc/llvm-project?rev=126859&view=rev
Log:
Build call graph, when we start inlining. This
ensures that we get the same entries as we
inline.
Build SCCs at the end of BU. Might be needed by
TD, and not every client may use EQTD.
Modified:
poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=126859&r1=126858&r2=126859&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Wed Mar 2 13:13:55 2011
@@ -31,7 +31,8 @@
STATISTIC (NumCallEdges, "Number of 'actual' call edges");
STATISTIC (NumIndResolved, "Number of resolved IndCalls");
STATISTIC (NumIndUnresolved, "Number of unresolved IndCalls");
- STATISTIC (NumEmptyCalls, "Number of calls we know nothing about");
+ // NumEmptyCalls = NumIndUnresolved + Number of calls to external functions
+ STATISTIC (NumEmptyCalls, "Number of calls we know nothing about");
RegisterPass<BUDataStructures>
X("dsa-bu", "Bottom-up Data Structure Analysis");
@@ -101,12 +102,12 @@
DSGraph *Graph = getOrCreateGraph(F);
cloneGlobalsInto(Graph, DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
+ Graph->buildCallGraph(callgraph, GlobalFunctionList, filterCallees);
Graph->maskIncompleteMarkers();
Graph->markIncompleteNodes(DSGraph::MarkFormalArgs |
DSGraph::IgnoreGlobals);
Graph->computeExternalFlags(DSGraph::DontMarkFormalsExternal);
Graph->computeIntPtrFlags();
- Graph->buildCallGraph(callgraph, GlobalFunctionList, filterCallees);
}
}
@@ -121,6 +122,10 @@
NumCallEdges += callgraph.size();
+ // Put the call graph in canonical form
+ callgraph.buildSCCs();
+ callgraph.buildRoots();
+
return false;
}
@@ -525,6 +530,7 @@
//
void BUDataStructures::calculateGraph(DSGraph* Graph) {
DEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK());
+ Graph->buildCallGraph(callgraph, GlobalFunctionList, filterCallees);
// Move our call site list into TempFCs so that inline call sites go into the
// new call site list and doesn't invalidate our iterators!
@@ -552,7 +558,7 @@
if (CalledFuncs.empty()) {
++NumEmptyCalls;
- if (CS.isIndirectCall())
+ if (CS.isIndirectCall())
++NumIndUnresolved;
// Remember that we could not resolve this yet!
AuxCallsList.splice(AuxCallsList.end(), TempFCs, TempFCs.begin());
Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=126859&r1=126858&r2=126859&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original)
+++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Wed Mar 2 13:13:55 2011
@@ -55,8 +55,6 @@
getOrCreateGraph(F);
}
}
- callgraph.buildSCCs();
- callgraph.buildRoots();
buildIndirectFunctionSets();
formGlobalECs();
More information about the llvm-commits
mailing list