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: track place alignment together with the type, not the value #98846

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jul 3, 2022

This matches how I handle alignment in MiniRust. I think it makes conceptually a lot more sense.
Fixes #63085

r? @oli-obk

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

rustbot commented Jul 3, 2022

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Jul 3, 2022

This makes MemPlace and Place a bit smaller. Unfortunately it also makes OpTy a bit bigger. Let's see if that is a problem.
@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

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

bors commented Jul 3, 2022

⌛ Trying commit 8955686 with merge 66f86800cc3af8ccdffbe1b0ab2f547612df788d...

@bors
Copy link
Contributor

bors commented Jul 3, 2022

☀️ Try build successful - checks-actions
Build commit: 66f86800cc3af8ccdffbe1b0ab2f547612df788d (66f86800cc3af8ccdffbe1b0ab2f547612df788d)

@rust-timer
Copy link
Collaborator

Queued 66f86800cc3af8ccdffbe1b0ab2f547612df788d with parent f99f9e4, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (66f86800cc3af8ccdffbe1b0ab2f547612df788d): comparison url.

Instruction count

  • 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)
-0.5% -0.5% 1
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
2.6% 2.7% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 2.6% 2.7% 2

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)
-3.6% -3.6% 1
Improvements 🎉
(secondary)
-3.8% -3.8% 1
All 😿🎉 (primary) -3.6% -3.6% 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 3, 2022
/// This means `layout.align` should never be used for an `OpTy`!
/// `None` means "alignment does not matter since this is a by-value operand"
/// (`Operand::Immediate`).
pub align: Option<Align>,
Copy link
Contributor

Choose a reason for hiding this comment

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

So afaict this field is never used, and after lots of going through this PRs diff, I came to the conclusion it will only be used to check reads from Operand::Indirect, and only in miri.

Please document the miri part, the other part is already documented after all.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah currently this field cannot cause UB I think. But I want to relax the rules for *ptr and once we do, this can cause UB again.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 4, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 4, 2022

📌 Commit b1568e6 has been approved by oli-obk

@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 4, 2022
@bors
Copy link
Contributor

bors commented Jul 5, 2022

⌛ Testing commit b1568e6 with merge 4008dd8...

@bors
Copy link
Contributor

bors commented Jul 5, 2022

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

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

Finished benchmarking commit (4008dd8): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements 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)
-0.7% -0.9% 8
Improvements 🎉
(secondary)
-1.2% -2.3% 13
All 😿🎉 (primary) -0.7% -0.9% 8

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
3.0% 6.2% 3
Regressions 😿
(secondary)
2.8% 3.8% 6
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.0% 6.2% 3

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
2.7% 3.0% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.5% -2.8% 3
Improvements 🎉
(secondary)
-3.4% -4.6% 7
All 😿🎉 (primary) -0.4% 3.0% 5

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 alignment-is-a-type-thing branch July 5, 2022 11:30
@RalfJung
Copy link
Member Author

RalfJung commented Jul 5, 2022

Ah, those Max-RSS regressions are unfortunate. I have some ideas for how to make OpTy smaller again.

@RalfJung
Copy link
Member Author

RalfJung commented Jul 6, 2022

Okay, that plan actually works. But it is the 4th PR in a linear chain starting with #98831 ...^^

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.

Reevaluate Miri engine alignment checks
6 participants