]> granicus.if.org Git - llvm/commitdiff
ftime-trace: Trace loop passes
authorRussell Gallop <russell.gallop@gmail.com>
Fri, 31 May 2019 10:14:04 +0000 (10:14 +0000)
committerRussell Gallop <russell.gallop@gmail.com>
Fri, 31 May 2019 10:14:04 +0000 (10:14 +0000)
These can take a significant amount of time in some builds.

Suggested by Andrea Di Biagio.

Differential Revision: https://reviews.llvm.org/D62666

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362219 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopPass.cpp

index c57ec2a3e24c70286e278d91942db94411fdd6f7..4ab3798039d84c9995320d8c240cecf71b750d08 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/IR/PassTimingInfo.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Timer.h"
+#include "llvm/Support/TimeProfiler.h"
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
@@ -209,6 +210,8 @@ bool LPPassManager::runOnFunction(Function &F) {
     for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
       LoopPass *P = getContainedPass(Index);
 
+      llvm::TimeTraceScope LoopPassScope("RunLoopPass", P->getPassName());
+
       dumpPassInfo(P, EXECUTION_MSG, ON_LOOP_MSG,
                    CurrentLoop->getHeader()->getName());
       dumpRequiredSet(P);