Skip to content
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

winch: Save state before emitting br_if #8886

Merged
merged 1 commit into from
Jun 28, 2024

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
36 checks passed
@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