-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Validate CopyForDeref and DerefTemps better and remove them from runtime MIR #145513
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
base: master
Are you sure you want to change the base?
Conversation
|
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @vakaras Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to constck cc @fee1-dead Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred to the CTFE machinery |
This comment has been minimized.
This comment has been minimized.
(note that oli is on vacation and will be for quite a while) |
This comment has been minimized.
This comment has been minimized.
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
8151b0e
to
829f66d
Compare
This comment has been minimized.
This comment has been minimized.
829f66d
to
dfd97cd
Compare
This comment has been minimized.
This comment has been minimized.
11f84dd
to
bfc73ec
Compare
r? mir |
It's been long enough since I've looked at a involved MIR change that I'm probably not best suited to this r? mir |
☔ The latest upstream changes (presumably #146666) made this pull request unmergeable. Please resolve the merge conflicts. |
bfc73ec
to
d833c90
Compare
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
d7824f2
to
bfdcede
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
bfdcede
to
3acaac4
Compare
@rustbot ready |
@bors r=saethlin,cjgillot |
…llot Validate CopyForDeref and DerefTemps better and remove them from runtime MIR (split from my WIP #145344) This PR: - Removes `Rvalue::CopyForDeref` and `LocalInfo::DerefTemp` from runtime MIR - Using a new mir pass `EraseDerefTemps` - `CopyForDeref(x)` is turned into `Use(Copy(x))` - `DerefTemp` is turned into `Boring` - Not sure if this part is actually necessary, it made more sense in #145344 with `DerefTemp` storing actual data that I wanted to keep from having to be kept in sync with the rest of the body in runtime MIR - Checks in validation that `CopyForDeref` and `DerefTemp` are only used together - Removes special handling for `CopyForDeref` from many places - Removes `CopyForDeref` from `custom_mir` reverting #111587 - In runtime MIR simple copies can be used instead - In post cleanup analysis MIR it was already wrong to use due to the lack of support for creating `DerefTemp` locals - Possibly this should be its own PR? - Adds an argument to `deref_finder` to avoid creating new `DerefTemp`s and `CopyForDeref` in runtime MIR. - Ideally we would just avoid making intermediate derefs instead of fixing it at the end of a pass / during shim building - Removes some usages of `deref_finder` that I found out don't actually do anything r? oli-obk
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
c85f
9E88
cc5
to
272b076
Compare
some optimization is behaving slightly differently on box derefs after this change, but the difference is irrelevant
it did not create DerefTemp locals when used, so it was never actually correct.
elaborate drops and inline don't seem to actually need it
272b076
to
033474b
Compare
@rustbot ready |
(split from my WIP #145344)
This PR:
Rvalue::CopyForDeref
andLocalInfo::DerefTemp
from runtime MIREraseDerefTemps
CopyForDeref(x)
is turned intoUse(Copy(x))
DerefTemp
is turned intoBoring
DerefTemp
storing actual data that I wanted to keep from having to be kept in sync with the rest of the body in runtime MIRCopyForDeref
andDerefTemp
are only used togetherCopyForDeref
from many placesCopyForDeref
fromcustom_mir
reverting Custom MIR: SupportRvalue::CopyForDeref
#111587DerefTemp
localsderef_finder
to avoid creating newDerefTemp
s andCopyForDeref
in runtime MIR.deref_finder
that I found out don't actually do anythingr? oli-obk