Skip to content

Commit f7a428e

Browse files
[TimeProfiler] Fix "OptModule" section and add new "Backend" sections
Remove unnecessary "OptModule" section. Add "PerFunctionPasses", "PerModulePasses" and "CodeGenPasses" sections under "Backend" section. llvm-svn: 373142
1 parent 509a494 commit f7a428e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
895895

896896
{
897897
PrettyStackTraceString CrashInfo("Per-function optimization");
898+
llvm::TimeTraceScope TimeScope("PerFunctionPasses", StringRef(""));
898899

899900
PerFunctionPasses.doInitialization();
900901
for (Function &F : *TheModule)
@@ -905,11 +906,13 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
905906

906907
{
907908
PrettyStackTraceString CrashInfo("Per-module optimization passes");
909+
llvm::TimeTraceScope TimeScope("PerModulePasses", StringRef(""));
908910
PerModulePasses.run(*TheModule);
909911
}
910912

911913
{
912914
PrettyStackTraceString CrashInfo("Code generation");
915+
llvm::TimeTraceScope TimeScope("CodeGenPasses", StringRef(""));
913916
CodeGenPasses.run(*TheModule);
914917
}
915918

llvm/lib/IR/LegacyPassManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,6 @@ bool FPPassManager::runOnFunction(Function &F) {
16801680
bool FPPassManager::runOnModule(Module &M) {
16811681
bool Changed = false;
16821682

1683-
llvm::TimeTraceScope TimeScope("OptModule", M.getName());
16841683
for (Function &F : M)
16851684
Changed |= runOnFunction(F);
16861685

0 commit comments

Comments
 (0)