aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-28 00:07:05 +0000
committerDan Gohman <gohman@apple.com>2009-09-28 00:07:05 +0000
commit5c12adaa8b92800d835ddd5c97723c6eb5628b5b (patch)
tree8336197f8626e6b21e83541178978e3fd8a80bae /lib/Analysis/IPA/CallGraphSCCPass.cpp
parent6a2fa325c1763a0fb27eceaa78b3a9bf683416bf (diff)
Extend the StartPassTimer and StopPassTimer functions so that the
code that stops the timer doesn't have to search to find the timer object before it stops the timer. This avoids a lock acquisition and a few other things done with the timer running. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 801ae1952c..a96a5c591f 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -96,9 +96,9 @@ bool CGPassManager::RunPassOnSCC(Pass *P, std::vector<CallGraphNode*> &CurSCC,
CallGraphUpToDate = true;
}
- StartPassTimer(CGSP);
+ Timer *T = StartPassTimer(CGSP);
Changed = CGSP->runOnSCC(CurSCC);
- StopPassTimer(CGSP);
+ StopPassTimer(CGSP, T);
// After the CGSCCPass is done, when assertions are enabled, use
// RefreshCallGraph to verify that the callgraph was correctly updated.
@@ -110,7 +110,6 @@ bool CGPassManager::RunPassOnSCC(Pass *P, std::vector<CallGraphNode*> &CurSCC,
return Changed;
}
- StartPassTimer(P);
FPPassManager *FPP = dynamic_cast<FPPassManager *>(P);
assert(FPP && "Invalid CGPassManager member");
@@ -118,10 +117,11 @@ bool CGPassManager::RunPassOnSCC(Pass *P, std::vector<CallGraphNode*> &CurSCC,
for (unsigned i = 0, e = CurSCC.size(); i != e; ++i) {
if (Function *F = CurSCC[i]->getFunction()) {
dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getName());
+ Timer *T = StartPassTimer(FPP);
Changed |= FPP->runOnFunction(*F);
+ StopPassTimer(FPP, T);
}
}
- StopPassTimer(P);
// The function pass(es) modified the IR, they may have clobbered the
// callgraph.