diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-28 00:07:05 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-28 00:07:05 +0000 |
commit | 277e7675789274337827840724b54d1643e597ae (patch) | |
tree | f3f76c8c9bf3adb04fb15866fb91e3de99e080df /llvm/lib/Analysis | |
parent | 7c2b1e71c13e88e0788c5e26e6a366fecea06238 (diff) | |
download | bcm5719-llvm-277e7675789274337827840724b54d1643e597ae.tar.gz bcm5719-llvm-277e7675789274337827840724b54d1643e597ae.zip |
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.
llvm-svn: 82949
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index 801ae1952cb..a96a5c591f8 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/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. diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index c9515f600fe..f3686fe67a2 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -232,10 +232,10 @@ bool LPPassManager::runOnFunction(Function &F) { LoopPass *LP = dynamic_cast<LoopPass *>(P); { PassManagerPrettyStackEntry X(LP, *CurrentLoop->getHeader()); - StartPassTimer(P); assert(LP && "Invalid LPPassManager member"); + Timer *T = StartPassTimer(P); Changed |= LP->runOnLoop(CurrentLoop, *this); - StopPassTimer(P); + StopPassTimer(P, T); } if (Changed) |