alexcrichton opened PR #9874 from alexcrichton:pulley-callN-instruction
to bytecodealliance:main
:
This commit adds new macro instructions to assist with speeding up calls between functions. Pulley's previous
Call
instruction was similar to native call instructions where arguments/results are implicitly in the right location according to the ABI, but movement between registers is more expensive with Pulley than with native architectures. TheCallN
instructions here enable listing a few arguments (only integer registers) in the opcode itself. This removes the need for individualxmov
instructions into individual registers and instead it can all be done within the opcode handlers.This additionally enables passing the same argument twice to a function to reside only in one register. Finally parallel-copies between these registers are supported as the interpreter loads all registers and then stores all registers.
These new instructions participate in register allocation differently from before where the first few arguments are allowed to be in any register and no longer use
reg_fixed_use
. All other arguments (and all float arguments for example) continue to usereg_fixed_use
.Locally sightglass reports this change speeding up
pulldown-cmark
by 2-10%. On afib(N)
micro-benchmark it didn't help as much as I was hoping that it was going to.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested abrown for a review on PR #9874.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9874.
alexcrichton requested wasmtime-default-reviewers for a review on PR #9874.
github-actions[bot] commented on PR #9874:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "cranelift:meta", "isle", "pulley"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle, pulley
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
fitzgen submitted PR review.
fitzgen created PR review comment:
Do we not have a fallback instruction for the
n >= 5
case?
fitzgen created PR review comment:
Ahhhh, I see what's going on. Argument
i
fori >= 5
are in fixed registers and argumentsi <= 4
go in any register and that is encoded in the call instructions. Clever.
alexcrichton updated PR #9874.
alexcrichton has enabled auto merge for PR #9874.
alexcrichton merged PR #9874.
Last updated: Dec 23 2024 at 12:05 UTC