Uh oh!
There was an error while loading. Please reload this page.
Avoid memcpy in codegen for more types, notably Vec - #112733
Conversation
rustbot
commented
Jun 17, 2023
(rustbot has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
scottmcm
commented
Jun 17, 2023
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jun 17, 2023
⌛ Trying commit 58626f974068c9ec1a1da4fb7394548161e4530e with merge f9b06385bce9d1c2230e818597f5acf291b9b478... |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jun 18, 2023
💔 Test failed - checks-actions |
petrochenkov
commented
Jun 18, 2023
bors
commented
Jul 9, 2023
☔ The latest upstream changes (presumably #113508) made this pull request unmergeable. Please resolve the merge conflicts. |
the8472
commented
Jul 19, 2023
happens during Bolt profile gathering. This probably isn't a miscompilation (at least in vanilla rustc) because it rebuilds the std library several times and only fails the Nth time when doing the profiling. So I guess either the bolt instrumentation is buggy or it somehow really ends up generating a lot more data. Maybe @Kobzol encountered an issue like this before. |
We have indeed seen this while building rustc with 1 CGU, and it's a blocking issue for that work to land. This is llvm/llvm-project#59174, and that arbitrarily low limit has been increased upstream already, in https://reviews.llvm.org/D151891. I think this now needs to appear in an LLVM release, and that we update the linux host toolchain to that version. |
Kobzol
commented
Jul 19, 2023
It might be a while until that happens though (weeks/months possibly), until LLVM 17 is released (+ we might have to resolve some big regressions that we have seen with it). I'll send a PR to temporarily use LLVM 16 + my patch so that this is hotfixed sooner. |
scottmcm
commented
Jul 29, 2023
Yay, thanks to #114148 I got to go through and remove some of my codegen FIXMEs here. |
This comment has been minimized.
This comment has been minimized.
scottmcm
commented
Aug 8, 2023
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
bors
commented
Aug 8, 2023
⌛ Trying commit 3152d29fcc86fbd5333e8e978186defd4c35d148 with merge f0bf755c1d27d7c79bbde07734abab3def1d4384... |
bors
commented
Aug 8, 2023
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Aug 8, 2023
Finished benchmarking commit (f0bf755c1d27d7c79bbde07734abab3def1d4384): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 632.482s -> 635.485s (0.47%) |
PR 111999 set up the framework to be able to do this; this PR expands it to more types than just arrays. Most interestingly, this allows it to work with `Vec<T>` and `String`, so swapping those no longer ends up going through stack like it does today (<https://rust.godbolt.org/z/cKG7o8aaW>). And since this is done in codegen, it's not special for `swap`, and thus will hopefully allow types like this to better optimize in lots of places, with easier SRoA.
bors
commented
Aug 26, 2023
☔ The latest upstream changes (presumably #115236) made this pull request unmergeable. Please resolve the merge conflicts. |
Dylan-DPC
commented
Nov 2, 2023
@scottmcm any updates on this? |
scottmcm
commented
May 4, 2024
Given #123185, I no longer think this is a good idea. Things like https://github.com/rust-lang/rust/blob/master/tests/assembly/x86_64-typed-swap.rs have been added since I was working on this that better check for what's important here. |
PR #111999 set up the framework to be able to do this; this PR expands it to more types than just arrays.
Most interestingly, this allows it to work with
Vec<T>andString, so swapping those no longer ends up going through stack like it does today (https://rust.godbolt.org/z/cKG7o8aaW).And since this is done in codegen, it's not special for
swap, and thus will hopefully allow types like this to better optimize in lots of places, with easier SRoA.Draft initially, since it needs perf and I'm sure I got some of the non-opaque pointer tests wrong.