[llvm-dev] Building with LLVM_PARALLEL_XXX_JOBS

Tilmann Scheller via llvm-dev
Fri, 04 Mar 2016 10:28:46 -0000

Hi Sedat,

On 03/03/2016 08:09 AM, Sedat Dilek via llvm-dev wrote:
> It might be that a CLANG generated with LTO/PGO speeds up the build.
> Can you confirm this?
Yes, a Clang host compiler built with LTO or PGO is generally faster
than an -O3 build.

Some things to keep in mind when building the Clang host compiler:

GCC:
   - GCC 4.9 gives good results with PGO enabled (1.16x speedup over the
-O3 build), not so much with LTO (actually regresses performance over
the -O3 build, same for PGO vs PGO+LTO)
   - GCC 5.1/5.2/5.3 can't build Clang with LTO enabled
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66027), that's supposed to
be fixed in GCC 5.4

Clang:
   - PGO works and gives a good 1.12x speedup over the -O3 build
(produced about 270GB of profiling data when I tried this in December
last year, this should be addressed soon once the in-process profiling
data merging lands)
   - LTO provides a 1.03x speedup over the -O3 build
   - I have not tried LTO+PGO with full Clang bootstrap profiling data
but I would expect that it helps to increase the performance even further

> Can you confirm binutils-gold speed up the build?
Yes, gold is definitely faster than ld when building Clang/LLVM.

> Has LLVM an own linker?
> Can be used? Speedup the build?
I haven't tried it but lld can definitely link Clang/LLVM on x86-64 Linux.

> The blog-text mentioned to use optimized-tablegen.
> Good? Bad? Ugly?
Good, it helps to speed up debug builds.

Regards,

Tilmann