Stop emitting drop loops for every array length#134297
Stop emitting drop loops for every array length#134297scottmcm wants to merge 2 commits intorust-lang:masterfrom
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
PtrMetadatainstead ofLenfor 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