-
Notifications
You must be signed in to change notification settings - Fork 13.4k
use precise spans for recursive const evaluation #97740
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
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
95588c7
to
0db5050
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 0db50505a2feb88eef2e3209969cd0df39bb9d6c with merge c9b99076039201534fb4a746e0b7b4b9bbe9f474... |
pub fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> InterpResult<'tcx> { | ||
info!("{:?}", stmt); | ||
|
||
use rustc_middle::mir::StatementKind::*; | ||
|
||
// Some statements (e.g., box) push new stack frames. |
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 is no longer true since the Box nullary op got removed. :)
return Ok(true); | ||
} | ||
|
||
M::before_terminator(self)?; | ||
|
||
let terminator = basic_block.terminator(); | ||
assert_eq!(old_frames, self.frame_idx()); |
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 have no idea what the point of this was; it is probably an ancient leftover.
That function is called by const_prop, where updating the index like that is totally meaningless.
This comment has been minimized.
This comment has been minimized.
0db5050
to
467e0f4
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 467e0f4 with merge 6a683121e42aa205b571a37453d7acaf44416332... |
☀️ Try build successful - checks-actions |
Queued 6a683121e42aa205b571a37453d7acaf44416332 with parent 6364179, future comparison URL. |
Finished benchmarking commit (6a683121e42aa205b571a37453d7acaf44416332): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
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 Footnotes |
@bors r+ |
📌 Commit 467e0f4 has been approved by |
⌛ Testing commit 467e0f4 with merge a69f0b31afb62056cf6d506b5e6ffa3498292a7e... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
This cannot really be caused by this PR, right? |
☀️ Test successful - checks-actions |
Finished benchmarking commit (282445a): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This fixes #73283 by using a
TyCtxtAt
with a more precise span when the interpreter recursively calls itself. Hopefully such calls are sufficiently rare that this does not cost us too much performance.(In theory, cycles can also arise through layout computation, as layout can depend on consts -- but layout computation happens all the time so we'd have to do something to not make this terrible for performance.)