Skip to content

[WIP] Turn MIR copies into moves - #46869

Closed
scottmcm wants to merge 4 commits into
rust-lang:masterfrom
scottmcm:weaken-last-use
Closed

[WIP] Turn MIR copies into moves#46869
scottmcm wants to merge 4 commits into
rust-lang:masterfrom
scottmcm:weaken-last-use

Conversation

@scottmcm

Copy link
Copy Markdown
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
Copy Markdown
Contributor

r? @michaelwoerister

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

@oli-obk

Copy link
Copy Markdown
Contributor

Some compile fail tests are passing

@kennytmkennytm 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
Copy Markdown
MemberAuthor

Closing as I misunderstood the NRVO plan.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blockedStatus: 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

@scottmcm@rust-highfive@oli-obk@kennytm@michaelwoerister