Uh oh!
There was an error while loading. Please reload this page.
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.
varkor
commented
May 9, 2020
Not sure who's most appropriate to review. Maybe r? @petrochenkov? |
This comment has been minimized.
This comment has been minimized.
cjgillot
commented
May 11, 2020
cc #47389. |
petrochenkov
commented
May 11, 2020
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) |
nikomatsakis
commented
May 11, 2020
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. |
bors
commented
May 12, 2020
☔ The latest upstream changes (presumably #72120) made this pull request unmergeable. Please resolve the merge conflicts. |
pnkfelix
commented
May 12, 2020
@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.) |
cjgillot
commented
May 12, 2020
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"? |
Mark-Simulacrum
commented
May 12, 2020
@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. |
rust-timer
commented
May 12, 2020
Awaiting bors try build completion |
bors
commented
May 12, 2020
🔒 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 |
cjgillot
commented
May 12, 2020
Rebased. |
This comment has been minimized.
This comment has been minimized.
bors
commented
Mar 15, 2021
☔ The latest upstream changes (presumably #83149) made this pull request unmergeable. Please resolve the merge conflicts. |
jackh726
commented
May 3, 2021
@cjgillot Is this waiting for a review or do you plan to do more here? |
cjgillot
commented
May 4, 2021
@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.