[lld/mac] Add a few TimeTraceScopes

Identical literal folding takes ~1.4% of the time, and was missing
from the trace.

Signature computation still needs ~2.2% of the time, so probably worth
explicitly marking its contribution to "Write output file" (9.1%)

Differential Revision: https://reviews.llvm.org/D128343
This commit is contained in:
Nico Weber 2022-06-22 10:58:33 -04:00
parent 4045b62d4c
commit 0ec87addb7
3 changed files with 5 additions and 1 deletions

View File

@ -1073,6 +1073,7 @@ static void gatherInputSections() {
} }
static void foldIdenticalLiterals() { static void foldIdenticalLiterals() {
TimeTraceScope timeScope("Fold identical literals");
// We always create a cStringSection, regardless of whether dedupLiterals is // We always create a cStringSection, regardless of whether dedupLiterals is
// true. If it isn't, we simply create a non-deduplicating CStringSection. // true. If it isn't, we simply create a non-deduplicating CStringSection.
// Either way, we must unconditionally finalize it here. // Either way, we must unconditionally finalize it here.

View File

@ -373,6 +373,7 @@ void macho::markSymAsAddrSig(Symbol *s) {
} }
void macho::markAddrSigSymbols() { void macho::markAddrSigSymbols() {
TimeTraceScope timeScope("Mark addrsig symbols");
for (InputFile *file : inputFiles) { for (InputFile *file : inputFiles) {
ObjFile *obj = dyn_cast<ObjFile>(file); ObjFile *obj = dyn_cast<ObjFile>(file);
if (!obj) if (!obj)

View File

@ -1126,8 +1126,10 @@ void Writer::writeUuid() {
} }
void Writer::writeCodeSignature() { void Writer::writeCodeSignature() {
if (codeSignatureSection) if (codeSignatureSection) {
TimeTraceScope timeScope("Write code signature");
codeSignatureSection->writeHashes(buffer->getBufferStart()); codeSignatureSection->writeHashes(buffer->getBufferStart());
}
} }
void Writer::writeOutputFile() { void Writer::writeOutputFile() {