[PATCH] D71261: [ThinLTO] upgrade IR symtab in parallel ahead of time

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 11:25:16 PDT 2020


MaskRay added a comment.

> For symtab upgrade path, this reduces clang binary linking (all file hit lto cache) to ~5.5 (8 core, 16 threads) seconds from ~13s. Non-upgrade path takes about 3.8s.

This looks promising and I want to try out this patch for our internal targets. The patch does not apply at HEAD. Do you mind rebasing it?



================
Comment at: lld/ELF/Driver.cpp:71
 
 namespace lld {
+llvm::lto::IRSymtabFileCache *irSymTabCache;
----------------
Apologies that I just touched `namespace lld {` lines which might require you to rebase.


================
Comment at: lld/ELF/Options.td:88
 
+defm cache_irsymtab_ahead_of_time: B<"cache-ir-symtab",
+    "Cache IR symbol table before parsing input files",
----------------
Use the same name as the option name.

Use `BB` for strict two dashes. GNU ld's loose option parsing cause some parsing ambiguity. We want to avoid one-dash long options for newer options.


================
Comment at: llvm/lib/Object/IRSymtab.cpp:312
   Hdr.Version = storage::Header::kCurrentVersion;
-  setStr(Hdr.Producer, kExpectedProducerName);
+  if (getenv("LLVM_REEVAL_IR_SYMTAB_PRODUCER"))
+    setStr(Hdr.Producer, getExpectedProducerName());
----------------
Do we have a better testing this other than using an environment variable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71261/new/

https://reviews.llvm.org/D71261





More information about the llvm-commits mailing list