-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cranelift: Support callee-saved registers with tail calls on x64 #8246
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
elliottt
merged 12 commits into
bytecodealliance:main
from
elliottt:trevor/copy-callee-saves
Mar 27, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eff3018
Add GrowFrame and ShrinkFrame instructions for moving the frame
elliottt fe39506
Experimentally emit grow/shrink frame instructions for x64 tail calls
elliottt f766d21
Reuse the epilogue generation functions for tail call emission
elliottt 5204d6b
Enable callee saves with the tail calling convention on x64
elliottt 2f6131a
Remove the requirement that indirect calls go through r15 with the ta…
elliottt 8597592
Stop using r14 for a temporary during the stack check with the tail cc
elliottt ff1c5e1
Apply suggestions from code review
elliottt 90545c5
Remove constants in favor of reusing values computed for FrameLayout
elliottt dd4b4c3
Suggestions from review
elliottt 20702a0
Rename the grow/shrink frame instructions, and adjust their comments
elliottt 16b9655
Comments on ArgLoc
elliottt 5917714
Add more tests for return_call, and fix grow/shrink arg area printing
elliottt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -541,6 +541,23 @@ | |
| (ReturnCallUnknown (callee RegMem) | ||
| (info BoxReturnCallInfo)) | ||
|
|
||
| ;; GrowArgumentArea does a memmove of everything in the frame except for | ||
| ;; the argument area, to make room for more arguments. That includes all | ||
| ;; the stack slots, the callee-saved registers, and the saved FP and | ||
| ;; return address. To keep the stack pointers in sync with that change, | ||
| ;; it also subtracts the given amount from both the FP and SP registers. | ||
| (GrowArgumentArea (amount u32) | ||
| (tmp WritableGpr)) | ||
|
|
||
| ;; ShrinkArgumentArea does a memmove of everything in the frame except | ||
| ;; for the argument area, to trim space for fewer arguments. That | ||
| ;; includes all the stack slots, the callee-saved registers, and the | ||
| ;; saved FP and return address. To keep the stack pointers in sync with | ||
| ;; that change, it also adds the given amount to both the FP and SP | ||
| ;; registers. | ||
| (ShrinkArgumentArea (amount u32) | ||
| (tmp WritableGpr)) | ||
|
Comment on lines
+544
to
+559
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These comments are fantastic -- thanks! |
||
|
|
||
| ;; A pseudo-instruction that captures register arguments in vregs. | ||
| (Args | ||
| (args VecArgPair)) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.