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

pulley: Fix regalloc of return-call-indirect #10021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexcrichton
Copy link
Member

This commit fixes an issue in the Pulley backend for the return_call_indirect implementation. This brings Pulley in line with other backends to use a fixed register for the indirect call location which is caller-save instead of possibly using a callee-save register. If a callee-save-register is used then the location to be jumped to is clobbered by register restores and won't have the correct location to jump to.

This additionally required updating the Pulley ABI slightly. Previously all caller-saved registers were considered argument registers meaning that there weren't any actual available registers to use for the jump destination. To handle this I've decreased the number of argument registers by 1 so there's a single register used for the return-call-indirect destination available which is also caller-saved.

This commit fixes an issue in the Pulley backend for the
`return_call_indirect` implementation. This brings Pulley in line with
other backends to use a fixed register for the indirect call location
which is caller-save instead of possibly using a callee-save register.
If a callee-save-register is used then the location to be jumped to is
clobbered by register restores and won't have the correct location to
jump to.

This additionally required updating the Pulley ABI slightly. Previously
all caller-saved registers were considered argument registers meaning
that there weren't any actual available registers to use for the jump
destination. To handle this I've decreased the number of argument
registers by 1 so there's a single register used for the
return-call-indirect destination available which is also caller-saved.
@alexcrichton alexcrichton added the fuzz-bug Bugs found by a fuzzer label Jan 15, 2025
@alexcrichton alexcrichton requested review from a team as code owners January 15, 2025 01:45
@alexcrichton alexcrichton requested review from abrown and removed request for a team January 15, 2025 01:45
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator pulley Issues related to the Pulley interpreter labels Jan 15, 2025
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "cranelift", "fuzz-bug", "pulley"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

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 fuzz-bug Bugs found by a fuzzer pulley Issues related to the Pulley interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant