-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tell rustc about unused bits in Span. #93747
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 4749961 with merge 71f1cf816a84020c13ca2ee1a5c2a88314d44b42... |
☀️ Try build successful - checks-actions |
Queued 71f1cf816a84020c13ca2ee1a5c2a88314d44b42 with parent f52c318, future comparison URL. |
Finished benchmarking commit (71f1cf816a84020c13ca2ee1a5c2a88314d44b42): comparison url. Summary: This benchmark run shows 20 relevant regressions 😿 to instruction counts.
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 led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
This shrinks the size of `Option<Span>` and similar types, which shrinks several AST and HIR nodes. The most important of these are `hir::Expr` and `ast::Ty`. This change was first attempted in rust-lang#93747 where it had little effect. But the improved niche-filling implemented by rust-lang#94075 means this change now has a much bigger effect. Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
The maximum value for
len_or_tag
in encodedSpan
isLEN_TAG
, which is less thanu32::MAX
.#84290 determined the extra room was not really useful for perf.
This PR tells rustc about the extra room at the top, hoping for more aggressive layout optimizations.