Skip to content

riscv64: Consider vstate clobbered on calls #11048

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

Merged
merged 3 commits into from
Jun 15, 2025

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Jun 15, 2025

This commit fixes an issue in the riscv64 backend where the tracking for the vector state register was only considered clobbered on the entry to basic blocks as opposed to also after call instructions. This updates the vector state upon encountering these instructions to ensure that after a call the vector state is re-updated in case it was changed by the callee.

Closes #10951
Closes #11033

This commit fixes an issue in the riscv64 backend where the tracking for
the vector state register was only considered clobbered on the entry to
basic blocks as opposed to also after call instructions. This updates
the vector state upon encountering these instructions to ensure that
after a call the vector state is re-updated in case it was changed by
the callee.

Closes bytecodealliance#10951
@alexcrichton alexcrichton requested a review from a team as a code owner June 15, 2025 16:41
@alexcrichton alexcrichton requested review from abrown and removed request for a team June 15, 2025 16:41
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Jun 15, 2025
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Good find! I remember thinking through this emit-state mechanism for vectors initially and I have no idea why we didn't consider the ABI...

@cfallin cfallin added this pull request to the merge queue Jun 15, 2025
Merged via the queue into bytecodealliance:main with commit 0f36d5d Jun 15, 2025
71 checks passed
@alexcrichton alexcrichton deleted the riscv64-clobber-vstate branch June 15, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cranelift: Unexpected illegal instruction on riscv64 Cranelift: Function call causes unexpected value changes on riscv64
2 participants