Remove dereferencing of Box from codegen#95576
Conversation
|
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
|
Could you update the documentation for |
This comment has been minimized.
This comment has been minimized.
|
cc @JakobDegen (you asked), @bjorn3 & @antoyo (you'll want to update your codegens after this) |
|
Oh wait lol, I didn't notice you were already here |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It looks like this is impacting codegen, I'll have to investigate. |
|
The llvm ir only seems to be different with no optimizations, how bad are these changes then? |
This comment has been minimized.
This comment has been minimized.
|
r? rust-lang/compiler rerrolling the review dice, I'm currently a bit swamped |
|
☔ The latest upstream changes (presumably #95742) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I don't think I have the required background knowledge to review this. Maybe someone from @rust-lang/wg-mir-opt could take a look? |
|
r? @oli-obk I already reviewed the other PRs and asked for a general solution there ^^ |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message |
oli-obk
left a comment
There was a problem hiding this comment.
This is great! thanks for doing it.
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
2667b9d to
28ff0df
Compare
|
@bors r+ |
|
📌 Commit 28ff0df has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (a25b131): 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. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
|
the diesel regression: the keccak regression is So it looks like we're doing a bit more obligation processing now. |
| let unique_did = tcx.adt_def(def_id).non_enum_variant().fields[0].did; | ||
|
|
||
| let Some(nonnull_def) = tcx.type_of(unique_did).ty_adt_def() else { | ||
| span_bug!(tcx.def_span(unique_did), "expected Box to contain Unique") |
There was a problem hiding this comment.
This should probably be using a lang item for Unique rather than just expecting it to be right. Perhaps even #[lang = "owned_box"] could wf check that the first field is Unique.
Reported as an ICE by #98372; rustc_codegen_gcc's minicore defines Box as (*mut T, A).
|
@oli-obk this regression is only on average a 0.4% regression across only 6 cases which doesn't seem like a big deal. Would you say this change is worth the performance penalty? Shall we mark as triaged? |
|
@rustbot label A-box |
|
@rustbot label A-box |
Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains.
Hopefully, this is the end of the Box<T, A> ICEs.