Skip to content

MIR move elimination [4/6]: MoveElimination - #163338

Draft
Amanieu wants to merge 4 commits into
rust-lang:mainfrom
Amanieu:move-elimination/move-elimination
Draft

Amanieu wants to merge 4 commits into
rust-lang:mainfrom
Amanieu:move-elimination/move-elimination

Conversation

@Amanieu

@Amanieu Amanieu commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Depends on #163336 and #163337

This PR implements the MoveElimination pass from rust-lang/rfcs#3943.

This pass uses the analysis results from PreciseLiveness to unify locals that are related by an assignment. This also includes an alias-fixup pass which is needed because some rvalues don't allow sources to overlap with the destination place.

The pass is only enabled under -Zmir-move-elimination. This flag also disables DestinationPropagation, which is superseded by the new pass.

r? tmiasko

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 25, 2026
@Amanieu

Amanieu commented Sep 25, 2026 •

Copy link
Copy Markdown
Member Author

LLM disclosure: LLMs were used to generate the boilerplate for the MIR tests, but each test was manually reviewed and adjusted before committing. LLMs were also used to audit this pass against the rest of the compiler MIR transforms and Miri semantics.

@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from cdda80c to 3375722 Compare September 26, 2026 01:05
@Amanieu Amanieu added the llm-assisted An LLM-assisted PR as defined by the LLM policy. Requires ahead-of-time consent by assignee. label Sep 26, 2026
@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from 3375722 to 9530f82 Compare September 30, 2026 12:49
@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from 9530f82 to e61dd0d Compare September 30, 2026 13:03

This branch has not been deployed

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

Labels

llm-assisted An LLM-assisted PR as defined by the LLM policy. Requires ahead-of-time consent by assignee. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants