Utilize PGO for windows x64 rustc dist builds#96978
Conversation
|
@bors try |
|
⌛ Trying commit de0a53ad00db52cc21c031b27202fe312896c25e with merge 36167224f1306544c5a9c050ef151c0e6d81b745... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
@bors try |
|
⌛ Trying commit e006ba81940512f2f255b32594e34197c022d8ea with merge 57b5bac113c6e1100592c1bf7d5a7fc61d74e332... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
@bors try |
|
⌛ Trying commit 588de49ce861165222eb39ce14942ea158bef945 with merge 031d87645f5dacc484cc4590a1aa9abc7409a80e... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
@bors try |
|
⌛ Trying commit 721a71042f995816fad00e609f727c5f710895e1 with merge 083263b570c1aa26f2f148f0e329beb40695f37e... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
@bors try |
|
⌛ Trying commit 532f6e1803caa381874b41893a70142b662ce399 with merge e695e58c53b8f4126b9e0d7cf3f060a9e6fd8fac... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
@bors try |
|
⌛ Trying commit 95a6d33169202e3185e9155474c7afa7a371d1f7 with merge 2e3c4fb4d1c201ad85cf7cad3e5ff0ab57635b53... |
|
☀️ Try build successful - checks-actions |
|
Queued dd20c56717daaca1eabea73bbbea7e374edb9f15 with parent 0f573a0, future comparison URL. |
|
Finished benchmarking commit (dd20c56717daaca1eabea73bbbea7e374edb9f15): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
|
That's reassuring. @rustbot ready |
|
I think this is basically ready to go -- one nit, and I'd appreciate if we could squash away some of the more "intermediate" commits -- ideally we'd probably have these commits, roughly, but if we need a couple more that's OK (mostly want to avoid needing to chase commits too much when running git blame).
r=me with nit fixed and commits squashed. |
The version 14.0.2 we currently use is busted on windows at the very least.
When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in, causing undefined reference errors at link-time. We do that manually, by adding clang's resource library folder to the library search path: - for LLVM itself, by extending the linker args that `rustc_llvm`'s build script uses, to avoid the linker errors when linking `rustc_driver`. - for LLD, by extending cmake's linker flags during the LLD build step.
This extracts the linux-isms into variables, so that the script can be extended to do PGO on windows. These variables will be overriden in a few spots, in windows-specific blocks.
This adds windows-specific behavior into the PGO script, and enables it on CI.
|
I've added the comment about disk space and reworked the commit history as requested, and will wait for PR CI to be green. |
|
let's see how it goes :) @bors r=Mark-Simulacrum rollup=never |
|
Great work @lqd! I think that it would be nice to let people know about this. Maybe a Rust/Rust inside blog post or a reddit post? I can draft up the latter. Edit: created a Reddit post. |
|
☀️ Test successful - checks-actions |
|
Great work @lqd! 🎉🎉 |
|
Finished benchmarking commit (8a33254): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
|
I think ctfe-stress-5 has been noisy recently (possibly #96267 but this time this benchmark feels jumpy at +/- 1.6%) and is probably unrelated. I’ll re-check the CI artifacts with cachegrind to make sure it’s indeed similar to #97841 (comment) and try to find the inverse perf win in another PR, much like happened in this other PR’s try build for example. |
|
@wesleywiser I don't think we've announced linux PGO on the Inside Rust blog when it landed (we did for mw's initial explorations), but I'm happy to draft something if we want one. Relnotes may be the expected, or better, venue ? @Kobzol if you want to do a reddit post, that would be sweet. But if we want an Inside Rust post, I'll ping you on zulip and we can collaborate on that. |
|
I think it would be totally appropriate to write an Inside Rust post on this work if you're up for it 🙂 I'd be happy to review and r+ it! |
This PR adds PGO support for the CI x64 windows dist builds.
These are the results from running the rustc-perf benchmarks:

Thanks to @Kobzol, @michaelwoerister, @wesleywiser, @Mark-Simulacrum for their precious help.