[PATCH] D104428: [ThinLTO] Add TimeTrace for Thinlink step
Di Mo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 16 16:42:27 PDT 2021
modimo created this revision.
modimo added reviewers: tejohnson, anton-afanasyev.
Herald added subscribers: ormris, hoy, wenlei, lxfind, steven_wu, hiraditya, inglorion.
modimo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Results from Clang self-build
F17435948: image.png <https://reviews.llvm.org/F17435948>
https://reviews.llvm.org/D104428
Files:
llvm/lib/LTO/LTO.cpp
llvm/lib/LTO/ThinLTOCodeGenerator.cpp
Index: llvm/lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -996,6 +996,7 @@
// Main entry point for the ThinLTO processing
void ThinLTOCodeGenerator::run() {
+ timeTraceProfilerBegin("ThinLink", StringRef(""));
// Prepare the resulting object vector
assert(ProducedBinaries.empty() && "The generator should not be reused");
if (SavedObjectsDirectoryPath.empty())
@@ -1141,6 +1142,9 @@
ModulesVec.push_back(&Mod->getSingleBitcodeModule());
std::vector<int> ModulesOrdering = lto::generateModulesOrdering(ModulesVec);
+ if (llvm::timeTraceProfilerEnabled())
+ llvm::timeTraceProfilerEnd();
+
// Parallel optimizer + codegen
{
ThreadPool Pool(heavyweight_hardware_concurrency(ThreadCount));
Index: llvm/lib/LTO/LTO.cpp
===================================================================
--- llvm/lib/LTO/LTO.cpp
+++ llvm/lib/LTO/LTO.cpp
@@ -1398,6 +1398,7 @@
Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols) {
+ timeTraceProfilerBegin("ThinLink", StringRef(""));
if (ThinLTO.ModuleMap.empty())
return Error::success();
@@ -1512,6 +1513,9 @@
generateParamAccessSummary(ThinLTO.CombinedIndex);
+ if (llvm::timeTraceProfilerEnabled())
+ llvm::timeTraceProfilerEnd();
+
std::unique_ptr<ThinBackendProc> BackendProc =
ThinLTO.Backend(Conf, ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
AddStream, Cache);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104428.352581.patch
Type: text/x-patch
Size: 1641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210616/6e592ab7/attachment.bin>
More information about the llvm-commits
mailing list