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

Shorten rustc_middle::ty::mod #82964

Merged
merged 7 commits into from
Mar 11, 2021
Merged

Conversation

Nicholas-Baron
Copy link
Contributor

Related to #60302.

This PR moves all Adt*, Assoc*, Generic*, and UpVar* types to separate files.
This, alongside some use reordering, puts mod.rs at ~2,200 lines, thus removing the // ignore-tidy-filelength.

The particular groups were chosen as they had 4 or more "substantive" members.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Mar 10, 2021
@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 10, 2021
@petrochenkov
Copy link
Contributor

Not sure who maintains this code now.
r? @jackh726 @nikomatsakis

@cjgillot
Copy link
Contributor

What is the status of the work to move the type definitions to rustc_type_ir?

@jackh726
Copy link
Member

What is the status of the work to move the type definitions to rustc_type_ir?

Somewhat blocked on figuring out the Encodable/Decodable situation. @detrumi and @zaharidichev have been doing here

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

I big 👍 on me for the PR in general. For upvar.rs, I would like that to either be reverted or to add some other closure capture related things and changed to closure_capture or something like that :)

compiler/rustc_middle/src/ty/upvar.rs Outdated Show resolved Hide resolved
Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

This looks better. I think anything related directly to closure captures can go in closure.rs

compiler/rustc_middle/src/ty/mod.rs Outdated Show resolved Hide resolved
@jackh726
Copy link
Member

Looks good to me! r=me when CI is green

@Nicholas-Baron
Copy link
Contributor Author

Looks good to me! r=me when CI is green

So when the CI returns all good, I write r=jackh726 to bors?

@jackh726
Copy link
Member

@bors delegate+

Yes :)

@bors
Copy link
Contributor

bors commented Mar 10, 2021

✌️ @Nicholas-Baron can now approve this pull request

@jackh726
Copy link
Member

Let's also @bors rollup=iffy to this

@Nicholas-Baron
Copy link
Contributor Author

@bors: r=jackh726

@bors
Copy link
Contributor

bors commented Mar 10, 2021

📌 Commit d022142 has been approved by jackh726

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2021
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 10, 2021
@Nicholas-Baron
Copy link
Contributor Author

@bors: rollup=iffy

@Nicholas-Baron
Copy link
Contributor Author

I hope I did not mess up anything.

@jackh726
Copy link
Member

@Nicholas-Baron should be fine :) CI should finish before bors can get to this. I'll keep in eye on it.

@bors
Copy link
Contributor

bors commented Mar 11, 2021

⌛ Testing commit d022142 with merge b3ac526...

@bors
Copy link
Contributor

bors commented Mar 11, 2021

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing b3ac526 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 11, 2021
@bors bors merged commit b3ac526 into rust-lang:master Mar 11, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 11, 2021
@Nicholas-Baron Nicholas-Baron deleted the shorten_middle_ty branch March 11, 2021 07:31
@Mark-Simulacrum
Copy link
Member

This seems to have been a pretty big (~30%) regression on diesel-doc builds, presumably due to inlining changes - self-profile data in particular points at the evaluate_obligation query. It's possible we can just leave this, but might be good to add a couple inline attributes which should resolve the regression.

@Nicholas-Baron Nicholas-Baron restored the shorten_middle_ty branch March 17, 2021 01:33
@Nicholas-Baron
Copy link
Contributor Author

This seems to have been a pretty big (~30%) regression on diesel-doc builds, presumably due to inlining changes - self-profile data in particular points at the evaluate_obligation query. It's possible we can just leave this, but might be good to add a couple inline attributes which should resolve the regression.

Are there any particular functions which would benefit from inlining?

@Mark-Simulacrum
Copy link
Member

It's hard to say without more investigation; probably a cachegrind or similar tooling might give a hint. I unfortunately don't have time to write up some directions, but a start would be to:

  • checkout the rust compiler tree at the before & after commits around this PR's merge and build locally to get debuginfo
  • run cachegrind on each with the diesel doc benchmark (either via the perf collector, some docs here, or more directly)
  • look to see if any small functions stopped getting inlined

@Nicholas-Baron
Copy link
Contributor Author

@Mark-Simulacrum I tried to use the rustc-perf/collector locally. However, linking LLVM with release-debuginfo = true leads to OOM for my 16 GB dev machine. I never got to building even stage0.

@Mark-Simulacrum
Copy link
Member

Oh, you almost certainly only need debug info for the compiler, not llvm

@Nicholas-Baron Nicholas-Baron deleted the shorten_middle_ty branch March 24, 2021 00:04
@Nicholas-Baron
Copy link
Contributor Author

@Mark-Simulacrum I have run into an issue which I have filed here. It looks like I am roadblocked for the current moment.

@Nicholas-Baron
Copy link
Contributor Author

@Mark-Simulacrum I guess I am leaving this alone. There are probably larger performance gains to be had elsewhere in the compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. 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.

9 participants