-
Notifications
You must be signed in to change notification settings - Fork 14k
Replace OffsetOf by an actual sum of calls to intrinsic. #148151
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
0dc894f to
e46804b
Compare
This comment has been minimized.
This comment has been minimized.
e46804b to
8f24a32
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Replace OffsetOf by an actual sum of calls to intrinsic.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7721497): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.876s -> 473.729s (-0.03%) |
|
☔ The latest upstream changes (presumably #148324) made this pull request unmergeable. Please resolve the merge conflicts. |
875c6f6 to
9fd16d6
Compare
|
Some changes occurred in match checking cc @Nadrieril Some changes occurred to the CTFE machinery
cc @rust-lang/wg-const-eval Some changes occurred to constck cc @fee1-dead Some changes occurred in src/tools/clippy cc @rust-lang/clippy This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a Some changes occurred in cc @BoxyUwU Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_ssa This PR changes a file inside |
|
What's the justification/benefit for doing this, and what user facing impact does it have (i.e. why does it need a lang nomination)? |
|
My justification is simplifying MIR. This feature was implemented as a specific MIR statement, but does not need to, an intrinsic is sufficient. There should be no user-facing change because of the However, there are 2 user-facing changes in this PR that t-lang may want to know:
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
fc6c34f to
5b48fd9
Compare
This comment has been minimized.
This comment has been minimized.
5b48fd9 to
85eca56
Compare
85eca56 to
e799160
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=scottmcm |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing c199562 (parent) -> f9e7961 (this PR) Test differencesShow 82 test diffsStage 1
Stage 2
Additionally, 66 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard f9e7961506a97b318ad4815b8ce94bb045562f89 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (f9e7961): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.1%, secondary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.876s -> 471.624s (-0.68%) |
|
clap_derive is noise, include-blob looks like noise. |
Relevant upstream PR: - rust-lang/rust#148151 (Replace OffsetOf by an actual sum of calls to intrinsic.) Resolves: model-checking#4481
|
perf triage: As indicated by the comment above, @rustbot label: +perf-regression-triaged |
Relevant upstream PR: - rust-lang/rust#148151 (Replace OffsetOf by an actual sum of calls to intrinsic.) Resolves: #4481 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
This PR changes the way we compute the value of the
offset_of!macro in MIR. The current implementation uses a dedicated MIR rvalue.This PR proposes to replace it by an inline constant which sums calls to a new intrinsic
offset_of(variant index, field index). The desugaring is done at THIR building time, easier that doing it on MIR.The new intrinsic is only meant to be used by const-eval. LLVM codegen will refuse to generate code for it.
We replace:
By:
The second commit modifies intrinsic const checking to take
allow_internal_unstableinto account. The new intrinsic should only be called from stableoffset_of!macro. The intrinsic itself is unstable, const-unstable, butrustc_intrinsic_const_stable_indirect.Fixes #123959
Fixes #125680
Fixes #129425
Fixes #136175
r? @ghost