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

resolve: Eagerly feed closure visibilities #119136

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Dec 19, 2023

Also factor out all tcx-dependent operations performed for every created definition into TyCtxt::create_def.

Addresses #118657 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Dec 19, 2023

r? @WaffleLapkin

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

@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 Dec 19, 2023
@petrochenkov
Copy link
Contributor 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 Dec 19, 2023
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2023
@bors
Copy link
Contributor

bors commented Dec 19, 2023

⌛ Trying commit 48e311f with merge 5b028d4...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 19, 2023
@bors
Copy link
Contributor

bors commented Dec 19, 2023

☀️ Try build successful - checks-actions
Build commit: 5b028d4 (5b028d47cc3830b38690a943660a2912e4529c6d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5b028d4): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.5% [-4.3%, -2.7%] 2
Improvements ✅
(secondary)
-2.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) -1.6% [-4.3%, 2.2%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 673.86s -> 672.275s (-0.24%)
Artifact size: 312.43 MiB -> 312.42 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 20, 2023
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 20, 2023
Also factor out all tcx-dependent operations performed for every created definition into `TyCtxt::create_def`
@petrochenkov
Copy link
Contributor Author

@rustbot ready
@bors rollup=maybe

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 20, 2023
Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

r=me after nits


let feed = TyCtxtFeed { tcx: self.tcx, key };
feed.def_kind(def_kind);
let feed = self.tcx.feed_local_def_id(def_id);
feed.def_span(self.span);
Copy link
Member

Choose a reason for hiding this comment

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

Why is this span not simply passed to create_def?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This span is not available in resolver right now, it will be passed when the FIXME (#119136 (comment)) is addressed.

@@ -1225,10 +1225,7 @@ impl<'tcx> Resolver<'_, 'tcx> {
);

// FIXME: remove `def_span` body, pass in the right spans here and call `tcx.at().create_def()`
Copy link
Member

Choose a reason for hiding this comment

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

Is this fixme up to date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, #118633 is trying to address it, but there are some complications.

@WaffleLapkin WaffleLapkin added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2023
@petrochenkov
Copy link
Contributor Author

@bors r=WaffleLapkin

@bors
Copy link
Contributor

bors commented Dec 20, 2023

📌 Commit 5e5d82e has been approved by WaffleLapkin

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 20, 2023
@bors
Copy link
Contributor

bors commented Dec 20, 2023

⌛ Testing commit 5e5d82e with merge 8fca829...

@bors
Copy link
Contributor

bors commented Dec 20, 2023

☀️ Test successful - checks-actions
Approved by: WaffleLapkin
Pushing 8fca829 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 20, 2023
@bors bors merged commit 8fca829 into rust-lang:master Dec 20, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 20, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8fca829): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.2%] 3
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.6%, 0.8%] 2
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 1
Improvements ✅
(primary)
-1.8% [-1.8%, -1.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.8%, 0.8%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.5% [0.6%, 4.5%] 2
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [0.6%, 4.5%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 673.565s -> 674.047s (0.07%)
Artifact size: 312.83 MiB -> 312.81 MiB (-0.01%)

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 14, 2024
…=WaffleLapkin

Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`

oversight from rust-lang#119136

Not actually an issue, because all uses of `tcx.create_def` were in the resolver, which is `eval_always`, but still good to harden against future uses of `create_def`

cc `@petrochenkov` `@WaffleLapkin`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2024
Rollup merge of rust-lang#121084 - oli-obk:create_def_forever_red2, r=WaffleLapkin

Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`

oversight from rust-lang#119136

Not actually an issue, because all uses of `tcx.create_def` were in the resolver, which is `eval_always`, but still good to harden against future uses of `create_def`

cc `@petrochenkov` `@WaffleLapkin`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 15, 2024
…=WaffleLapkin

Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`

oversight from rust-lang#119136

Not actually an issue, because all uses of `tcx.create_def` were in the resolver, which is `eval_always`, but still good to harden against future uses of `create_def`

cc `@petrochenkov` `@WaffleLapkin`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 15, 2024
Rollup merge of rust-lang#121084 - oli-obk:create_def_forever_red2, r=WaffleLapkin

Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`

oversight from rust-lang#119136

Not actually an issue, because all uses of `tcx.create_def` were in the resolver, which is `eval_always`, but still good to harden against future uses of `create_def`

cc `@petrochenkov` `@WaffleLapkin`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants