Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 907923

Summary: sys-devel/clang: add pgo use flag
Product: Gentoo Linux Reporter: Amir Aupov <fads93>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: UNCONFIRMED ---    
Severity: normal CC: gentoo, kocelfc, stuartmeya
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Amir Aupov 2023-06-06 03:41:50 UTC
Clang makes it easy to enable Instrumentation PGO using bundled CMake cache files: 
https://github.com/llvm/llvm-project/blob/main/clang/cmake/caches/PGO.cmake

Enabling is as simple as appending `-C llvm-project/clang/cmake/caches/PGO.cmake`.

The benefits of enabling PGO this way are shown on slide 4 in this presentation:
https://llvm.org/devmtg/2022-11/slides/Lightning15-OptimizingClangWithBOLTUsingCMake.pdf

with speedups ranging from 10 to 20 percent on a workload of compiling clang itself, which is representative of a modern C++ codebase, which in turn is a representative workload of a gentoo system (compiling c++ packages).

Reproducible: Always