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 -Zcgu-partitioning-strategy. #112053

Merged
merged 3 commits into from
May 31, 2023

Conversation

nnethercote
Copy link
Contributor

This option was introduced three years ago, but it's never been meaningfully used, and default is the only acceptable value.

Also, I think the Partition trait presents an interface that is too closely tied to the existing strategy and would probably be wrong for other strategies. (My rule of thumb is to not make something generic until there are at least two instances of it, to avoid this kind of problem.)

Also, I don't think providing multiple partitioning strategies to the user is a good idea, because the compiler already has enough obscure knobs.

This commit removes the option, along with the Partition trait, and the Partitioner and DefaultPartitioning types. I left the existing code in compiler/rustc_monomorphize/src/partitioning/default.rs, though I could be persuaded that moving it into
compiler/rustc_monomorphize/src/partitioning/mod.rs is better.

r? @wesleywiser

@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 May 29, 2023
@the8472 the8472 changed the title Remove -Zcpu-partitioning-strategy. Remove -Zcgu-partitioning-strategy. May 29, 2023
This option was introduced three years ago, but it's never been
meaningfully used, and `default` is the only acceptable value.

Also, I think the `Partition` trait presents an interface that is too
closely tied to the existing strategy and would probably be wrong for
other strategies. (My rule of thumb is to not make something generic
until there are at least two instances of it, to avoid this kind of
problem.)

Also, I don't think providing multiple partitioning strategies to the
user is a good idea, because the compiler already has enough obscure
knobs.

This commit removes the option, along with the `Partition` trait, and
the `Partitioner` and `DefaultPartitioning` types. I left the existing
code in `compiler/rustc_monomorphize/src/partitioning/default.rs`,
though I could be persuaded that moving it into
`compiler/rustc_monomorphize/src/partitioning/mod.rs` is better.
Within `compiler/rustc_monomorphize/src/partitioning/`, because the
previous commit removed the need for `default.rs` to be a separate file.
Because it's now the only file within
`compiler/rustc_monomorphize/src/partitioning/`.
@nnethercote nnethercote force-pushed the rm-Zcpu-partitioning-strategy branch from 6feef6f to 5ed0149 Compare May 30, 2023 07:49
@nnethercote
Copy link
Contributor Author

nnethercote commented May 30, 2023

I added more commits to merge default.rs into mod.rs and then renamed mod.rs as partitioning.rs. Because I've been trying some follow-up changes to how partitioning works and this made it even clearer to me that the interface between default.rs and mod.rs is overfitted to the existing strategy and not at all representative of partitioning in general. Having all the code in one file will make these follow-ups easier.

Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

Thanks @nnethercote! I added these when I did have a few different implementations of the partitioning heuristic. I didn't bother to upstream any of them as I wasn't able to find any consistently better than the default one. Since nothing has really happened to take advantage of this since then, I agree we should just remove it.

I'm excited to see what improvements you're able to make here!

@wesleywiser
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 30, 2023

📌 Commit 5ed0149 has been approved by wesleywiser

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 May 30, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request May 30, 2023
…trategy, r=wesleywiser

Remove `-Zcgu-partitioning-strategy`.

This option was introduced three years ago, but it's never been meaningfully used, and `default` is the only acceptable value.

Also, I think the `Partition` trait presents an interface that is too closely tied to the existing strategy and would probably be wrong for other strategies. (My rule of thumb is to not make something generic until there are at least two instances of it, to avoid this kind of problem.)

Also, I don't think providing multiple partitioning strategies to the user is a good idea, because the compiler already has enough obscure knobs.

This commit removes the option, along with the `Partition` trait, and the `Partitioner` and `DefaultPartitioning` types. I left the existing code in `compiler/rustc_monomorphize/src/partitioning/default.rs`, though I could be persuaded that moving it into
`compiler/rustc_monomorphize/src/partitioning/mod.rs` is better.

r? `@wesleywiser`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#112031 (Migrate  `item_proc_macro` to Askama)
 - rust-lang#112053 (Remove `-Zcgu-partitioning-strategy`.)
 - rust-lang#112069 (offset_of: don't require type to be `Sized`)
 - rust-lang#112084 (enhancements on  build_helper utilization and rustdoc-gui-test)
 - rust-lang#112096 (Remove array_zip)
 - rust-lang#112108 (Fix re-export of doc hidden item inside private item not displayed)
 - rust-lang#112113 (rustdoc: simplify `clean` by removing `FnRetTy`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7ca941f into rust-lang:master May 31, 2023
@rustbot rustbot added this to the 1.72.0 milestone May 31, 2023
@nnethercote nnethercote deleted the rm-Zcpu-partitioning-strategy branch September 19, 2023 21:03
nnethercote added a commit to nnethercote/rust that referenced this pull request Oct 18, 2023
This became unused in rust-lang#112053, when `-Zcgu-partitioning-strategy` was
removed.
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