[PATCH] D60782: ftime-trace: Trace the name of the currently active pass as well.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 20 16:22:56 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL358834: ftime-trace: Trace the name of the currently active pass as well. (authored by nico, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60782?vs=195405&id=195981#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60782/new/

https://reviews.llvm.org/D60782

Files:
  llvm/trunk/lib/IR/LegacyPassManager.cpp


Index: llvm/trunk/lib/IR/LegacyPassManager.cpp
===================================================================
--- llvm/trunk/lib/IR/LegacyPassManager.cpp
+++ llvm/trunk/lib/IR/LegacyPassManager.cpp
@@ -1629,14 +1629,14 @@
     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 @@
     removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG);
   }
 
-  if (ProfileTime)
-    llvm::timeTraceProfilerEnd();
-
   return Changed;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60782.195981.patch
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190420/d1938e6b/attachment.bin>


More information about the llvm-commits mailing list