Skip to content
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

Remove the deduplicate_blocks pass #136786

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

compiler-errors
Copy link
Member

I don't think this pass does anything. It's a lot of complexity for 🤷 amount of benefit.

r? oli-obk

@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 Feb 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 9, 2025
@compiler-errors
Copy link
Member Author

Oh wait, this is gated behind opt level 4 anyways. So it shouldn't be perf sensitive anyways.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2025
…ks, r=<try>

Remove the deduplicate_blocks pass

I don't think this pass does anything. It's a lot of complexity for 🤷  amount of benefit.

r? oli-obk
@bors
Copy link
Contributor

bors commented Feb 9, 2025

⌛ Trying commit a6dcfe3 with merge 5e9601c...

@saethlin
Copy link
Member

saethlin commented Feb 9, 2025

If this is imposing maintenance burden elsewhere on the compiler it should definitely be deleted.

The pass looks like a reasonable optimization to have, but in practice MIR contains a lot of blocks that contain the same statements but acting on different locals. Storage markers especially make blocks that look similar to the eye ineligible for this pass.

@compiler-errors
Copy link
Member Author

It's not really posing a maintenance burden, it just seems to me like it's both in practice pretty useless and would need to be reworked so much (to properly implement the right "modulo" we want for deduplicating blocks like this) that there's no reason keeping it around.

But if you disagree and are happy with keeping it around, feel free to close this PR.

@saethlin
Copy link
Member

saethlin commented Feb 9, 2025

I don't have any strong feelings. But I wonder if we should reap other passes that are also only enabled at high MIR opt levels.

@compiler-errors
Copy link
Member Author

I was planning on doing that soon, too.

@bors
Copy link
Contributor

bors commented Feb 9, 2025

☀️ Try build successful - checks-actions
Build commit: 5e9601c (5e9601c51701b5a75097689609ce91d13bf80cbd)

@rust-timer

This comment has been minimized.

@rust-timer

This comment was marked as off-topic.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 9, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Feb 11, 2025

This was introduced in #77551 and since then we haven't found a way to figure out whether it's actually useful (which was the T-compiler request before turning it on)

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 11, 2025

📌 Commit a6dcfe3 has been approved by oli-obk

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 Feb 11, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#135285 (it-self → itself, build-system → build system, type-alias → type alias)
 - rust-lang#135677 (Small `rustc_resolve` cleanups)
 - rust-lang#136239 (show supported register classes in error message)
 - rust-lang#136246 (include note on variance and example)
 - rust-lang#136354 (Update docs for impl keyword)
 - rust-lang#136786 (Remove the deduplicate_blocks pass)
 - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen)
 - rust-lang#136847 (Simplify intra-crate qualifiers.)

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

Rollup of 8 pull requests

Successful merges:

 - rust-lang#135285 (it-self → itself, build-system → build system, type-alias → type alias)
 - rust-lang#135677 (Small `rustc_resolve` cleanups)
 - rust-lang#136239 (show supported register classes in error message)
 - rust-lang#136246 (include note on variance and example)
 - rust-lang#136354 (Update docs for impl keyword)
 - rust-lang#136786 (Remove the deduplicate_blocks pass)
 - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen)
 - rust-lang#136847 (Simplify intra-crate qualifiers.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2cb21fb into rust-lang:master Feb 12, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
Rollup merge of rust-lang#136786 - compiler-errors:de-de-duplicate-blocks, r=oli-obk

Remove the deduplicate_blocks pass

I don't think this pass does anything. It's a lot of complexity for 🤷  amount of benefit.

r? oli-obk
@saethlin
Copy link
Member

since then we haven't found a way to figure out whether it's actually useful (which was the T-compiler request before turning it on)

I would think we'd establish that by doing a perf run with it enabled by default. I'm quite surprised none of us thought to do that, but at least I'm pretty confident that (considering the pass basically never finds anything to deduplicate) it would be a no-op.

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.

6 participants