-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Description
The documentation on https://clang.llvm.org/docs/ThinLTO.html says
all transformations, including function importing, occur later when the modules are optimized in fully parallel backends
the ThinLTO link step will launch as many threads in parallel as there are cores
so I had high hopes that ThinLTO would allow to achieve very fast unity builds, because optimisation would be "parallel".
However, testing it, I noticed that there is no pallelism in that case. I observed that the linker only spawns as many threads as there were .o
files created during the bitcode-creation steps.
This meant that, contrary to my hopes, ThinLTO can never compile faster than a normal non-ThinLTO build.
Is this expected / as designed, or could it be made faster (e.g. per-function optimisation parallelism)?
If it is as designed, it would be great to document this constraint on that page.