diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-03-27 10:20:39 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-03-27 10:20:58 -0400 |
commit | 09158252f777c2e2f06a86b154c44abcbcf9bb74 (patch) | |
tree | d439364df9e912e5b6fbe9fe10e10e0da5b663b6 /llvm/lib/Object/XCOFFObjectFile.cpp | |
parent | 3f2f7f895a849a3247625482b15491ed2103ccf4 (diff) | |
download | llvm-09158252f777c2e2f06a86b154c44abcbcf9bb74.zip llvm-09158252f777c2e2f06a86b154c44abcbcf9bb74.tar.gz llvm-09158252f777c2e2f06a86b154c44abcbcf9bb74.tar.bz2 |
[ThinLTO] Allow usage of all hardware threads in the system
Before this patch, it wasn't possible to extend the ThinLTO threads to all SMT/CMT threads in the system. Only one thread per core was allowed, instructed by usage of llvm::heavyweight_hardware_concurrency() in the ThinLTO code. Any number passed to the LLD flag /opt:lldltojobs=..., or any other ThinLTO-specific flag, was previously interpreted in the context of llvm::heavyweight_hardware_concurrency(), which means SMT disabled.
One can now say in LLD:
/opt:lldltojobs=0 -- Use one std::thread / hardware core in the system (no SMT). Default value if flag not specified.
/opt:lldltojobs=N -- Limit usage to N threads, regardless of usage of heavyweight_hardware_concurrency().
/opt:lldltojobs=all -- Use all hardware threads in the system. Equivalent to /opt:lldltojobs=$(nproc) on Linux and /opt:lldltojobs=%NUMBER_OF_PROCESSORS% on Windows. When an affinity mask is set for the process, threads will be created only for the cores selected by the mask.
When N > number-of-hardware-threads-in-the-system, the threads in the thread pool will be dispatched equally on all CPU sockets (tested only on Windows).
When N <= number-of-hardware-threads-on-a-CPU-socket, the threads will remain on the CPU socket where the process started (only on Windows).
Differential Revision: https://reviews.llvm.org/D75153
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions