3
3
set -euxo pipefail
4
4
5
5
# Compile several crates to gather execution PGO profiles.
6
- # Arg0 => builds (Debug, Opt)
7
- # Arg1 => runs (Full, IncrFull, All)
6
+ # Arg0 => profiles (Debug, Opt)
7
+ # Arg1 => scenarios (Full, IncrFull, All)
8
8
# Arg2 => crates (syn, cargo, ...)
9
9
gather_profiles () {
10
10
cd /checkout/obj
@@ -27,10 +27,10 @@ gather_profiles () {
27
27
profile_local \
28
28
eprintln \
29
29
/checkout/obj/build/$PGO_HOST /stage2/bin/rustc \
30
- Test \
31
- --builds $1 \
30
+ --id Test \
31
+ --profiles $1 \
32
32
--cargo /checkout/obj/build/$PGO_HOST /stage0/bin/cargo \
33
- --runs $2 \
33
+ --scenarios $2 \
34
34
--include $3
35
35
36
36
cd /checkout/obj
@@ -64,7 +64,10 @@ RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
64
64
RUSTC_BOOTSTRAP=1 \
65
65
/checkout/obj/build/$PGO_HOST /stage0/bin/cargo build -p collector
66
66
67
- gather_profiles " Debug,Opt" " Full" " syn,cargo,serde,ripgrep,regex,clap-rs,hyper-2"
67
+ # Here we're profiling LLVM, so we only care about `Debug` and `Opt`, because we want to stress
68
+ # codegen. We also profile some of the most prolific crates.
69
+ gather_profiles " Debug,Opt" " Full" \
70
+ " syn-1.0.89,cargo-0.60.0,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18"
68
71
69
72
# Merge the profile data we gathered for LLVM
70
73
# Note that this uses the profdata from the clang we used to build LLVM,
@@ -83,8 +86,10 @@ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
83
86
--stage 2 library/std \
84
87
--rust-profile-generate=/tmp/rustc-pgo
85
88
89
+ # Here we're profiling the `rustc` frontend, so we also include `Check`.
90
+ # The benchmark set includes various stress tests that put the frontend under pressure.
86
91
gather_profiles " Check,Debug,Opt" " All" \
87
- " externs,ctfe-stress-4,inflate, cargo,token-stream-stress,match-stress-enum "
92
+ " externs,ctfe-stress-4,cargo-0.60.0 ,token-stream-stress,match-stress,tuple-stress "
88
93
89
94
# Merge the profile data we gathered
90
95
./build/$PGO_HOST /llvm/bin/llvm-profdata \
0 commit comments