Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907923 - llvm-core/clang: add pgo use flag
Summary: llvm-core/clang: add pgo use flag
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-06 03:41 UTC by Amir Aupov
Modified: 2025-03-16 12:05 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-16 12:05:28 UTC
(In reply to Amir Aupov from comment #0)
> 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`.

I'm not sure this actually works when you do a split build as we do.