This is an archive of the discontinued LLVM Phabricator instance.

[Docs] Add Documentation on BOLT Build Configs
ClosedPublic

Authored by aidengrossman on Nov 12 2022, 5:33 PM.

Details

Summary

This patch adds documentation into the advanced builds documentation on
how to use the BOLT caches, including the combinations with the PGO
multistage builds and (Thin)LTO.

Diff Detail

Event Timeline

aidengrossman created this revision.Nov 12 2022, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2022, 5:33 PM
Herald added a subscriber: wenlei. · View Herald Transcript
aidengrossman requested review of this revision.Nov 12 2022, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2022, 5:33 PM

Adds info on using BOLT optimized builds and an example configuration using PGO, ThinLTO, and BOLT for a highly optimized build. Really compelling performance gains were demonstrated at the LLVM US Developer's Meeting, and I wanted to make replication more accessible through better documentation. It also seems like these details are also documented in clang/cmake/caches/README.txt. If there's interest for adding documentation there as well, I can open up another patch documenting some of this stuff in more detail (ie enumerating targets added by the BOLT caches as done in the other targets), but the CMake cache files are relatively simple.

These configs are mostly taken from the commit messages where they are implemented, with some slight modifications, particularly removing the LLVM_ENABLE_LLD flag in the fully optimized build config in case the user doesn't have LLD installed. I've left the other LLD flags on due to the significantly faster link time due to using LLD.

sylvestre.ledru accepted this revision.Nov 13 2022, 12:56 AM
sylvestre.ledru added inline comments.
llvm/docs/AdvancedBuilds.rst
201

Can you add a link to the bolt github readme here ?

This revision is now accepted and ready to land.Nov 13 2022, 12:56 AM
Amir accepted this revision.Nov 13 2022, 9:34 AM

Thank you for adding the documentation! Looks good to me, clear and concise.

Added link to BOLT readme within the section on BOLT
documentation.

aidengrossman marked an inline comment as done.Nov 13 2022, 10:54 PM
This revision was landed with ongoing or failed builds.Nov 13 2022, 11:00 PM
This revision was automatically updated to reflect the committed changes.