Skip to content

Remove the dummy PreCodegen mir-opt pass, and use runtime-optimized instead - #156524

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Zalathar:no-pre-codegen
May 13, 2026
Merged

Remove the dummy PreCodegen mir-opt pass, and use runtime-optimized instead#156524
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Zalathar:no-pre-codegen

Conversation

@Zalathar

Copy link
Copy Markdown
Member

The PreCodegen pass doesn't do anything on its own; it was only serving as a marker to allow -Zdump-mir and mir-opt tests to easily dump the final MIR just before codegen.

However, #156358 (comment) pointed out that the runtime-optimized phase transition should dump the same MIR, so there shouldn't be any need for a separate PreCodegen pass.


r? oli-obk (or compiler)

This function doesn't have an obvious home, but there's little reason for it to
be in mir-transform, and having it in `rustc_driver_impl::pretty` at least puts
it near other callers of `write_mir_pretty`.
@rustbot

Copy link
Copy Markdown
Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 13, 2026
@rust-log-analyzer

This comment has been minimized.

MIR dumped before/after the dummy `PreCodegen` pass should be identical to MIR
dumped after the phase transition to `runtime-optimized`.
This dummy pass is not needed, because the `runtime-optimized` phase transition
can be used to dump the final pre-codegen MIR.

@oli-obkoli-obk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zalathar

Copy link
Copy Markdown
MemberAuthor

PR CI is green.

@bors r=oli-obk

@rust-bors

rust-borsBot commented May 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 281ccf8 has been approved by oli-obk

It is now in the queue for this repository.

@rust-borsrust-borsBot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2026
rust-borsBot pushed a commit that referenced this pull request May 13, 2026
…uwer
Rollup of 5 pull requests
Successful merges:
- #156472 (Add support for Zprint-codegen-stats-json)
- #156504 (bootstrap: remap windows-style OUT_DIR paths)
- #156513 (miri subtree update)
- #156524 (Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead)
- #156325 (Don't treat const param default as projection)
rust-borsBot pushed a commit that referenced this pull request May 13, 2026
…uwer
Rollup of 5 pull requests
Successful merges:
- #156472 (Add support for Zprint-codegen-stats-json)
- #156504 (bootstrap: remap windows-style OUT_DIR paths)
- #156513 (miri subtree update)
- #156524 (Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead)
- #156325 (Don't treat const param default as projection)
@rust-bors
rust-borsBot merged commit c978cbe into rust-lang:mainMay 13, 2026
11 checks passed
@rustbotrustbot added this to the 1.97.0 milestone May 13, 2026
@Zalathar
Zalathar deleted the no-pre-codegen branch May 13, 2026 14:05
pullBot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request May 17, 2026
…uwer
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#156472 (Add support for Zprint-codegen-stats-json)
- rust-lang/rust#156504 (bootstrap: remap windows-style OUT_DIR paths)
- rust-lang/rust#156513 (miri subtree update)
- rust-lang/rust#156524 (Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead)
- rust-lang/rust#156325 (Don't treat const param default as projection)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Zalathar@rustbot@rust-log-analyzer@oli-obk