Skip to content

Commit

Permalink
ftime-trace: Trace the name of the currently active pass as well.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D60782

llvm-svn: 358834
  • Loading branch information
nico committed Apr 20, 2019
1 parent 65e1ddd commit f2654b6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions llvm/lib/IR/LegacyPassManager.cpp
Expand Up @@ -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);

Expand Down Expand Up @@ -1674,9 +1674,6 @@ bool FPPassManager::runOnFunction(Function &F) {
removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG);
}

if (ProfileTime)
llvm::timeTraceProfilerEnd();

return Changed;
}

Expand Down

0 comments on commit f2654b6

Please sign in to comment.