Skip to content

Avoid copying the frame for tail calls on aarch64#8377

Merged
elliottt merged 3 commits intobytecodealliance:mainfrom
elliottt:trevor/tail-calls-aarch64
Apr 16, 2024
Merged

Avoid copying the frame for tail calls on aarch64#8377
elliottt merged 3 commits intobytecodealliance:mainfrom
elliottt:trevor/tail-calls-aarch64

Conversation

@elliottt
Copy link
Member

@elliottt elliottt commented Apr 16, 2024

To mirror the implementation in the x64 backend, switch to eagerly reserving enough space in the incoming argument area for any tail call present in the function being compiled.

NOTE: this doesn't make the change to enable callee-save registers with the tail calling convention on aarch64, but that will be a relatively small change following this PR.

Co-authored-by: Jamey Sharp jsharp@fastly.com

To mirror the implementation in the x64 backend, switch to eagerly
reserving enough space in the incoming argument area for any tail call
present in the function being compiled.

prtest:macos-arm64

Co-authored-by: Jamey Sharp <jsharp@fastly.com>
@elliottt elliottt force-pushed the trevor/tail-calls-aarch64 branch from a935de5 to 3b1c6f2 Compare April 16, 2024 00:53
@elliottt elliottt marked this pull request as ready for review April 16, 2024 00:56
@elliottt elliottt requested a review from a team as a code owner April 16, 2024 00:56
@elliottt elliottt requested review from fitzgen and removed request for a team April 16, 2024 00:56
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:aarch64 Issues related to AArch64 backend. isle Related to the ISLE domain-specific language labels Apr 16, 2024
@github-actions
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

Details This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:machinst", "isle"

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

  • cfallin: isle
  • fitzgen: isle

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

Learn more.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Nice!

@elliottt elliottt added this pull request to the merge queue Apr 16, 2024
Merged via the queue into bytecodealliance:main with commit 27b8afc Apr 16, 2024
@elliottt elliottt deleted the trevor/tail-calls-aarch64 branch April 16, 2024 17:23
jameysharp added a commit to jameysharp/wasmtime that referenced this pull request Apr 18, 2024
This reverts the key parts of e3a08d4
(bytecodealliance#8151), because it turns out that we didn't need that abstraction.

Several changes in the last month have enabled this:

- bytecodealliance#8292 and then bytecodealliance#8316 allow us to refer to either incoming or outgoing
  argument areas in a (mostly) consistent way

- bytecodealliance#8327, bytecodealliance#8377, and bytecodealliance#8383 demonstrate that we never need to delay
  writing stack arguments directly to their final location
jameysharp added a commit to jameysharp/wasmtime that referenced this pull request Apr 18, 2024
This reverts the key parts of e3a08d4
(bytecodealliance#8151), because it turns out that we didn't need that abstraction.

Several changes in the last month have enabled this:

- bytecodealliance#8292 and then bytecodealliance#8316 allow us to refer to either incoming or outgoing
  argument areas in a (mostly) consistent way

- bytecodealliance#8327, bytecodealliance#8377, and bytecodealliance#8383 demonstrate that we never need to delay
  writing stack arguments directly to their final location

prtest:full
github-merge-queue bot pushed a commit that referenced this pull request Apr 18, 2024
This reverts the key parts of e3a08d4
(#8151), because it turns out that we didn't need that abstraction.

Several changes in the last month have enabled this:

- #8292 and then #8316 allow us to refer to either incoming or outgoing
  argument areas in a (mostly) consistent way

- #8327, #8377, and #8383 demonstrate that we never need to delay
  writing stack arguments directly to their final location

prtest:full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants