Skip to content

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

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

Amanieu wants to merge 2 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 2 times, most recently from 9530f82 to e61dd0d Compare September 30, 2026 13:03
@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from e61dd0d to bc0d0fa Compare October 8, 2026 23:26
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Oct 8, 2026
@Amanieu
Amanieu marked this pull request as ready for review October 8, 2026 23:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 8, 2026
@rustbot

rustbot commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @vakaras

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 8, 2026
@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from bc0d0fa to 785792f Compare October 9, 2026 11:11
@rustbot

This comment has been minimized.

@Amanieu
Amanieu force-pushed the move-elimination/move-elimination branch from 785792f to 9ce4a67 Compare October 10, 2026 17:58
@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@Amanieu

Amanieu commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

Rebased on top of main which now contains #163337. This PR now only has the commits related to the main MoveElimination pass.

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

A-attributes Area: Attributes (`#[…]`, `#![…]`) llm-assisted An LLM-assisted PR as defined by the LLM policy. Requires ahead-of-time consent by assignee. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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