-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove LocalDefId <-> HirId global maps #89278
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2ea6352
to
28329e9
Compare
This comment has been minimized.
This comment has been minimized.
cc @michaelwoerister since you reviewed #89124. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e314d9902736731bde1bf07b455e2b62cbc93b57 with merge 9d51250e101ca95958b481c7c0e36210a39dabec... |
☀️ Try build successful - checks-actions |
Queued 9d51250e101ca95958b481c7c0e36210a39dabec with parent 1af55d1, future comparison URL. |
Finished benchmarking commit (9d51250e101ca95958b481c7c0e36210a39dabec): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
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 comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6805235 with merge b3336bc040e749560ae2b328fc7bf69d5f9a17d8... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
Queued b3336bc040e749560ae2b328fc7bf69d5f9a17d8 with parent d08e816, future comparison URL. |
Finished benchmarking commit (b3336bc040e749560ae2b328fc7bf69d5f9a17d8): comparison url. Summary: This benchmark run shows 166 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 |
Replaced by #93373. |
… r=oli-obk Store def_id_to_hir_id as variant in hir_owner. If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId. Related to rust-lang#89278 r? `@oli-obk`
…, r=oli-obk Node id to hir id refactor Related to rust-lang#89278 r? `@oli-obk`
Based on #89124.The LocalDefId <-> HirId maps were globally accessed through
tcx.definitions
. They are now encoded using the HIR queries.hir_owner_nodes(hir_id.owner)
, indexed byhir_id.local_id
.local_def_id
is an HIR owner, ie. ifhir_owner
isSome
. Therefore, we use theNone
case to store the non-owningHirId
.There is a special case with
use
trees, which can have a LocalDefId, which should be an HIR owner, but with no associated HIR data structure. In that case, we store the information like non-owning definitions.