-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Optimize const value interning for ZST types #78061
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Interning can skip any inhabited ZST type in general.
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 1d07d69 with merge 25cf147f8ee183a6b207e49e0339d8189e8e9280... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 25cf147f8ee183a6b207e49e0339d8189e8e9280 with parent ffeeb20, future comparison URL. |
Finished benchmarking try commit (25cf147f8ee183a6b207e49e0339d8189e8e9280): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
@bors r+ rollup |
📌 Commit 1d07d69 has been approved by |
Can you check whether this also fixes #77062? |
…, r=oli-obk Optimize const value interning for ZST types Interning can skip any inhabited ZST type in general. Fixes rust-lang#68010 r? @oli-obk
…laumeGomez Rollup of 9 pull requests Successful merges: - rust-lang#78046 (Add codegen test for issue rust-lang#73827) - rust-lang#78061 (Optimize const value interning for ZST types) - rust-lang#78070 (we can test std and core panic macros together) - rust-lang#78076 (Move orphan module-name/mod.rs files into module-name.rs files) - rust-lang#78129 (Wrapping intrinsics doc links update.) - rust-lang#78133 (Add some MIR-related regression tests) - rust-lang#78144 (Don't update `entries` in `TypedArena` if T does not need drop) - rust-lang#78145 (Drop unneeded `mut`) - rust-lang#78157 (Remove unused type from librustdoc) Failed merges: r? `@ghost`
Good call! That's fixed too. I'll open another PR with the test case added. |
@@ -187,6 +187,12 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx>> ValueVisitor<'mir | |||
return walked; | |||
} | |||
} | |||
|
|||
// ZSTs do not need validation unless they're uninhabited |
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 is not validation, this is interning, so I find the comment here rather confusing.
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.
I think actually we can skip even uninhabited ZST, precisely because this is not validation but just looking for pointers: #78179.
Interning can skip any inhabited ZST type in general.
Fixes #68010
r? @oli-obk