[PATCH] D128343: [lld/mac] Add a few TimeTraceScopes

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 08:00:06 PDT 2022


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added projects: lld-macho, All.
thakis requested review of this revision.

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%)


https://reviews.llvm.org/D128343

Files:
  lld/MachO/Driver.cpp
  lld/MachO/ICF.cpp
  lld/MachO/Writer.cpp


Index: lld/MachO/Writer.cpp
===================================================================
--- lld/MachO/Writer.cpp
+++ lld/MachO/Writer.cpp
@@ -1126,8 +1126,10 @@
 }
 
 void Writer::writeCodeSignature() {
-  if (codeSignatureSection)
+  if (codeSignatureSection) {
+    TimeTraceScope timeScope("Write code signature");
     codeSignatureSection->writeHashes(buffer->getBufferStart());
+  }
 }
 
 void Writer::writeOutputFile() {
Index: lld/MachO/ICF.cpp
===================================================================
--- lld/MachO/ICF.cpp
+++ lld/MachO/ICF.cpp
@@ -373,6 +373,7 @@
 }
 
 void macho::markAddrSigSymbols() {
+  TimeTraceScope timeScope("Mark addrsig symbols");
   for (InputFile *file : inputFiles) {
     ObjFile *obj = dyn_cast<ObjFile>(file);
     if (!obj)
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -1073,6 +1073,7 @@
 }
 
 static void foldIdenticalLiterals() {
+  TimeTraceScope timeScope("Fold identical literals");
   // We always create a cStringSection, regardless of whether dedupLiterals is
   // true. If it isn't, we simply create a non-deduplicating CStringSection.
   // Either way, we must unconditionally finalize it here.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128343.439025.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220622/42a239b3/attachment.bin>


More information about the llvm-commits mailing list