From: Nico Weber Date: Sat, 20 Apr 2019 23:22:45 +0000 (+0000) Subject: ftime-trace: Trace the name of the currently active pass as well. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=772d6f05f13c86b33f17a9db2f9307b29db06810;p=llvm ftime-trace: Trace the name of the currently active pass as well. Differential Revision: https://reviews.llvm.org/D60782 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358834 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp index e2717f7887e..3e8ec1a6709 100644 --- a/lib/IR/LegacyPassManager.cpp +++ b/lib/IR/LegacyPassManager.cpp @@ -1629,14 +1629,14 @@ bool FPPassManager::runOnFunction(Function &F) { FunctionSize = F.getInstructionCount(); } - bool ProfileTime = llvm::timeTraceProfilerEnabled(); - if (ProfileTime) - llvm::timeTraceProfilerBegin("OptFunction", F.getName()); + llvm::TimeTraceScope FunctionScope("OptFunction", F.getName()); for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); bool LocalChanged = false; + llvm::TimeTraceScope PassScope("RunPass", FP->getPassName()); + dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getName()); dumpRequiredSet(FP); @@ -1674,9 +1674,6 @@ bool FPPassManager::runOnFunction(Function &F) { removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG); } - if (ProfileTime) - llvm::timeTraceProfilerEnd(); - return Changed; }