X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fci%2Fpgo.sh;h=cbe32920a7458cab76659a2d1de8b92048757fa5;hb=69df0f2c2f665d7f4e38a3579a81d4efc0d81034;hp=28bed1fa0353b3cc1778bee81dcaee1d44fbd0a6;hpb=449ffe0bd57f6af144f3d04d35a1613bf7760534;p=rust.git diff --git a/src/ci/pgo.sh b/src/ci/pgo.sh index 28bed1fa035..cbe32920a74 100755 --- a/src/ci/pgo.sh +++ b/src/ci/pgo.sh @@ -100,8 +100,8 @@ if isLinux; then cp -r /tmp/rustc-perf $RUSTC_PERF chown -R $(whoami): $RUSTC_PERF else - # rustc-perf version from 2022-05-18 - PERF_COMMIT=f66cc8f3e04392b0e2fd811f21fd1ece6ebaded3 + # rustc-perf version from 2022-07-22 + PERF_COMMIT=3c253134664fdcba862c539d37f0de18557a9a4c retry curl -LS -o $PGO_TMP/perf.zip \ https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \ cd $PGO_TMP && unzip -q perf.zip && \ @@ -190,8 +190,41 @@ rm -r $RUSTC_PROFILE_DIRECTORY_ROOT # directories ourselves. rm -r $BUILD_ARTIFACTS/llvm $BUILD_ARTIFACTS/lld -# This produces the actual final set of artifacts, using both the LLVM and rustc -# collected profiling data. -$@ \ - --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \ - --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} +if isLinux; then + # Gather BOLT profile (BOLT is currently only available on Linux) + python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \ + --stage 2 library/std \ + --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} \ + --llvm-bolt-profile-generate + + BOLT_PROFILE_MERGED_FILE=/tmp/bolt.profdata + + # Here we're profiling Bolt. + gather_profiles "Check,Debug,Opt" "Full" \ + "syn-1.0.89,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18" + + merge-fdata /tmp/prof.fdata* > ${BOLT_PROFILE_MERGED_FILE} + + echo "BOLT statistics" + du -sh /tmp/prof.fdata* + du -sh ${BOLT_PROFILE_MERGED_FILE} + echo "Profile file count" + find /tmp/prof.fdata* -type f | wc -l + + rm -r $BUILD_ARTIFACTS/llvm $BUILD_ARTIFACTS/lld + + # This produces the actual final set of artifacts, using both the LLVM and rustc + # collected profiling data. + $@ \ + --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \ + --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} \ + --llvm-bolt-profile-use=${BOLT_PROFILE_MERGED_FILE} +else + $@ \ + --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \ + --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} +fi + +echo "Rustc binary size" +ls -la ./build/$PGO_HOST/stage2/bin +ls -la ./build/$PGO_HOST/stage2/lib