Skip to content

Remove register class from SpillSlot#80

Merged
cfallin merged 2 commits into
bytecodealliance:mainfrom
Amanieu:spillslot-class
Sep 20, 2022
Merged

Remove register class from SpillSlot#80
cfallin merged 2 commits into
bytecodealliance:mainfrom
Amanieu:spillslot-class

Conversation

@Amanieu

@Amanieu Amanieu commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

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 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 #79

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

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is simple and clean! Just one tiny field-naming request below, otherwise LGTM.

Comment thread src/ion/data_structures.rs Outdated
pub struct SpillSlotData {
pub ranges: LiveRangeSet,
pub class: RegClass,
pub size: u32,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call this field slots to make the units clear (as opposed to e.g. bytes)?

@cfallin cfallin merged commit 906a053 into bytecodealliance:main Sep 20, 2022
@cfallin cfallin mentioned this pull request Sep 20, 2022
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.
@cfallin cfallin mentioned this pull request Sep 21, 2022
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.
@Amanieu Amanieu deleted the spillslot-class branch November 24, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type confusion between Int and Float in the move resolver

2 participants