Skip to content

Commit 13bf437

Browse files
committed
Adjust some tags following review
1 parent a4cf7ef commit 13bf437

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

lld/COFF/LTO.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/Support/Caching.h"
2727
#include "llvm/Support/CodeGen.h"
2828
#include "llvm/Support/MemoryBuffer.h"
29+
#include "llvm/Support/TimeProfiler.h"
2930
#include "llvm/Support/raw_ostream.h"
3031
#include <cstddef>
3132
#include <memory>
@@ -176,6 +177,7 @@ void BitcodeCompiler::add(BitcodeFile &f) {
176177
// Merge all the bitcode files we have seen, codegen the result
177178
// and return the resulting objects.
178179
std::vector<InputFile *> BitcodeCompiler::compile() {
180+
llvm::TimeTraceScope timeScope("Bitcode compile");
179181
unsigned maxTasks = ltoObj->getMaxTasks();
180182
buf.resize(maxTasks);
181183
files.resize(maxTasks);

lld/COFF/SymbolTable.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,15 +1437,13 @@ void SymbolTable::compileBitcodeFiles() {
14371437
if (bitcodeFileInstances.empty())
14381438
return;
14391439

1440-
llvm::TimeTraceScope timeScope("Compile bitcode");
14411440
ScopedTimer t(ctx.ltoTimer);
14421441
lto.reset(new BitcodeCompiler(ctx));
14431442
{
14441443
llvm::TimeTraceScope addScope("Add bitcode file instances");
14451444
for (BitcodeFile *f : bitcodeFileInstances)
14461445
lto->add(*f);
14471446
}
1448-
llvm::TimeTraceScope compileScope("LTO compile");
14491447
for (InputFile *newObj : lto->compile()) {
14501448
ObjFile *obj = cast<ObjFile>(newObj);
14511449
obj->parse();

llvm/lib/LTO/LTO.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,6 +1930,11 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
19301930
llvm::TimeTraceScope timeScope("Run ThinLTO");
19311931
LLVM_DEBUG(dbgs() << "Running ThinLTO\n");
19321932
ThinLTO.CombinedIndex.releaseTemporaryMemory();
1933+
timeTraceProfilerBegin("ThinLink", StringRef(""));
1934+
auto TimeTraceScopeExit = llvm::make_scope_exit([]() {
1935+
if (llvm::timeTraceProfilerEnabled())
1936+
llvm::timeTraceProfilerEnd();
1937+
});
19331938
if (ThinLTO.ModuleMap.empty())
19341939
return Error::success();
19351940

@@ -2077,6 +2082,11 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
20772082

20782083
generateParamAccessSummary(ThinLTO.CombinedIndex);
20792084

2085+
if (llvm::timeTraceProfilerEnabled())
2086+
llvm::timeTraceProfilerEnd();
2087+
2088+
TimeTraceScopeExit.release();
2089+
20802090
auto &ModuleMap =
20812091
ThinLTO.ModulesToCompile ? *ThinLTO.ModulesToCompile : ThinLTO.ModuleMap;
20822092

llvm/lib/Transforms/IPO/FunctionImport.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ void llvm::computeDeadSymbolsWithConstProp(
15511551
const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
15521552
function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing,
15531553
bool ImportEnabled) {
1554-
llvm::TimeTraceScope timeScope("Dead symbols");
1554+
llvm::TimeTraceScope timeScope("Drop dead symbols and propagate attributes");
15551555
computeDeadSymbolsAndUpdateIndirectCalls(Index, GUIDPreservedSymbols,
15561556
isPrevailing);
15571557
if (ImportEnabled)
@@ -1906,7 +1906,7 @@ Expected<bool> FunctionImporter::importFunctions(
19061906
// Find the globals to import
19071907
SetVector<GlobalValue *> GlobalsToImport;
19081908
{
1909-
llvm::TimeTraceScope findGlobalsScope("Find globals");
1909+
llvm::TimeTraceScope functionsScope("Functions");
19101910
for (Function &F : *SrcModule) {
19111911
if (!F.hasName())
19121912
continue;

0 commit comments

Comments
 (0)