xref: /aosp_15_r20/external/toolchain-utils/pgo_tools/README.md (revision 760c253c1ed00ce9abd48f8546f08516e57485fe)
1*760c253cSXin Li# pgo_tools
2*760c253cSXin Li
3*760c253cSXin LiThis directory contains scripts used to generate and vet PGO profiles for LLVM.
4*760c253cSXin Li
5*760c253cSXin LiIf you're a Mage who wants to generate a new PGO profile for the llvm-next
6*760c253cSXin Lirelease, `./generate_llvm_next_pgo.py` is what you should run **outside of a
7*760c253cSXin Lichroot**. It will create a new chroot, and generate a profile that's
8*760c253cSXin Libackwards-compatible with our bootstrap chroot toolchains. This script takes a
9*760c253cSXin Lifew dozen minutes, and prints an "upload PGO profile" command at the end.
10*760c253cSXin Li
11*760c253cSXin LiIf you're a user who wants to generate a bespoke PGO profile for LLVM,
12*760c253cSXin Li`./generate_pgo_profile.py` is what you want. Run it **inside of a chroot**, and
13*760c253cSXin Liit will generate a profile for you with a pretty comprehensive, predefined
14*760c253cSXin Liworkload (building absl's tests for arm32, arm64, and a few x86_64 configs).
15*760c253cSXin Li
16*760c253cSXin LiIf you want to compare the rough performance of PGO profiles,
17*760c253cSXin Li`./benchmark_pgo_profiles.py` may be useful.
18