Document how to build PGO-optimized GCC version

Alexander Zaitsev zamazan4ik@tut.by
Wed Dec 28 05:36:57 GMT 2022


Hello.

We are using GCC for our C++ projects. Our projects are huge, commit 
rate is quite huge, so our CI workers are always busy (so as any other 
CI workers, honestly). Since we want to increase build speed, one of the 
option is to optimize the compiler itself. Sounds like a good case for PGO.

Clang has the infrastructure for building the Clang itself with PGO: 
https://llvm.org/docs/HowToBuildWithPGO.html . I have tried to find 
something like that for GCC but with no success.

My proposal is:

  * add support for building PGO-optimized GCC into the GCC build
    infrastructure
  * add documentation to the GCC site, how to build GCC with PGO
    optimizations
  * (if GCC community provides prebuilt gcc binaries) use PGO for the
    prebuilt binaries. E.g. Clang and rustc already uses this approach.

Any feedback is appreciated.

Thanks in advance!

-- 
Best regards,
Alexander Zaitsev


More information about the Gcc mailing list