[PATCH] D108850: [LLD] Remove global state in lldCommon

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 28 10:26:02 PST 2021


MaskRay added a comment.

Will `llvm::DenseMap<void *, SpecificAllocBase *> instances;` make `make<XXX>` too slow?

For ELF, I have measured that symbol/section initialization time matters. As an alternative, lld/ELF can do bulk initialization instead.
If an ELF .o file has N sections, 1/3 are discarded sections (SHT_RELA/SHT_SYMTAB/etc) while 1/7 are discarded COMDAT sections.
When linking chrome, perhaps 6/7 are discarded COMDAT sections (too many templates?). It wastes some memory if we don't compute the number of needed sections, but that may be fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108850



More information about the llvm-commits mailing list