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

Couple of global state and driver refactors #114803

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Aug 14, 2023

  • Remove some unused global mutable state
  • Remove a couple of unnecessary queries (both driver and TyCtxt queries)
  • Remove an unnecessary use of FxIndexMap

It was only ever set in a function which isn't called anywhere.
All of them are not exported from rustc_interface and used only during
global_ctxt(). Inlining them makes it easier to follow the order of
queries and slightly reduces line count.
Constructing an FxIndexMap is useless work as the iteration order never
matters.
It is only used by CrateLoader. We can store the metadata loader in
CStore instead which CrateLoader has access to.
@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2023

r? @fee1-dead

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

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Aug 14, 2023
compiler/rustc_interface/src/queries.rs Outdated Show resolved Hide resolved
@@ -1455,18 +1454,6 @@ pub(crate) fn make_unclosed_delims_error(
Some(err)
}

pub fn emit_unclosed_delims(unclosed_delims: &mut Vec<UnmatchedDelim>, sess: &ParseSess) {
Copy link
Member

Choose a reason for hiding this comment

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

can we use some check in tidy to find this kind of unused functions?
@jyn514

Copy link
Contributor

@klensy klensy Aug 14, 2023

Choose a reason for hiding this comment

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

Tidy can't, https://github.com/est31/warnalyzer can, in some cases. But save-analysis was removed so it became harder work.

Copy link
Member

@fee1-dead fee1-dead 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 applying suggestion from petrochenkov

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 14, 2023

@bors r=fee1-dead

@bors
Copy link
Contributor

bors commented Aug 14, 2023

📌 Commit 223c43b has been approved by fee1-dead

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 Aug 14, 2023
@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Testing commit 223c43b with merge ffaa32b...

@bors
Copy link
Contributor

bors commented Aug 15, 2023

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing ffaa32b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 15, 2023
@bors bors merged commit ffaa32b into rust-lang:master Aug 15, 2023
12 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 15, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ffaa32b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -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)
- - 0
Regressions ❌
(secondary)
4.2% [3.0%, 5.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-4.7%, -2.1%] 5
All ❌✅ (primary) - - 0

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 633.466s -> 632.706s (-0.12%)
Artifact size: 346.72 MiB -> 346.54 MiB (-0.05%)

@bjorn3 bjorn3 deleted the less_session_mutable_state branch August 15, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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.

None yet

8 participants