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

Various cleanups around pre-TyCtxt queries and functions #106810

Merged
merged 9 commits into from
Jan 19, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 13, 2023

part of #105462

based on #106776 (everything starting at 0e2b39f is new in this PR)

r? @petrochenkov

I think this should be most of the uncontroversial part of #105462.

@rustbot
Copy link
Collaborator

rustbot commented Jan 13, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

Please see the contribution instructions for more information.

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 13, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 13, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

The Miri subtree was changed

cc @rust-lang/miri

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 13, 2023

@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 Jan 13, 2023
@bors
Copy link
Contributor

bors commented Jan 13, 2023

⌛ Trying commit 16f07aee4acdca6063d0a6a0e32e96e1ccffe427 with merge dc88ba6552d55a6b2fa3a3ea6fbad64e10e134e5...

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2023
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 13, 2023

@rust-timer build dc88ba6552d55a6b2fa3a3ea6fbad64e10e134e5

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dc88ba6552d55a6b2fa3a3ea6fbad64e10e134e5): comparison URL.

Overall result: ❌✅ regressions and improvements - 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 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.3% [0.3%, 0.4%] 2
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 2

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
Regressions ❌
(secondary)
3.3% [2.4%, 4.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-3.1%, -1.6%] 4
All ❌✅ (primary) - - 0

Cycles

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 13, 2023
@petrochenkov
Copy link
Contributor

Perf is ok, rebase is needed.
@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 13, 2023
@bors

This comment was marked as resolved.

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 16, 2023

@rustbot review

@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 Jan 16, 2023
compiler/rustc_driver/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_session/src/config.rs Outdated Show resolved Hide resolved
compiler/rustc_driver/src/pretty.rs Outdated Show resolved Hide resolved
compiler/rustc_driver/src/pretty.rs Outdated Show resolved Hide resolved
compiler/rustc_session/src/session.rs Outdated Show resolved Hide resolved
compiler/rustc_session/src/session.rs Show resolved Hide resolved
compiler/rustc_driver/src/lib.rs Show resolved Hide resolved
@petrochenkov petrochenkov 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 Jan 16, 2023
@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 Jan 18, 2023
@SmiteWindows
Copy link

@petrochenkov bors ?

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 18, 2023

@bors retry

@compiler-errors
Copy link
Member

Bors keeps getting stuck on this PR. Opened a topic on zulip: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Bors.20gets.20stuck.20on.20.23106810

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 18, 2023
@Mark-Simulacrum
Copy link
Member

@bors r=petrochenkov

Let's see if this helps. Previously PR CI wasn't running either so I wonder if some internal GitHub state was confused.

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 1355559 has been approved by petrochenkov

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 Jan 18, 2023
@bors
Copy link
Contributor

bors commented Jan 19, 2023

⌛ Testing commit 1355559 with merge 65d2f2a...

@bors
Copy link
Contributor

bors commented Jan 19, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 65d2f2a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 19, 2023
@bors bors merged commit 65d2f2a into rust-lang:master Jan 19, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 19, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (65d2f2a): comparison URL.

Overall result: ✅ 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.4% [-1.4%, -1.4%] 1
All ❌✅ (primary) - - 0

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.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
3.6% [2.7%, 4.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.1%, -3.0%] 2
All ❌✅ (primary) 2.8% [2.8%, 2.8%] 1

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)
1.8% [1.7%, 1.8%] 2
Regressions ❌
(secondary)
1.7% [1.5%, 2.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [1.7%, 1.8%] 2

@oli-obk oli-obk deleted the resolver_reverse_plumbing branch January 19, 2023 09:27
smoelius added a commit to trailofbits/dylint that referenced this pull request Jan 22, 2023
smoelius added a commit to trailofbits/dylint that referenced this pull request Jan 22, 2023
smoelius added a commit to trailofbits/dylint that referenced this pull request Jan 23, 2023
Also, revert the following commits:

- cc8b57a
- 7e9057f
smoelius added a commit to trailofbits/dylint that referenced this pull request Jan 24, 2023
Also, revert the following commits:

- cc8b57a
- 7e9057f
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Jan 24, 2023
…=petrochenkov

Various cleanups around pre-TyCtxt queries and functions

part of rust-lang#105462

based on rust-lang#106776 (everything starting at [0e2b39f](rust-lang@0e2b39f) is new in this PR)

r? `@petrochenkov`

I think this should be most of the uncontroversial part of rust-lang#105462.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2023
…rochenkov

give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang#105423
* rust-lang#105357
* rust-lang#105603
* rust-lang#106776
* rust-lang#106810
* rust-lang#106812
* rust-lang#108032
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang/rust#105423
* rust-lang/rust#105357
* rust-lang/rust#105603
* rust-lang/rust#106776
* rust-lang/rust#106810
* rust-lang/rust#106812
* rust-lang/rust#108032
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang/rust#105423
* rust-lang/rust#105357
* rust-lang/rust#105603
* rust-lang/rust#106776
* rust-lang/rust#106810
* rust-lang/rust#106812
* rust-lang/rust#108032
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. T-rustdoc Relevant to the rustdoc 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