Skip to content

Commit 03faa8a

Browse files
committed
Gather more profile data for LLVM PGO
1 parent d53e195 commit 03faa8a

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

src/ci/pgo.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ 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+
RUST_LOG=collector=debug \
33+
RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
34+
RUSTC_BOOTSTRAP=1 \
35+
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo run -p collector --bin collector -- \
36+
profile_local \
37+
eprintln \
38+
/checkout/obj/build/$PGO_HOST/stage2/bin/rustc \
39+
Test \
40+
--builds Debug,Opt \
41+
--cargo /checkout/obj/build/$PGO_HOST/stage0/bin/cargo \
42+
--runs All \
43+
--include syn,cargo,serde
44+
45+
cd /checkout/obj
46+
2247
# Merge the profile data we gathered for LLVM
2348
# Note that this uses the profdata from the clang we used to build LLVM,
2449
# which likely has a different version than our in-tree clang.
@@ -42,15 +67,17 @@ RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
4267
RUSTC_BOOTSTRAP=1 ./build/$PGO_HOST/stage2/bin/rustc \
4368
--edition=2021 --crate-type=lib -Copt-level=3 ../library/core/src/lib.rs
4469

45-
cp -r /tmp/rustc-perf ./
46-
chown -R $(whoami): ./rustc-perf
47-
cd rustc-perf
70+
#cp -r /tmp/rustc-perf ./
71+
#chown -R $(whoami): ./rustc-perf
72+
#cd rustc-perf
4873

4974
# Build the collector ahead of time, which is needed to make sure the rustc-fake
5075
# 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
76+
#RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
77+
#RUSTC_BOOTSTRAP=1 \
78+
#/checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector
79+
80+
cd rustc-perf
5481

5582
# benchmark using profile_local with eprintln, which essentially just means
5683
# don't actually benchmark -- just make sure we run rustc a bunch of times.

0 commit comments

Comments
 (0)