diff options
author | Russell Gallop <russell.gallop@sony.com> | 2020-01-28 16:05:13 +0000 |
---|---|---|
committer | Russell Gallop <russell.gallop@sony.com> | 2020-02-06 12:14:13 +0000 |
commit | e7cb374433095219069ef767f70c0c9159a65b7c (patch) | |
tree | 2b23739a37f983d36d500bb098832bc2c6a6d25c /llvm/lib/LTO/LTO.cpp | |
parent | abe01e17f648a97666d4fbed41f0861686a17972 (diff) | |
download | llvm-e7cb374433095219069ef767f70c0c9159a65b7c.zip llvm-e7cb374433095219069ef767f70c0c9159a65b7c.tar.gz llvm-e7cb374433095219069ef767f70c0c9159a65b7c.tar.bz2 |
[LLD][ELF] Add time-trace to ELF LLD
This adds some of LLD specific scopes and picks up optimisation scopes
via LTO/ThinLTO. Makes use of TimeProfiler multi-thread support added in
77e6bb3c.
Differential Revision: https://reviews.llvm.org/D71060
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index ea0e297..1d23c6b 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -40,6 +40,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" @@ -1160,6 +1161,9 @@ public: &ResolvedODR, const GVSummaryMapTy &DefinedGlobals, MapVector<StringRef, BitcodeModule> &ModuleMap) { + if (LLVM_ENABLE_THREADS && Conf.TimeTraceEnabled) + timeTraceProfilerInitialize(Conf.TimeTraceGranularity, + "thin backend"); Error E = runThinLTOBackendThread( AddStream, Cache, Task, BM, CombinedIndex, ImportList, ExportList, ResolvedODR, DefinedGlobals, ModuleMap); @@ -1170,6 +1174,8 @@ public: else Err = std::move(E); } + if (LLVM_ENABLE_THREADS && Conf.TimeTraceEnabled) + timeTraceProfilerFinishThread(); }, BM, std::ref(CombinedIndex), std::ref(ImportList), std::ref(ExportList), std::ref(ResolvedODR), std::ref(DefinedGlobals), std::ref(ModuleMap)); |