-
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
Merge -Zhir-stats
into -Zinput-stats
#133023
base: master
Are you sure you want to change the base?
Conversation
AST and HIR are two separate IR's with a different structure. As such they should get separate statistics. |
Not too familiar with the use case for this, maybe r? @nnethercote? |
@bjorn3 I understand that, but the reason I'm asking is because |
Right, missed that.
I never used either flag, so I guess I'm not the right person to decide whether that should be done or not. |
The code changes here look fine. You should update the test. It's current marked as As for the bigger questions about the two flags:
@samestep: Would you like to do this? You could do it in this PR, in a second commit. Finally, I'm curious why you were looking at these flags. Have you been using them yourself? |
Changes to the size of AST and/or HIR nodes. cc @nnethercote |
|
-Z hir-stats
-Zhir-stats
into -Zinput-stats
Thanks for the quick review!
Done; yeah, I am on an M-series Mac.
I've merged them, but I missed the part about
Done.
It's a bit of a long story, and somewhat off-topic for this thread, so I'll write you an email. |
Looks good. My only suggestion is to squash the first two commits together, because they are logically part of the same change. Once that's done it's good to go, thanks. @bors delegate=samestep |
✌️ @samestep, you can now approve this pull request! If @nnethercote told you to " |
Currently
-Z hir-stats
prints the size and count of various kinds of nodes, and the total size of all the nodes it counted, but not the total count of nodes. So, before this PR:For consistency, this PR adds a total for the count as well:
I wasn't sure if I was supposed to update
tests/ui/stats/hir-stats.stderr
to reflect this. I ran it locally, thinking it would fail, but it didn't:Also: is there a reason
-Z hir-stats
and-Z input-stats
both exist? The former seems like it should completely supercede the latter. But strangely, the two give very different numbers for node counts:That's a 30% difference in this case. Is it intentional that these numbers are so different? I see comments for both saying that they are merely approximations and should not be expected to be correct:
rust/compiler/rustc_ast_passes/src/node_count.rs
Line 1 in bd0826a
rust/compiler/rustc_passes/src/hir_stats.rs
Lines 1 to 3 in bd0826a