From 49efa23d70c12c9a670b262a1fb717a12cea7489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 6 Apr 2022 09:26:48 +0200 Subject: [PATCH] Update rustc-perf version used in CI and also the corresponding PGO benchmarks --- .../host-x86_64/dist-x86_64-linux/Dockerfile | 3 ++- src/ci/pgo.sh | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index efc83c6ccab1f..5e6716baed6d9 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -98,7 +98,8 @@ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ RUN ./build-clang.sh ENV CC=clang CXX=clang++ -ENV PERF_COMMIT 1e19fc4c6168d2f7596e512f42f358f245d8f09d +# rustc-perf version from 2022-04-05 +ENV PERF_COMMIT 04fccd80396f954b339c366e30221f4bd52c5e03 RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \ unzip perf.zip && \ mv rustc-perf-$PERF_COMMIT rustc-perf && \ diff --git a/src/ci/pgo.sh b/src/ci/pgo.sh index 88a03c05d9fe2..689e6a11d6110 100755 --- a/src/ci/pgo.sh +++ b/src/ci/pgo.sh @@ -3,8 +3,8 @@ set -euxo pipefail # Compile several crates to gather execution PGO profiles. -# Arg0 => builds (Debug, Opt) -# Arg1 => runs (Full, IncrFull, All) +# Arg0 => profiles (Debug, Opt) +# Arg1 => scenarios (Full, IncrFull, All) # Arg2 => crates (syn, cargo, ...) gather_profiles () { cd /checkout/obj @@ -27,10 +27,10 @@ gather_profiles () { profile_local \ eprintln \ /checkout/obj/build/$PGO_HOST/stage2/bin/rustc \ - Test \ - --builds $1 \ + --id Test \ + --profiles $1 \ --cargo /checkout/obj/build/$PGO_HOST/stage0/bin/cargo \ - --runs $2 \ + --scenarios $2 \ --include $3 cd /checkout/obj @@ -64,7 +64,10 @@ RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \ RUSTC_BOOTSTRAP=1 \ /checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector -gather_profiles "Debug,Opt" "Full" "syn,cargo,serde,ripgrep,regex,clap-rs,hyper-2" +# Here we're profiling LLVM, so we only care about `Debug` and `Opt`, because we want to stress +# codegen. We also profile some of the most prolific crates. +gather_profiles "Debug,Opt" "Full" \ +"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" # Merge the profile data we gathered for LLVM # 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 \ --stage 2 library/std \ --rust-profile-generate=/tmp/rustc-pgo +# Here we're profiling the `rustc` frontend, so we also include `Check`. +# The benchmark set includes various stress tests that put the frontend under pressure. gather_profiles "Check,Debug,Opt" "All" \ - "externs,ctfe-stress-4,inflate,cargo,token-stream-stress,match-stress-enum" + "externs,ctfe-stress-4,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress" # Merge the profile data we gathered ./build/$PGO_HOST/llvm/bin/llvm-profdata \