-
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 Spans from HIR #72015
Remove Spans from HIR #72015
Conversation
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.
Not sure who's most appropriate to review. Maybe r? @petrochenkov? |
This comment has been minimized.
This comment has been minimized.
cc #47389. |
Spans that are not in If this allows to not hash spans in most cases and hash them only in rare cases in which they are really needed, then this should be an improvement. r? @nikomatsakis because you mentioned this recently in #51003 (comment) |
Interesting! So, to make sure I understand the approach:
I think an MCP would be most appropriate, yes. I also suspect that @pnkfelix is the right reviewer, as he's been interested in getting more involved in this area, but I'll let him volunteer if he feels he has time. |
☔ The latest upstream changes (presumably #72120) made this pull request unmergeable. Please resolve the merge conflicts. |
@cjgillot Do we have metrics for how much (if any) invalidation this eliminates? (As you said a lot of spans still remain, I wouldn't be surprised if the net change is approximately zero. But I am still curious whether we can easily gather data here.) |
I have no idea how to gather such data. A possibility would be a perf run, and look at the "println incremental" lines. Does perf handle comparing "clean incremental" and "println incremental"? |
@bors try @rust-timer queue Well, a perf run certainly can't hurt -- and since CI seems to be passing might as well try it out. |
Awaiting bors try build completion |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
Rebased. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #83149) made this pull request unmergeable. Please resolve the merge conflicts. |
@cjgillot Is this waiting for a review or do you plan to do more here? |
@jackh726 I believe this PR is not the right solution for the issue of span invalidation. |
Remove `rustc_hir::hir_id::HirIdVec` See rust-lang#90408 (comment): > IIRC, `HirIdVec` is never used, you can delete it. PR rust-lang#72015 has been abandoned. r? `@cjgillot`
Remove `rustc_hir::hir_id::HirIdVec` See rust-lang#90408 (comment): > IIRC, `HirIdVec` is never used, you can delete it. PR rust-lang#72015 has been abandoned. r? `@cjgillot`
This PR is an experiment in removing the Span information from the HIR tree.
I plan to submit a MCP if this PR is considered relevant.
The spans are stored in a side table, indexed by
HirId
, and constructed during lowering.A dedicated query is created to retrieve those spans.
Subsequent commits gradually remove spans from HIR nodes.
Those are quite mechanical, and don't deserve close examination before the MCP is accepted.
The point of this PR is to limit HIR invalidation due to span info changing.
At this stage, there are still a lot of spans in the HIR.
I do not think we will see benefits while there are some.
Anyway, I would like to get a few comment wrt. the soundness of the approach.