-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Avoid a branch on key being local for queries that use the same local and extern providers #85830
Conversation
Some changes occured to rustc_codegen_cranelift cc @bjorn3 |
(rust-highfive has picked a reviewer for you, use r? to override) |
3e94f3b
to
97e68ed
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 97e68edf5733b98351d0e6d43dac872661409cc0 with merge 9de0e79ac427d1d61a6e91b5c8cf50f66526d1f4... |
☀️ Try build successful - checks-actions |
Queued 9de0e79ac427d1d61a6e91b5c8cf50f66526d1f4 with parent 2023cc3, future comparison URL. |
Finished benchmarking try commit (9de0e79ac427d1d61a6e91b5c8cf50f66526d1f4): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
On average this is an improvement, but there is also a non-trivial amount of regressions. Maybe different inlining? Alternatively it could also be because of #85810. I will do a perf run there. |
r? @cjgillot |
97e68ed
to
664b109
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced yet that removing one branch is worth the added complexity. The branch itself should be optimized out.
Can we ensure statically that Key::query_crate
can only return non-LOCAL_CRATE
when separate_provide_extern
is set? Should we even?
@@ -140,11 +140,11 @@ macro_rules! is_eval_always_attr { | |||
} | |||
|
|||
macro_rules! contains_anon_attr { | |||
($($attr:ident $(($($attr_args:tt)*))* ),*) => ({$(is_anon_attr!($attr) | )* false}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can all these macros be simplified now?
@@ -56,7 +56,7 @@ macro_rules! provide { | |||
$compute | |||
})* | |||
|
|||
*providers = Providers { | |||
*providers = ExternProviders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this provide exhaustive now? Should it be made so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to macro implementation issues I am using ()
as type for queries that don't have a separate extern provider.
It has a side effect of for the most part documenting which queries are directly calculated from HIR and whose calculated value may be stored in the crate metadata and which are calculated in the current compilation session from other queries and configuration options. |
☔ The latest upstream changes (presumably #85154) made this pull request unmergeable. Please resolve the merge conflicts. |
@rustbot label: -S-waiting-on-review +S-waiting-on-author |
triage: |
…-obk Fix bug with query modifier parsing The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided. Extracted from other work, and somewhat duplicates 0358edeb5 from rust-lang#85830, but this approach seems a little simpler to me. Not technically currently necessary but seems like a good cleanup.
…-obk Fix bug with query modifier parsing The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided. Extracted from other work, and somewhat duplicates 0358edeb5 from rust-lang#85830, but this approach seems a little simpler to me. Not technically currently necessary but seems like a good cleanup.
…-obk Fix bug with query modifier parsing The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided. Extracted from other work, and somewhat duplicates 0358edeb5 from rust-lang#85830, but this approach seems a little simpler to me. Not technically currently necessary but seems like a good cleanup.
…-obk Fix bug with query modifier parsing The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided. Extracted from other work, and somewhat duplicates 0358edeb5 from rust-lang#85830, but this approach seems a little simpler to me. Not technically currently necessary but seems like a good cleanup.
triage: What's the status of this PR? |
Ping from triage: |
… and extern providers
32e1948
to
f5c3e83
Compare
Rebased. This is waiting on a decision if it should be merged in the first place. |
This comment has been minimized.
This comment has been minimized.
After consideration, I think this PR is an opportunity for an eventual project to integrate metadata and queries. |
📌 Commit 13abc1a has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@17e13b5. Direct link to PR: <rust-lang/rust#85830> 💔 miri on windows: test-pass → build-fail (cc @RalfJung @eddyb @oli-obk). 💔 miri on linux: test-pass → build-fail (cc @RalfJung @eddyb @oli-obk).
Finished benchmarking commit (17e13b5): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
rustup Rustup for rust-lang/rust#85830
Currently based on #85810 as it slightly conflicts with it. Only the last two commits are new.