Skip to content

Commit ffa5976

Browse files
committed
Gather more profile data for LLVM PGO
1 parent 297273c commit ffa5976

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

src/ci/pgo.sh

+28-10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,34 @@ RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
1919
RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
2020
--edition=2021 --crate-type=lib -Copt-level=3 ../library/core/src/lib.rs
2121

22+
cp -r /tmp/rustc-perf ./
23+
chown -R $(whoami): ./rustc-perf
24+
cd rustc-perf
25+
26+
# Build the collector ahead of time, which is needed to make sure the rustc-fake
27+
# binary used by the collector is present.
28+
RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
29+
RUSTC_BOOTSTRAP=1 \
30+
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector
31+
32+
# Gather LLVM PGO profiles from real-world crates.
33+
# Benchmark using profile_local with eprintln, which essentially just means
34+
# don't actually benchmark -- just make sure we run rustc a bunch of times.
35+
RUST_LOG=collector=debug \
36+
RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
37+
RUSTC_BOOTSTRAP=1 \
38+
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo run -p collector --bin collector -- \
39+
profile_local \
40+
eprintln \
41+
/checkout/obj/build/$PGO_HOST/stage2/bin/rustc \
42+
Test \
43+
--builds Debug,Opt \
44+
--cargo /checkout/obj/build/$PGO_HOST/stage0/bin/cargo \
45+
--runs All \
46+
--include syn,cargo,serde,ripgrep,regex,clap-rs,hyper-2
47+
48+
cd /checkout/obj
49+
2250
# Merge the profile data we gathered for LLVM
2351
# Note that this uses the profdata from the clang we used to build LLVM,
2452
# which likely has a different version than our in-tree clang.
@@ -42,18 +70,8 @@ RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
4270
RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
4371
--edition=2021 --crate-type=lib -Copt-level=3 ../library/core/src/lib.rs
4472

45-
cp -r /tmp/rustc-perf ./
46-
chown -R $(whoami): ./rustc-perf
4773
cd rustc-perf
4874

49-
# Build the collector ahead of time, which is needed to make sure the rustc-fake
50-
# binary used by the collector is present.
51-
RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
52-
RUSTC_BOOTSTRAP=1 \
53-
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector
54-
55-
# benchmark using profile_local with eprintln, which essentially just means
56-
# don't actually benchmark -- just make sure we run rustc a bunch of times.
5775
RUST_LOG=collector=debug \
5876
RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
5977
RUSTC_BOOTSTRAP=1 \

0 commit comments

Comments
 (0)