Lower only one HIR owner at a time#87234
Conversation
|
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
|
cc @petrochenkov since this moves some things to rustc_resolve |
This comment has been minimized.
This comment has been minimized.
|
Blocked on #84373. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@cjgillot |
This comment has been minimized.
This comment has been minimized.
3514603 to
5f067ce
Compare
By "HirId preallocation", for lack of a better word, I mean calls to
I had changed that before messing up the rebase. |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit 95c7e884872435d0986dfde25f5925e2c0ad88bd with merge 9b09421d6a741b71ea5a76c626df819dda3cc5ed... |
|
☀️ Try build successful - checks-actions |
|
Queued 9b09421d6a741b71ea5a76c626df819dda3cc5ed with parent 3bca723, future comparison URL. |
Do not preallocate HirIds Part of rust-lang#87234 r? `@petrochenkov`
|
Finished benchmarking commit (9b09421d6a741b71ea5a76c626df819dda3cc5ed): comparison url. Summary: This change led to moderate relevant mixed results 🤷 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 |
95c7e88 to
11024b2
Compare
| fn with_parent_item_lifetime_defs<T>( | ||
| &mut self, | ||
| parent_hir_id: hir::ItemId, | ||
| parent_hir_id: LocalDefId, |
There was a problem hiding this comment.
| parent_hir_id: LocalDefId, | |
| parent_def_id: LocalDefId, |
| // Add all the nested `PathListItem`s to the HIR. | ||
| for &(ref use_tree, id) in trees { | ||
| let new_hir_id = self.allocate_hir_id_counter(id); | ||
| let new_hir_id = self.resolver.local_def_id(id); |
There was a problem hiding this comment.
| let new_hir_id = self.resolver.local_def_id(id); | |
| let new_def_id = self.resolver.local_def_id(id); |
|
@bors r+ |
|
📌 Commit 11024b2 has been approved by |
|
⌛ Testing commit 11024b2 with merge 7da30f2d33a61ad8b1742097dd71ffc698d1dc8c... |
|
💥 Test timed out |
|
@bors retry |
|
☀️ Test successful - checks-actions |
|
I think this commit was one that was left out of the normal perf service. Here is what the weekly perf triage report says about it: Lower only one HIR owner at a time #87234
Looking at the results by eye, I'd say its clearly a big win. @rustbot label: perf-regression-triaged |
Based on #83723
Additional diff is here: cjgillot/rust@ownernode...lower-mono
Lowering is very tangled and has a tendency to intertwine the transformation of different items. This PR aims at simplifying the logic by:
I also removed the sorting of bodies by span. The diagnostic ordering changes marginally, since definitions are pretty much sorted already according to the AST. This uncovered a subtlety in thir-unsafeck.
(While these items could logically be in different PRs, the dependency between commits and the amount of conflicts force a monolithic PR.)