Skip to content

Add a mir pass to simplify temporaries that are immediately moved out of #46440

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

Closed
wants to merge 1 commit into from

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Dec 2, 2017

The HIR->MIR build likes introducing these when you use local variables, and they can be cheaply and safely simplified. The pass only runs when the two lines in the peephole have the same span and the local is a non-user variable, so it can be run even with full debug info requested.

The HIR->MIR build likes introducing these when you use local variables, and they can be cheaply and safely simplified.
@rust-highfive
Copy link
Contributor

r? @eddyb

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

@eddyb
Copy link
Member

eddyb commented Dec 2, 2017

Initial reaction is I'm not sure we want this (as opposed to debuginfo-awareness in more general value/destination propagation).

@scottmcm
Copy link
Member Author

scottmcm commented Dec 2, 2017

Closing after IRC discussion, as eddyb's figured out how to make full NRVO sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants