Skip to content

simplify_cfg: rename some passes so that they make more sense#122656

Merged
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:simplify-cfg
Mar 18, 2024
Merged

simplify_cfg: rename some passes so that they make more sense#122656
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:simplify-cfg

Conversation

@RalfJung

Copy link
Copy Markdown
Member

I was extremely confused by SimplifyCfg::ElaborateDrops, since it runs way later than drop elaboration. It is used e.g. in mir-opt/retag.rs even though that pass doesn't care about drop elaboration at all.

"Early opt" is also very confusing since that makes it sounds like it runs early during optimizations, i.e. on runtime MIR, but actually it runs way before that.

So I decided to rename

  • early-opt -> post-analysis
  • elaborate-drops -> pre-optimizations

I am open to other suggestions.

@rustbot

rustbot commented Mar 17, 2024

Copy link
Copy Markdown
Collaborator

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot 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 Mar 17, 2024
@rustbot

rustbot commented Mar 17, 2024

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@compiler-errors compiler-errors 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.

seems reasonable, thanks for the comments

SimplifyCfg::EarlyOpt => "SimplifyCfg-early-opt",
SimplifyCfg::ElaborateDrops => "SimplifyCfg-elaborate-drops",
SimplifyCfg::PostAnalysis => "SimplifyCfg-post-analysis",
SimplifyCfg::PreOptimization => "SimplifyCfg-pre-optimizations",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, I should make this consistent... "optimization" vs "optimizations"

@RalfJung

Copy link
Copy Markdown
Member Author

@bors r=compiler-errors

@bors

bors commented Mar 17, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 23a4ad1 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors 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 Mar 17, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2024
…errors

simplify_cfg: rename some passes so that they make more sense

I was extremely confused by `SimplifyCfg::ElaborateDrops`, since it runs way later than drop elaboration. It is used e.g. in `mir-opt/retag.rs` even though that pass doesn't care about drop elaboration at all.

"Early opt" is also very confusing since that makes it sounds like it runs early during optimizations, i.e. on runtime MIR, but actually it runs way before that.

So I decided to rename
- early-opt -> post-analysis
- elaborate-drops -> pre-optimizations

I am open to other suggestions.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 17, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#121652 (Detect when move of !Copy value occurs within loop and should likely not be cloned)
 - rust-lang#122639 (Fix typos)
 - rust-lang#122645 (Remove some only- clauses from mir-opt tests)
 - rust-lang#122654 (interpret/memory: explain why we use == on bool)
 - rust-lang#122656 (simplify_cfg: rename some passes so that they make more sense)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#122639 (Fix typos)
 - rust-lang#122654 (interpret/memory: explain why we use == on bool)
 - rust-lang#122656 (simplify_cfg: rename some passes so that they make more sense)
 - rust-lang#122657 (Move `option_env!` and `env!` tests to the `env-macro` directory)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3fc3142 into rust-lang:master Mar 18, 2024
@rustbot rustbot added this to the 1.79.0 milestone Mar 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2024
Rollup merge of rust-lang#122656 - RalfJung:simplify-cfg, r=compiler-errors

simplify_cfg: rename some passes so that they make more sense

I was extremely confused by `SimplifyCfg::ElaborateDrops`, since it runs way later than drop elaboration. It is used e.g. in `mir-opt/retag.rs` even though that pass doesn't care about drop elaboration at all.

"Early opt" is also very confusing since that makes it sounds like it runs early during optimizations, i.e. on runtime MIR, but actually it runs way before that.

So I decided to rename
- early-opt -> post-analysis
- elaborate-drops -> pre-optimizations

I am open to other suggestions.
@RalfJung RalfJung deleted the simplify-cfg branch March 19, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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