-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Simplify IntVarValue
/FloatVarValue
#123536
Conversation
changes to the core type system |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> Simplify `IntVarValue`/`FloatVarValue` r? `@ghost`
☀️ Try build successful - checks-actions |
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 think you also have to update nll relate, even if i shouldn't use int and float vars iirc
I remember trying the same thing at some point, don't remember why i didn't land it. r=me after perf
@@ -1607,15 +1611,15 @@ impl<'tcx> InferCtxt<'tcx> { | |||
// If `inlined_probe_value` returns a value it's always a | |||
// `ty::Int(_)` or `ty::UInt(_)`, which never matches a | |||
// `ty::Infer(_)`. | |||
self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_some() | |||
!self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_unknown() |
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.
!self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_unknown() | |
self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_known() |
double negation is confusing esp given the length of the negated condition
} | ||
|
||
TyOrConstInferVar::TyFloat(v) => { | ||
// If `probe_value` returns a value it's always a | ||
// `ty::Float(_)`, which never matches a `ty::Infer(_)`. | ||
// | ||
// Not `inlined_probe_value(v)` because this call site is colder. | ||
self.inner.borrow_mut().float_unification_table().probe_value(v).is_some() | ||
!self.inner.borrow_mut().float_unification_table().probe_value(v).is_unknown() |
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.
!self.inner.borrow_mut().float_unification_table().probe_value(v).is_unknown() | |
self.inner.borrow_mut().float_unification_table().probe_value(v).is_known() |
ty::IntVarValue::Unknown => None, | ||
ty::IntVarValue::IntType(ty) => Some(Ty::new_int(self.infcx.tcx, ty)), | ||
ty::IntVarValue::UintType(ty) => Some(Ty::new_uint(self.infcx.tcx, ty)), |
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.
ty::IntVarValue::Unknown => None, | |
ty::IntVarValue::IntType(ty) => Some(Ty::new_int(self.infcx.tcx, ty)), | |
ty::IntVarValue::UintType(ty) => Some(Ty::new_uint(self.infcx.tcx, ty)), | |
ty::IntVarValue::IntType(ty) => Some(Ty::new_int(self.infcx.tcx, ty)), | |
ty::IntVarValue::UintType(ty) => Some(Ty::new_uint(self.infcx.tcx, ty)), | |
ty::IntVarValue::Unknown => None, |
the nittiest nit
ty::FloatVarValue::Unknown => None, | ||
ty::FloatVarValue::Known(ty) => Some(Ty::new_float(self.infcx.tcx, ty)), |
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.
ty::FloatVarValue::Unknown => None, | |
ty::FloatVarValue::Known(ty) => Some(Ty::new_float(self.infcx.tcx, ty)), | |
ty::FloatVarValue::Known(ty) => Some(Ty::new_float(self.infcx.tcx, ty)), | |
ty::FloatVarValue::Unknown => None, |
part 2
Finished benchmarking commit (a7eb620): comparison URL. Overall result: ❌ regressions - 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)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.691s -> 668.286s (-0.06%) |
i do remember why 😁 because it worsens perf |
cc9de3b
to
6e5acfb
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> Simplify `IntVarValue`/`FloatVarValue` r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (a0e877e): 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)This benchmark run did not return any relevant results for this metric. 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 676.389s -> 678.316s (0.28%) |
6e5acfb
to
a1e903d
Compare
☔ The latest upstream changes (presumably #124558) made this pull request unmergeable. Please resolve the merge conflicts. |
c623ae1
to
1eb0a5b
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> Simplify `IntVarValue`/`FloatVarValue` r? `@ghost`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (cdab356): comparison URL. Overall result: no relevant changes - no 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 2.5%, secondary 3.8%)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.
CyclesResults (secondary -2.5%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 669.181s -> 665.221s (-0.59%) |
Cool lol |
1eb0a5b
to
208c316
Compare
nice 👍 gj @bors r+ rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (44701e0): comparison URL. Overall result: ❌ regressions - no action needed@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)Results (primary -2.1%, secondary -3.2%)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.
CyclesResults (primary -0.9%, secondary 7.9%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.768s -> 668.226s (0.07%) |
r? @ghost