llvm-project/llvm/lib/Support/Windows
Alexandre Ganea 09158252f7 [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
2020-03-27 10:20:58 -04:00
..
COM.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DynamicLibrary.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Host.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Memory.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Path.inc [Support] Fix clang warning in widenPath NFC 2020-03-23 18:59:55 +00:00
Process.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Program.inc [Support] Improve Windows widenPath and add support for long UNC paths 2020-03-19 13:00:21 +00:00
Signals.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
ThreadLocal.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Threading.inc [ThinLTO] Allow usage of all hardware threads in the system 2020-03-27 10:20:58 -04:00
Watchdog.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
explicit_symbols.inc Remove support for unsupported MSVC versions 2019-08-02 23:09:01 +00:00