Bug 2224925 - Build Clang with Profile-Guided Optimization (PGO)
Summary: Build Clang with Profile-Guided Optimization (PGO)
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: clang
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tom Stellard
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-24 00:18 UTC by Alexander Zaitsev
Modified: 2023-07-24 00:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-163022 0 None None None 2023-07-24 00:19:40 UTC

Description Alexander Zaitsev 2023-07-24 00:18:31 UTC
Description of problem:

Clang supports (https://llvm.org/docs/HowToBuildWithPGO.html) bootstrapping with Profile-Guided Optimization (PGO). It increases Clang performance a lot (+20% according to the official docs and my own tests). The same thing is already enabled for GCC in Fedora (profiledbootstrap option). I think the same thing could be done for Clang since in the current build script I don't see that Clang is built with PGO.

Actual result:
Clang package is not PGO-optimized.

Expected results:
Provided Clang binaries with Fedora are built with PGO.

Additional option:
As an additional option, you could try to build binary with LLVM BOLT (https://github.com/facebookincubator/BOLT/blob/main/bolt/docs/OptimizingClang.md) but I guess it's another question and it's much more complicated topic.

More about PGO-related optimizations for other software you can find here: https://github.com/zamazan4ik/awesome-pgo

More about PGO optimizations for other LLVM-based projects (you can be interested in them too) you can find here: https://github.com/llvm/llvm-project/issues/63486

Also, I created a similar request in other Linux distributions:
- Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=2156679
- Rocky Linux: https://bugs.rockylinux.org/view.php?id=1618
- AlmaLinux: https://bugs.almalinux.org/view.php?id=350


Note You need to log in before you can comment on or make changes to this bug.