Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907931 - llvm-core/clang: add BOLT use flag
Summary: llvm-core/clang: add BOLT 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: 895326
Blocks:
  Show dependency tree
 
Reported: 2023-06-06 04:18 UTC by Amir Aupov
Modified: 2025-03-16 11:51 UTC (History)
10 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 04:18:15 UTC
Follow-up to https://bugs.gentoo.org/907923.

BOLT is a post-link binary optimizer: https://github.com/llvm/llvm-project/tree/main/bolt#bolt

Clang makes it easy to enable BOLT using bundled CMake cache files: 
https://github.com/llvm/llvm-project/blob/main/clang/cmake/caches/BOLT.cmake

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

BOLT can be enabled on top of Instrumentation PGO using BOLT-PGO.cmake.

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

with IPC improvements of enabling both PGO and BOLT comparable to a CPU generation bump (slide 5), 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 Oleksa 2024-07-30 19:19:46 UTC
Hello! Any news for this point?
Comment 2 Arniii 2024-08-18 01:46:10 UTC
Wow, that "BOLT" thing has a lot of performance gains.

Ok, maybe I can get how to update ebuild to make clang build itself with BOLT

Though I don't get how to make BOLT apply to other packages by not manually editing every ebuild.
Comment 3 Arniii 2024-09-13 21:21:15 UTC
Accidentely when was rereading whole Handbook I found this:

https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Hooking_into_the_emerge_process

Maybe it's possible to hook before src_install and via some environment variables scan folder for binaries and apply bolt to them...