1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/include/llvm/LTO
Alexandre Ganea 41c38f2370 Re-land [ThinLTO] Re-order modules for optimal multi-threaded processing
This reverts 9b5b3050237db3642ed7ab1bdb3ffa2202511b99 and fixes the unwanted re-ordering when generating ThinLTO indexes.

The goal of this patch is to better balance thread utilization during ThinLTO in-process linking (in llvm-lto2 or in LLD). Before this patch, large modules would often be scheduled late during execution, taking a long time to complete, thus starving the thread pool.

We now sort modules in descending order, based on each module's bitcode size, so that larger modules are processed first. By doing so, smaller modules have a better chance to keep the thread pool active, and thus avoid starvation when the bitcode compilation is almost complete.

In our case (on dual Intel Xeon Gold 6140, Windows 10 version 2004, two-stage build), this saves 15 sec when linking `clang.exe` with LLD & -flto=thin, /opt:lldltojobs=all, no ThinLTO cache, -DLLVM_INTEGRATED_CRT_ALLOC=d:\git\rpmalloc.

Before patch: 100 sec
After patch: 85 sec

Inspired by the work done by David Callahan in D60495.

Differential Revision: https://reviews.llvm.org/D87966
2020-10-13 21:54:15 -04:00
..
legacy [LTO] Use StringRef instead of C-style strings in setCodeGenDebugOptions 2020-06-22 11:22:18 +01:00
Caching.h [LTO] Migrate typedef to using 2019-05-02 10:52:34 +00:00
Config.h [LLD][ThinLTO] Add --thinlto-single-module to allow compiling partial modules. 2020-06-10 15:32:30 -07:00
LTO.h Re-land [ThinLTO] Re-order modules for optimal multi-threaded processing 2020-10-13 21:54:15 -04:00
LTOBackend.h [ThinLTO] Option to bypass function importing. 2020-09-22 13:12:11 -07:00
SummaryBasedOptimizations.h