-
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
Erase query cache values #109333
Erase query cache values #109333
Conversation
This comment has been minimized.
This comment has been minimized.
aabff07
to
4e25e32
Compare
☔ The latest upstream changes (presumably #109092) made this pull request unmergeable. Please resolve the merge conflicts. |
41cc263
to
8bb1455
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 8bb14552a001fe563ad6e3da20fc1b1838a0d6ad with merge 013c87b3813eab23d1ebea1d7cb8aac3624f02a2... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (013c87b3813eab23d1ebea1d7cb8aac3624f02a2): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
@@ -1089,7 +1090,7 @@ pub fn encode_query_results<'a, 'tcx, Q>( | |||
|
|||
// Encode the type check tables with the `SerializedDepNodeIndex` | |||
// as tag. | |||
encoder.encode_tagged(dep_node, value); | |||
encoder.encode_tagged(dep_node, &Q::restore(*value)); |
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.
Does this deserve an restore_ref(&Erased<T>) -> &T
helper?
Can't we use restore
directly?
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.
That's not safe as alignment can differ.
([]) => {{ | ||
Some(dep_graph::hash_result) | ||
([][$V:ty]) => {{ | ||
Some(|hcx, result| dep_graph::hash_result(hcx, &restore::<$V>(*result))) |
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.
Likewise restore_ref
compiler/rustc_query_impl/src/lib.rs
Outdated
@@ -44,6 +46,14 @@ pub use on_disk_cache::OnDiskCache; | |||
mod profiling_support; | |||
pub use self::profiling_support::alloc_self_profile_query_strings; | |||
|
|||
trait QueryToConfig<'tcx>: 'tcx { |
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.
Could you document this trait?
@@ -11,7 +11,6 @@ use crate::query::job::QueryLatch; | |||
use crate::query::job::{report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo}; | |||
use crate::query::SerializedDepNodeIndex; | |||
use crate::query::{QueryContext, QueryMap, QuerySideEffects, QueryStackFrame}; | |||
use crate::values::Value; |
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.
The trait and its can now be grouped in rustc_middle::query::values
.
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.
Maybe add an impl<T, C> !Value<C> for Erased<T>
to avoid jokes?
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 ran into specialization errors trying to remove the unsafe
Value
impls in rustc_middle
, so I think I'll just leave it in rustc_query_system
.
@@ -45,6 +45,12 @@ pub trait QueryConfig<Qcx: QueryContext>: Copy { | |||
|
|||
fn loadable_from_disk(self, qcx: Qcx, key: &Self::Key, idx: SerializedDepNodeIndex) -> bool; | |||
|
|||
fn from_cycle_error( |
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.
fn from_cycle_error( | |
/// Synthesize a dummy return value to let compilation continue emitting errors. | |
fn value_from_cycle_error( |
This could use another perf run to see if removing the |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 38bc74365eacf98fe04b6332643d436b296f17b4 with merge 6804bca3e0eba91188cf84b898e9ac4805993725... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6804bca3e0eba91188cf84b898e9ac4805993725): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
This comment has been minimized.
This comment has been minimized.
7cb67e5
to
0110073
Compare
Rebased. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f5b8f44): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
Looking at the non-significant earlier perf results there are some bumps in instructions count when adding the I also noticed functions not getting inlined since we use 16 CGUs instead of 1. It would be nice if we had 1 CGU for perf runs. |
It's not clear if it will be an improvement and it could easily get lost in the sea of issues instead. |
This replaces most concrete query values
V
withMaybeUninit<[u8; { size_of::<V>() }]>
without introducing dynamic dispatch like #108638 does. This is split out of #108638 so the performance impact of only this change can be measured.r? @cjgillot