Skip to content

Conversation

@saulecabrera
Copy link
Member

Fixes: #8848

Similar to all the control instructions, any state must be explicitly saved before emitting the code for br_if.

This commit ensures that live locals and registers are explicilty saved before emitting the code for br_if. Prior to this commit, live locals and registers were not saved every time causing incorrect behavior in cases where the calculation of the conditional argument didn't trigger a spill.

This change introduces the explicit spill after calculating the branch condition argument to minimize memory traffic in case the conditional is already in a register.

Fixes: bytecodealliance#8848

Similar to all the control instructions, any state must be explicitly
saved before emitting the code for `br_if`.

This commit ensures that live locals and registers are explicilty saved
before emitting the code for `br_if`. Prior to this commit, live
locals and registers were not saved every time causing incorrect
behavior in cases where the calculation of the conditional argument
didn't trigger a spill.

This change introduces the explicit spill after calculating the branch
condition argument to minimize memory traffic in case the conditional is
already in a register.
@saulecabrera saulecabrera requested review from a team as code owners June 28, 2024 16:30
@saulecabrera saulecabrera requested review from abrown and fitzgen and removed request for a team June 28, 2024 16:30
@saulecabrera saulecabrera changed the title Save state before emitting br_if winch: Save state before emitting br_if Jun 28, 2024
@fitzgen fitzgen added this pull request to the merge queue Jun 28, 2024
Merged via the queue into bytecodealliance:main with commit 8fc4186 Jun 28, 2024
@saulecabrera saulecabrera deleted the save-state-before-br_if branch June 28, 2024 18:30
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.

Winch: Assertion failure with saturating conversion instructions

2 participants