-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
interpret: get rid of MemPlaceMeta::Poison #99013
Conversation
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in const_evaluatable.rs cc @lcnr Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo |
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -275,12 +273,12 @@ impl<'tcx, Tag: Provenance> OpTy<'tcx, Tag> { | |||
Operand::Indirect(mplace) => { | |||
Ok(MPlaceTy { mplace, layout: self.layout, align: self.align.unwrap() }) | |||
} | |||
Operand::Immediate(_) if self.layout.is_zst() => Ok(MPlaceTy::dangling(self.layout)), |
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 was the main motivation for poisoning: we'd come up with a place (that has an address) for operands that don't have an address.
All other uses of MPlaceTy::dangling
are fine, they are actually conceptually properly creating an allocation. I was looking for good ways to reflect that in its name and failed at that. MPlaceTy::alloc_zst
sounds like it actually creates an allocation. Maybe fake_alloc_zst
or 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.
Maybe
fake_alloc_zst
or so?
I like this idea. dangling
has a lot of meaning attached to it that doesn't immediately convey what we mean 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.
All right, done that.
7b38d51
to
a1dc2af
Compare
r? @oli-obk Let's see if those new assertions cost us any perf (and we need something clever trait-based). |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
a1dc2af
to
2b76d0e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
2b76d0e
to
09bd020
Compare
MPlaceTy::dangling still exists, but now it is only called in places that actually conceptually allocate something new, so that's fine.
ab9e2f3
to
874a130
Compare
Also ready for review now. :) And now for our swarm of bots... |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 874a130 with merge 430074764e7eb1cee93eb99022271bca8aee5140... |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
2 similar comments
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
☀️ Try build successful - checks-actions |
Queued 430074764e7eb1cee93eb99022271bca8aee5140 with parent ca4e394, future comparison URL. |
Finished benchmarking commit (430074764e7eb1cee93eb99022271bca8aee5140): 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. 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+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6077b7c): 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 is achieved by refactoring the projection code (
{mplace,place,operand}_{downcast,field,index,...}
) so that we no longer need to callassert_mem_place
in the operand handling.