[PATCH] D117605: [time-trace] Add optimizer and codegen regions to NPM

Wei Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 18 14:12:18 PST 2022


weiwang created this revision.
Herald added subscribers: ormris, hoy, wenlei.
weiwang requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Optimizer and codegen regions were only added to legacy PM. Add them to NPM as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117605

Files:
  clang/lib/CodeGen/BackendUtil.cpp


Index: clang/lib/CodeGen/BackendUtil.cpp
===================================================================
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -1491,8 +1491,11 @@
   }
 
   // Now that we have all of the passes ready, run them.
-  PrettyStackTraceString CrashInfo("Optimizer");
-  MPM.run(*TheModule, MAM);
+  {
+    PrettyStackTraceString CrashInfo("Optimizer");
+    llvm::TimeTraceScope TimeScope("Optimizer");
+    MPM.run(*TheModule, MAM);
+  }
 }
 
 void EmitAssemblyHelper::RunCodegenPipeline(
@@ -1524,8 +1527,11 @@
     return;
   }
 
-  PrettyStackTraceString CrashInfo("Code generation");
-  CodeGenPasses.run(*TheModule);
+  {
+    PrettyStackTraceString CrashInfo("Code generation");
+    llvm::TimeTraceScope TimeScope("CodeGenPasses");
+    CodeGenPasses.run(*TheModule);
+  }
 }
 
 /// A clean version of `EmitAssembly` that uses the new pass manager.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117605.400981.patch
Type: text/x-patch
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220118/2c04f506/attachment.bin>


More information about the cfe-commits mailing list