Skip to content

[WIP] Turn MIR copies into moves #46869

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 4 commits into from

Conversation

scottmcm
Copy link
Member

Weakens the last copy of a local into a move, or doesn't assign it if there are no uses.

Intended to give the upcoming NRVO pass more moves to work with. Done in a single pass over the MIR.

Depends on #46852

Outputs in InlineAsm can be read-write, so splitting it out is useful for things like Store-Store folding, as it cannot be done for a Store-AsmOutput.

This PR is intended to make no changes, just be the mechanical split of the enum.  Future changes can use the split, like a MIR pass I'm working on and perhaps two-phase borrows.
…s the def if there is no use.

Gives the upcoming NRVO pass more `move`s to work with.  Done in a single pass over the MIR
@rust-highfive
Copy link
Contributor

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@oli-obk
Copy link
Contributor

oli-obk commented Dec 20, 2017

Some compile fail tests are passing

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 20, 2017
@scottmcm
Copy link
Member Author

Closing as I misunderstood the NRVO plan.

@scottmcm scottmcm closed this Dec 20, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-blocked Status: Blocked on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants