Remove register class from SpillSlot#80
Merged
Merged
Conversation
The register allocator was already allowing moves between spillslots and registers of different classes, so this PR formalizes this by making spillslots independent of register class. This also fixes bytecodealliance#79 by properly tracking the register class of an `InsertedMove` with the `to_vreg` field which turns out to never be `None` in practice. Removing the `Option` allows the register class of the `VReg` to be used when building the per-class move lists. Fixes bytecodealliance#79
9662fe5 to
8d80950
Compare
cfallin
approved these changes
Sep 20, 2022
cfallin
left a comment
Member
There was a problem hiding this comment.
Thanks, this is simple and clean! Just one tiny field-naming request below, otherwise LGTM.
| pub struct SpillSlotData { | ||
| pub ranges: LiveRangeSet, | ||
| pub class: RegClass, | ||
| pub size: u32, |
Member
There was a problem hiding this comment.
can we call this field slots to make the units clear (as opposed to e.g. bytes)?
Merged
cfallin
added a commit
to cfallin/regalloc2
that referenced
this pull request
Sep 21, 2022
This is identical to v0.3.3, but it turns out that the removal of the register class from `SpillSlot` (bytecodealliance#80) is an API change. I missed this and published 0.3.3 but yanked it after it was causing build issues for folks.
Merged
cfallin
added a commit
that referenced
this pull request
Sep 21, 2022
This is identical to v0.3.3, but it turns out that the removal of the register class from `SpillSlot` (#80) is an API change. I missed this and published 0.3.3 but yanked it after it was causing build issues for folks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The register allocator was already allowing moves between spillslots and registers of different classes, so this PR formalizes this by making spillslots independent of register class.
This also fixes #79 by properly tracking the register class of an
InsertedMovewith theto_vregfield which turns out to never beNonein practice. Removing theOptionallows the register class of theVRegto be used when building the per-class move lists.Fixes #79