Skip to content
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

Merged
merged 2 commits into from
Jul 15, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jul 7, 2022

This is achieved by refactoring the projection code ({mplace,place,operand}_{downcast,field,index,...}) so that we no longer need to call assert_mem_place in the operand handling.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 7, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 7, 2022

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

@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 7, 2022
@@ -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)),
Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, done that.

@RalfJung
Copy link
Member Author

RalfJung commented Jul 7, 2022

r? @oli-obk

Let's see if those new assertions cost us any perf (and we need something clever trait-based).
@bors try @rust-timer queue

@rust-timer

This comment was marked as outdated.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2022
@bors

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@rust-timer

This comment was marked as outdated.

@rust-timer

This comment was marked as outdated.

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 8, 2022
@RalfJung

This comment was marked as outdated.

@rust-timer

This comment was marked as outdated.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 8, 2022
@bors

This comment was marked as outdated.

@rust-timer

This comment was marked as outdated.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jul 13, 2022

☔ The latest upstream changes (presumably #99101) made this pull request unmergeable. Please resolve the merge conflicts.

MPlaceTy::dangling still exists, but now it is only called in places that
actually conceptually allocate something new, so that's fine.
@RalfJung
Copy link
Member Author

Also ready for review now. :)

And now for our swarm of bots...
@rustbot ready
@bors try
@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-perf Status: Waiting on a perf run to be completed. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Jul 13, 2022
@bors
Copy link
Contributor

bors commented Jul 13, 2022

⌛ Trying commit 874a130 with merge 430074764e7eb1cee93eb99022271bca8aee5140...

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

2 similar comments
@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Jul 13, 2022

☀️ Try build successful - checks-actions
Build commit: 430074764e7eb1cee93eb99022271bca8aee5140 (430074764e7eb1cee93eb99022271bca8aee5140)

@rust-timer
Copy link
Collaborator

Queued 430074764e7eb1cee93eb99022271bca8aee5140 with parent ca4e394, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (430074764e7eb1cee93eb99022271bca8aee5140): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-1.0% -1.2% 7
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-9.1% -9.1% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.1% 3.1% 1
Improvements 🎉
(primary)
-2.3% -2.3% 1
Improvements 🎉
(secondary)
-2.2% -2.2% 1
All 😿🎉 (primary) -2.3% -2.3% 1

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
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 13, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 14, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 14, 2022

📌 Commit e3ef4fd has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2022
@bors
Copy link
Contributor

bors commented Jul 15, 2022

⌛ Testing commit e3ef4fd with merge 6077b7c...

@bors
Copy link
Contributor

bors commented Jul 15, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 6077b7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 15, 2022
@bors bors merged commit 6077b7c into rust-lang:master Jul 15, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 15, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6077b7c): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
0.5% 0.5% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-1.6% -2.5% 12
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
4.1% 4.6% 2
Regressions 😿
(secondary)
2.2% 2.2% 1
Improvements 🎉
(primary)
-0.6% -0.6% 1
Improvements 🎉
(secondary)
-6.0% -8.4% 2
All 😿🎉 (primary) 2.6% 4.6% 3

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.7% -2.7% 1
Improvements 🎉
(secondary)
-2.1% -2.1% 1
All 😿🎉 (primary) -2.7% -2.7% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@RalfJung RalfJung deleted the dont-poison-my-places branch July 17, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants