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

[flang2] byval and sret attributes should have associated types #1420

Merged

Conversation

bryanpkc
Copy link
Collaborator

@bryanpkc bryanpkc commented Sep 20, 2023

When the return value of the function is a structure, the ABI might require that the caller pass the structure into the function call as an implicit input argument; in such cases the generated IR for the argument will have the sret attribute. Similarly, pass-by-value arguments are given the byval attribute in the IR. Since the adoption of opaque pointers, such attributes are required to be accompanied with the pointee type. This patch fixes flang2 to generate correct IR for such argument/return types.

Fixes #1419.

@bryanpkc bryanpkc force-pushed the fix-byval-sret-attributes branch 3 times, most recently from 6a97a84 to f8fa3a7 Compare September 21, 2023 08:56
When the return value of the function is a structure, the ABI might require
that the caller pass the structure into the function call as an implicit
input argument; in such cases the generated IR for the argument will
have the sret attribute. Similarly, pass-by-value arguments are given
the byval attribute in the IR. Since the adoption of opaque pointers,
such attributes are required to be accompanied with the pointee type. This
patch fixes flang2 to generate correct IR for such argument/return types.

Co-authored-by: Liuyunlong <liuyunlong16@huawei.com>
@bryanpkc
Copy link
Collaborator Author

@pawosm-arm @shivaramaarao This is ready for review.

@pawosm-arm pawosm-arm self-requested a review September 23, 2023 12:55
@bryanpkc
Copy link
Collaborator Author

@shivaramaarao gentle ping

@bryanpkc bryanpkc merged commit a273117 into flang-compiler:master Sep 28, 2023
6 checks passed
@bryanpkc bryanpkc mentioned this pull request Sep 28, 2023
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.

error: expected '('
3 participants