[PATCH] D123879: [LLD] Alternate implementation for "Support per-thread allocators and StringSavers"

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 06:33:48 PDT 2022


oontvoo added inline comments.


================
Comment at: lld/include/lld/Common/CommonLinkerContext.h:54
+private:
+  llvm::sys::ThreadLocal<AllocContext> contextIndex;
+  // Vector of the TLS context's addresses.
----------------
The reason I reverted the revision that used ThreadLocal was because there was a ~1% regression linking chromium observed by @MaskRay .
(similarly for preserving the options of using non-threadlocal make()/saver() )

While I would agree with you that the code would so much simpler (like in this patch) to have all ports unconditionally use this new thread-safe allocators, I'm not sure  we should do that at the cost of performance regressions. For Macho, I didn't see any difference either way, but ELF seemed to get slower.






Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123879



More information about the llvm-commits mailing list