diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-30 23:51:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-30 23:51:02 +0000 |
commit | a1b39fa5ad8862f2a2a4f923e1e51c5285448725 (patch) | |
tree | 8d14bd6e7027e7dd16b34a71170856d0231ea5aa /llvm/lib/Analysis/DataStructure/DataStructureStats.cpp | |
parent | 7141334f981dfca37fa9c6a7605e90f5fb701188 (diff) | |
download | bcm5719-llvm-a1b39fa5ad8862f2a2a4f923e1e51c5285448725.tar.gz bcm5719-llvm-a1b39fa5ad8862f2a2a4f923e1e51c5285448725.zip |
* Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
This makes many operations on these lists much more natural, and avoids
*exteremely* expensive copying of DSCallSites (e.g. moving nodes around
between lists, erasing a node from not the end of the vector, etc).
With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc. I expect that it would help TD even more, but I don't
have data for it.
This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.
llvm-svn: 19939
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructureStats.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/DataStructureStats.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp index 330362ee8f7..3f8b6a93b8d 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp @@ -75,19 +75,19 @@ static bool isIndirectCallee(Value *V) { void DSGraphStats::countCallees(const Function& F) { unsigned numIndirectCalls = 0, totalNumCallees = 0; - const std::vector<DSCallSite> &callSites = TDGraph->getFunctionCalls(); - for (unsigned i = 0, N = callSites.size(); i != N; ++i) - if (isIndirectCallee(callSites[i].getCallSite().getCalledValue())) { + for (DSGraph::fc_iterator I = TDGraph->fc_begin(), E = TDGraph->fc_end(); + I != E; ++I) + if (isIndirectCallee(I->getCallSite().getCalledValue())) { // This is an indirect function call const std::vector<GlobalValue*> &Callees = - callSites[i].getCalleeNode()->getGlobals(); + I->getCalleeNode()->getGlobals(); if (Callees.size() > 0) { totalNumCallees += Callees.size(); ++numIndirectCalls; } else std::cerr << "WARNING: No callee in Function '" << F.getName() << "' at call: \n" - << *callSites[i].getCallSite().getInstruction(); + << *I->getCallSite().getInstruction(); } TotalNumCallees += totalNumCallees; |