-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop emitting drop loops for every array length #134297
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
…<try> Stop emitting drop loops for every array length We can just unsize the array to a slice and drop that instead, reusing the same slice loop for every array length. As part of this (and how I originally noticed this), use `PtrMetadata` instead of `Len` for the slice length, for another step closer to being able to remove `Rvalue::Len`. Demonstration that yes, every slice length gets its own loop today: <https://rust.godbolt.org/z/5EsPjPWv4>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
We can just unsize the array to a slice and drop that instead, reusing the same loop. As part of this (and how I originally noticed this), use `PtrMetadata` instead of `Len` for the slice length, for another step closer to being able to remove `Rvalue::Len`.
f6cd47a
to
aac57cf
Compare
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
…<try> Stop emitting drop loops for every array length We can just unsize the array to a slice and drop that instead, reusing the same slice loop for every array length. As part of this (and how I originally noticed this), use `PtrMetadata` instead of `Len` for the slice length, for another step closer to being able to remove `Rvalue::Len`. Demonstration that yes, every slice length gets its own loop today: <https://rust.godbolt.org/z/5EsPjPWv4>
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
(These failures within opt-dist running rustc-perf aren't super clear... I'll try to see how to improve that.) |
This comment has been minimized.
This comment has been minimized.
f1c87ea
to
a5f9505
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
I have no idea what's happening here :/ Replaced with #134326 |
@scottmcm The collector failed with
(I've launched a try build with the other PR, to see if these errors reproduce) |
…, r=<try> Use `PtrMetadata` instead of `Len` in slice drop shims I tried to do a bigger change in rust-lang#134297 which didn't work, so here's the part I really wanted: Removing another use of `Len`, in favour of `PtrMetadata`. Reusing the same reviewer from the last one: r? BoxyUwU
Thanks for digging in, @lqd ! I think I'm not monoing enough here, or something :/ |
The good news is this behavior doesn’t seem to reproduce in the #134326 subset 🎉 |
…, r=saethlin Use `PtrMetadata` instead of `Len` in slice drop shims I tried to do a bigger change in rust-lang#134297 which didn't work, so here's the part I really wanted: Removing another use of `Len`, in favour of `PtrMetadata`. Split into two commits where the first just adds a test, so you can look at the second commit to see how the drop shim for an array changes with this PR. Reusing the same reviewer from the last one: r? BoxyUwU
…, r=saethlin Use `PtrMetadata` instead of `Len` in slice drop shims I tried to do a bigger change in rust-lang#134297 which didn't work, so here's the part I really wanted: Removing another use of `Len`, in favour of `PtrMetadata`. Split into two commits where the first just adds a test, so you can look at the second commit to see how the drop shim for an array changes with this PR. Reusing the same reviewer from the last one: r? BoxyUwU
We can just unsize the array to a slice and drop that instead, reusing the same slice loop for every array length.
As part of this (and how I originally noticed this), use
PtrMetadata
instead ofLen
for the slice length, for another step closer to being able to removeRvalue::Len
.Demonstration that yes, every slice length gets its own loop today: https://rust.godbolt.org/z/5EsPjPWv4