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

try and simplify some things in the query system #100436

Merged
merged 4 commits into from
Aug 25, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 12, 2022

No description provided.

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 12, 2022
@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Aug 12, 2022
@jyn514 jyn514 removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 12, 2022
@jyn514
Copy link
Member Author

jyn514 commented Aug 12, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 12, 2022
@bors
Copy link
Contributor

bors commented Aug 12, 2022

⌛ Trying commit 09a56fd69bee9590d20526a447b8879c68a1b42e with merge b4e3257899c45300440fd556ce4d3bf0517ee057...

@bors
Copy link
Contributor

bors commented Aug 12, 2022

☀️ Try build successful - checks-actions
Build commit: b4e3257899c45300440fd556ce4d3bf0517ee057 (b4e3257899c45300440fd556ce4d3bf0517ee057)

@rust-timer
Copy link
Collaborator

Queued b4e3257899c45300440fd556ce4d3bf0517ee057 with parent b998821, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b4e3257899c45300440fd556ce4d3bf0517ee057): comparison url.

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: ✅ relevant improvement found
mean1 max count2
Regressions ❌
(primary)
2.5% 2.5% 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% -4.1% 1
Improvements ✅
(secondary)
-3.6% -3.6% 1
All ❌✅ (primary) -0.8% -4.1% 2

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf -perf-regression

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 12, 2022
@@ -143,7 +143,7 @@ impl DepKind {
}

macro_rules! define_dep_nodes {
(<$tcx:tt>
(//<$tcx:tt>
Copy link
Member

@bjorn3 bjorn3 Aug 12, 2022

Choose a reason for hiding this comment

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

Comment should be removed

@@ -179,7 +179,7 @@ macro_rules! define_dep_nodes {
);
}

rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
rustc_dep_node_append!([define_dep_nodes!][ //<'tcx>
Copy link
Member

Choose a reason for hiding this comment

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

Same

@@ -306,7 +306,7 @@ pub fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) {
let mut string_cache = QueryKeyStringCache::new();

macro_rules! alloc_once {
(<$tcx:tt>
(//<$tcx:tt>
Copy link
Member

Choose a reason for hiding this comment

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

Same

@cjgillot cjgillot self-assigned this Aug 12, 2022
Copy link
Contributor

@cjgillot cjgillot 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 with one nit and commented out code removed.
Marking as part of #96524 because of the change on make_query module.

opt_remap_env_constness!([$($modifiers)*][key]);
let kind = dep_graph::DepKind::$name;
let name = stringify!($name);
fn create_query_frame<'tcx, K: Copy + Key + for<'a> HashStable<StableHashingContext<'a>>>(tcx: QueryCtxt<'tcx>, do_describe: fn(QueryCtxt<'tcx>, K) -> String, key: K, kind: DepKind, name: &'static str) -> QueryStackFrame {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this outside the macro?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, done :) had to rearrange a bunch of imports because define_queries is expanded in the crate root; always confuses me that those are different. I'll see if I can make that the same in a follow-up PR actually.

@lcnr
Copy link
Contributor

lcnr commented Aug 14, 2022

r? @cjgillot

@cjgillot cjgillot 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 Aug 18, 2022
It's not actually necessary and it makes the code harder to read.
Rustdoc documents these with the name of the type alias instead of normalizing them to the underlying type.
Use associated types instead so that the generated docs for nightly-rustc are easier to read.
@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2022

@bors r=cjgillot rollup=never (very perf-sensitive)

@bors
Copy link
Contributor

bors commented Aug 24, 2022

📌 Commit c6c5bf7cf262d7e86f75ba312ba0e5efe01eeb77 has been approved by cjgillot

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 Aug 24, 2022
@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2022

@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 Aug 24, 2022
This should both make the code easier to read and also greatly reduce the amount of codegen
the compiler has to do, since it only needs to monomorphize `create_query_frame` for each
new key and not for each query.
@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2022

@bors r=cjgillot rollup=never (very perf-sensitive)

@bors
Copy link
Contributor

bors commented Aug 24, 2022

📌 Commit e188868 has been approved by cjgillot

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 Aug 24, 2022
@bors
Copy link
Contributor

bors commented Aug 25, 2022

⌛ Testing commit e188868 with merge 76531be...

@bors
Copy link
Contributor

bors commented Aug 25, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 76531be to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 25, 2022
@bors bors merged commit 76531be into rust-lang:master Aug 25, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 25, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76531be): 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.3%] 2
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.

mean1 range count2
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.1% [-5.1%, -5.1%] 1
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) -1.3% [-5.1%, 2.5%] 2

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-4.0%, -2.0%] 2
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@jyn514 jyn514 deleted the macro-query-system branch August 25, 2022 14:27
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2022
Simplify the arguments to macros generated by the `rustc_queries` proc macro

Very small cleanup. Based on rust-lang#100436 which modifies some of the same code.

r? `@cjgillot`
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
None yet
Development

Successfully merging this pull request may close these issues.

8 participants