-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rewrite UnDerefer
#112882
Rewrite UnDerefer
#112882
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonderful! thank you
r=me with a nit
@bors delegate+ |
✌️ @drmeepster, you can now approve this pull request! If @oli-obk told you to " |
📌 Commit 09c28605f49dc9d20d20c4547e70f931549ce4e3 has been approved by It is now in the queue for this repository. |
⌛ Testing commit 09c28605f49dc9d20d20c4547e70f931549ce4e3 with merge b35d486cc8f86ce64285e26e84efab0792b9994c... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
looks like there's an infinite recursion somewhere when building Probably not an infinite recursion, just a stack overflow, so you can use |
☔ The latest upstream changes (presumably #112693) made this pull request unmergeable. Please resolve the merge conflicts. |
I've seen the sefault elsewhere on MIPS, too, so it's not this PRs fault. r=me after a rebase |
09c2860
to
b4bd2ae
Compare
@bors r=oli-obk |
📌 Commit b4bd2ae8237937ec102622c6fc370c6b9b4a0ed0 has been approved by It is now in the queue for this repository. |
This comment has been minimized.
This comment has been minimized.
@bors r- needs rustfmt |
@bors retry apple builder timeout |
⌛ Testing commit 4fbd6d5 with merge 274c66334bf54efc3ac3839fc270c447b5890ade... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry the mips failure again |
@bors p=4 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d5a7424): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.216s -> 669.334s (0.32%) |
This looks like a genuine perf regression. @drmeepster, was this expected? Could it be avoided or reduced? |
@nnethercote I think one cause is unnecessary allocations. I've opened #113316, which should improve the situation by allocating each deref chain once and storing it, instead of remaking it from the derefer sidetable every time its needed. |
Rewrite `UnDerefer`, again This PR is intended to improve the perf regression introduced by rust-lang#112882. `UnDerefer` has been separated out again for borrowck reasons. It was a bit overzealous to remove it in the previous PR. r? `@oli-obk`
Currently,
UnDerefer
is used by drop elaboration to undo the effects of theDerefer
pass. However, it just recreates the original places with derefs in the middle of the projection. BecauseProjectionElem::Deref
is intended to be removed completely in the future, this will not work forever.This PR introduces a
deref_chain
method that returns the places behindDerefTemp
locals in a place and rewrites the move path code to use this. In the process,UnDerefer
was merged intoMovePathLookup
. Now that move paths use the same places as in the MIR, the other uses ofUnDerefer
no longer require it.See #98145
cc @ouz-a
r? @oli-obk