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

[CIR][ABI][AArch64][Lowering] support for calling struct types in range (64, 128) #1141

Merged
merged 7 commits into from
Nov 25, 2024

Conversation

bruteforceboy
Copy link
Contributor

This PR adds support for the lowering of AArch64 calls with structs having sizes greater than 64 and less than 128.

The idea is from the original CodeGen, where we perform a coercion through memory for these type of calls.

I have added a test for this.

@bruteforceboy bruteforceboy marked this pull request as ready for review November 19, 2024 11:28
Copy link
Collaborator

@smeenai smeenai left a comment

Choose a reason for hiding this comment

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

This is basically the same as #1059 except for argument passing instead of return values, right?

This diff looks fine to me (though I'll give others some time to chime in). For future work I'm wondering if we can unify some of the argument and return paths, but I haven't looked into it very much (and it's not something you need to worry about for this diff).

@bruteforceboy
Copy link
Contributor Author

This is basically the same as #1059 except for argument passing instead of return values, right?

This diff looks fine to me (though I'll give others some time to chime in). For future work I'm wondering if we can unify some of the argument and return paths, but I haven't looked into it very much (and it's not something you need to worry about for this diff).

Yes, you are correct. Actually, in the original CodeGen they are both done in CreateCoercedLoad, and ideally they should be together.

@bruteforceboy bruteforceboy force-pushed the struct-call-65 branch 2 times, most recently from ae76410 to 5d47b2a Compare November 25, 2024 09:05
)

The title describes the purpose of the PR. It adds initial support for
structures with padding to the call convention lowering for AArch64.

I have also _initial support_ for the missing feature
[FinishLayout](https://github.com/llvm/clangir/blob/5c5d58402bebdb1e851fb055f746662d4e7eb586/clang/lib/AST/RecordLayoutBuilder.cpp#L786)
for records, and the logic is gotten from the original codegen.

Finally, I added a test for verification.
@bcardosolopes bcardosolopes merged commit 9ded4f6 into llvm:main Nov 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants