llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.33k stars 11.7k forks source link

[apt.llvm.org] investigate thinLTO + PGO + BOLT builds of clang #83477

Open nickdesaulniers opened 7 months ago

nickdesaulniers commented 7 months ago

From a discussion https://github.com/ClangBuiltLinux/continuous-integration2/pull/719.

@nathanchance has some data about rebuilding clang with thinLTO + PGO + BOLT (with profiles from building linux kernels) significantly improves the build time relative to builds from apt.llvm.org.

ThinLTO isn't project specific, but "what project do you plan to build" has implications on the profile data used to feed PGO + BOLT.

For us, the scale of our CI bills justify having a purpose built compiler for building one project (which itself is perhaps interesting enough to be a talk/paper) when it's more than 50% faster.

We will continue to use apt.llvm.org, particularly the nightly builds. But perhaps @nathanchance 's data and learnings can be integrated into the apt.llvm.org builds?

boomanaiden154 commented 7 months ago

Just as an additional anecdote, with a PGO+ThinLTO+BOLT configuration perf-trained on building LLVM (instrumented BOLT perf-training done on a hello world program due to the speed of instrumented BOLT profiling), we get about 30-40% faster builds of LLVM in GitHub Actions. This would be really nice to have in the default Debian package!