[all-commits] [llvm/llvm-project] f6bd0a: [ELF] Add makeThreadLocal/makeThreadLocalN and rem...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Thu Aug 4 11:09:54 PDT 2022
Author: Fangrui Song <i at maskray.me>
Date: 2022-08-04 (Thu, 04 Aug 2022)
[ELF] Add makeThreadLocal/makeThreadLocalN and remove InputFile::localSymStorage
makeThreadLocal/makeThreadLocalN are moved from D130810 ([ELF] Parallelize input
section initialization) here to make D130810 more focused on the refactor:
* COFF has some needs for multiple linker contexts. D108850 partially removed
global states from lldCommon but left the global variable `lctx`.
* To the best of my knowledge, all multiple-linker-context feature requests to
ELF are more from user convenience, with no very strong argument.
* In practice, ELF port is very difficult to remove global states without
introducing significant performance regression/hurting code readability.
* Per-thread allocators from D122922/D123879 are too expensive and will not
really benefit ELF.
This patch adds a simple thread_local based makeThreadLocal to
lld/Common/Memory.h. It will enable further optimization in ELF.
More information about the All-commits