diff options
author | Rui Ueyama <ruiu@google.com> | 2019-12-13 14:31:57 +0900 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2019-12-13 14:35:03 +0900 |
commit | af5ca40b47b3e85c3add81ccdc0b787c4bc355ae (patch) | |
tree | 635e5a328c11f60145c0a05df86353bca4b2a2d3 /llvm | |
parent | 4daa8d1de6dda58aebfa7b19547ed3ce4e9bc91a (diff) | |
download | bcm5719-llvm-af5ca40b47b3e85c3add81ccdc0b787c4bc355ae.tar.gz bcm5719-llvm-af5ca40b47b3e85c3add81ccdc0b787c4bc355ae.zip |
temporary
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/LTO/Config.h | 6 | ||||
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/LTO/Config.h b/llvm/include/llvm/LTO/Config.h index 754e3126f8a..6db1235a692 100644 --- a/llvm/include/llvm/LTO/Config.h +++ b/llvm/include/llvm/LTO/Config.h @@ -117,6 +117,12 @@ struct Config { /// Statistics output file path. std::string StatsFile; + /// Time trace enabled + bool TimeTraceEnabled = false; + + /// Time trace granularity + unsigned TimeTraceGranularity = 500; + bool ShouldDiscardValueNames = true; DiagnosticHandlerFunction DiagHandler; diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 0d48090e426..e2c8aa15989 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -39,6 +39,7 @@ #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/ThreadPool.h" #include "llvm/Support/Threading.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Support/VCSRevision.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" @@ -1133,6 +1134,9 @@ public: &ResolvedODR, const GVSummaryMapTy &DefinedGlobals, MapVector<StringRef, BitcodeModule> &ModuleMap) { + if (Conf.TimeTraceEnabled) + timeTraceProfilerInitialize(Conf.TimeTraceGranularity, + "thin backend"); Error E = runThinLTOBackendThread( AddStream, Cache, Task, BM, CombinedIndex, ImportList, ExportList, ResolvedODR, DefinedGlobals, ModuleMap); @@ -1143,6 +1147,8 @@ public: else Err = std::move(E); } + if (timeTraceProfilerEnabled()) + timeTraceProfilerFinishThread(); }, BM, std::ref(CombinedIndex), std::ref(ImportList), std::ref(ExportList), std::ref(ResolvedODR), std::ref(DefinedGlobals), std::ref(ModuleMap)); |