From 5c12adaa8b92800d835ddd5c97723c6eb5628b5b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 28 Sep 2009 00:07:05 +0000 Subject: 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 --- lib/Analysis/LoopPass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Analysis/LoopPass.cpp') diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index c9515f600f..f3686fe67a 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -232,10 +232,10 @@ bool LPPassManager::runOnFunction(Function &F) { LoopPass *LP = dynamic_cast(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) -- cgit v1.2.3