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

JIT: Add support for struct returns from Swift reverse pinvokes #100091

Merged
merged 37 commits into from
Mar 23, 2024

Conversation

jakobbotsch
Copy link
Member

Update the 10 tests to have some struct returns as well.

We also have to change the prestub to save rax since it's used as a register for the ret buffer in Swift calls.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 21, 2024
@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr jitstressregs, runtime-coreclr jitstress2-jitstressregs

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jakobbotsch jakobbotsch marked this pull request as ready for review March 22, 2024 12:37
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @amanasifkhalid

Failures look like #99810 and other known failures

FYI @jkurdek @kotlarmilos @matouskozak

Copy link
Member

@amanasifkhalid amanasifkhalid left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

{
printf("Swift compilation returns %s as %d primitive(s) in registers\n",
typGetObjLayout(retTypeHnd)->GetClassName(), lowering->numLoweredElements);
for (size_t i = 0; i < lowering->numLoweredElements; i++)
Copy link
Member

Choose a reason for hiding this comment

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

I think we dump these lowered element types in a few places now, right? You may want to consider moving this logic to a helper method (though feel free to do that in a future PR).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. Makes sense to factor this, let me do that in a follow-up.

@jakobbotsch
Copy link
Member Author

Also FYI @jkoritzinsky and cc @jkotas for the stub change.

jakobbotsch and others added 2 commits March 22, 2024 20:59
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@jkotas
Copy link
Member

jkotas commented Mar 22, 2024

The stub change LGTM

@jakobbotsch
Copy link
Member Author

/azp run runtime

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch jakobbotsch merged commit d981ed9 into dotnet:main Mar 23, 2024
116 checks passed
@jakobbotsch jakobbotsch deleted the swift-callback-struct-returns branch March 23, 2024 19:15
@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants