[PATCH] D32803: [LTO] Print time-passes information at conclusion of LTO codegen
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 02:56:48 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL303152: [LTO] Print time-passes information at conclusion of LTO codegen (authored by jhenderson).
Changed prior to commit:
https://reviews.llvm.org/D32803?vs=98966&id=99123#toc
Repository:
rL LLVM
https://reviews.llvm.org/D32803
Files:
llvm/trunk/include/llvm/IR/LegacyPassManager.h
llvm/trunk/lib/IR/LegacyPassManager.cpp
llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
Index: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -1024,4 +1024,5 @@
// If statistics were requested, print them out now.
if (llvm::AreStatisticsEnabled())
llvm::PrintStatistics();
+ reportAndResetTimings();
}
Index: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
===================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
@@ -597,6 +597,7 @@
// If statistics were requested, print them out after codegen.
if (llvm::AreStatisticsEnabled())
llvm::PrintStatistics();
+ reportAndResetTimings();
finishOptimizationRemarks();
Index: llvm/trunk/lib/IR/LegacyPassManager.cpp
===================================================================
--- llvm/trunk/lib/IR/LegacyPassManager.cpp
+++ llvm/trunk/lib/IR/LegacyPassManager.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManagers.h"
@@ -465,6 +466,11 @@
// null. It may be called multiple times.
static void createTheTimeInfo();
+ // print - Prints out timing information and then resets the timers.
+ void print() {
+ TG.print(*CreateInfoOutputFile());
+ }
+
/// getPassTimer - Return the timer for the specified pass if it exists.
Timer *getPassTimer(Pass *P) {
if (P->getAsPMDataManager())
@@ -1752,6 +1758,13 @@
return nullptr;
}
+/// If timing is enabled, report the times collected up to now and then reset
+/// them.
+void llvm::reportAndResetTimings() {
+ if (TheTimeInfo)
+ TheTimeInfo->print();
+}
+
//===----------------------------------------------------------------------===//
// PMStack implementation
//
Index: llvm/trunk/include/llvm/IR/LegacyPassManager.h
===================================================================
--- llvm/trunk/include/llvm/IR/LegacyPassManager.h
+++ llvm/trunk/include/llvm/IR/LegacyPassManager.h
@@ -98,6 +98,9 @@
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_STDCXX_CONVERSION_FUNCTIONS(legacy::PassManagerBase, LLVMPassManagerRef)
+/// If -time-passes has been specified, report the timings immediately and then
+/// reset the timers to zero.
+void reportAndResetTimings();
} // End llvm namespace
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32803.99123.patch
Type: text/x-patch
Size: 2598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170516/f4adec10/attachment.bin>
More information about the llvm-commits
mailing list