-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Always use RevealAll for const eval queries #119821
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
Always use RevealAll for const eval queries implements what is described in rust-lang#116803 (comment)
r? @lcnr |
☀️ 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 (488c25a): 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 666.26s -> 665.975s (-0.04%) |
yay free const eval performance improvement. |
@@ -226,16 +226,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>( | |||
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>, | |||
) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> { | |||
// see comment in eval_to_allocation_raw_provider for what we're doing here |
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 comment now probably needs updating?
The assertion error or the comment should explain what a rustc dev should do when they hit this panic.
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.
This removes a bunch of code that I never understood and improves performance (except, strangely, in one benchmark). I'm all for it :)
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
253d14e
to
e054f03
Compare
fixed test comments |
e054f03
to
5592c40
Compare
5592c40
to
7510332
Compare
This comment has been minimized.
This comment has been minimized.
7510332
to
e30b314
Compare
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.
please update comments and add this test 😁 r=me after that
trait MyTrait: Copy {
const ASSOC: usize;
}
impl MyTrait for u8 {
const ASSOC: usize = 32;
}
const fn yeet() -> impl MyTrait {
0u8
}
const fn output<T: MyTrait>(_: T) -> usize {
<T as MyTrait>::ASSOC
}
struct Foo<'a>(&'a ())
const NEED_REVEAL_ALL: usize = output(yeet());
fn promote_div() -> &'static usize {
&(10 / NEED_REVEAL_ALL)
}
fn main() {}
e30b314
to
867831a
Compare
@bors r=lcnr |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5378c1c): comparison URL. Overall result: ✅ improvements - 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)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis 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.
Bootstrap: 665.078s -> 663.642s (-0.22%) |
implements what is described in #116803 (comment)
Using
UserFacing
for const eval does not make sense anymore, unless we significantly change things like avoiding revealing opaque types.New tests are copied from #101478