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

rustc: Flag metadata compatible with multiple CGUs #60270

Merged
merged 1 commit into from
Apr 28, 2019

Conversation

alexcrichton
Copy link
Member

It looks like the OutputType::Metadata kind in the compiler was
misclassified in #38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if --emit metadata
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!

It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in rust-lang#38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2019
@alexcrichton
Copy link
Member Author

Note that I haven't written a test here because I can't think of a great way to test this, but if others have suggestions I'm all for adding a test! This was added as a precursor to rust-lang/cargo#6864 where it was discovered that there were funny compiler performance characteristics in the initial testing.

@oli-obk
Copy link
Contributor

oli-obk commented Apr 28, 2019

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 28, 2019

📌 Commit 955f283 has been approved by oli-obk

@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 Apr 28, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 28, 2019
…oli-obk

rustc: Flag metadata compatible with multiple CGUs

It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in rust-lang#38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!
bors added a commit that referenced this pull request Apr 28, 2019
Rollup of 4 pull requests

Successful merges:

 - #60022 (Document `Item` type in `std::env::SplitPaths` iterator.)
 - #60270 (rustc: Flag metadata compatible with multiple CGUs)
 - #60325 (Document ast::ExprKind::Type)
 - #60347 (Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref`)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Apr 28, 2019

⌛ Testing commit 955f283 with merge 012c300...

@bors bors merged commit 955f283 into rust-lang:master Apr 28, 2019
@alexcrichton alexcrichton deleted the metadata-multi-cgu branch July 8, 2019 20:34
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants