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

Missing support for GCC's attribute access (IR attributes with size index?) #54312

Open
davidbolvansky opened this issue Mar 9, 2022 · 4 comments

Comments

@davidbolvansky
Copy link
Collaborator

davidbolvansky commented Mar 9, 2022

https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes

access (access-mode, ref-index)
access (access-mode, ref-index, size-index)

The access attribute specifies that a function to whose by-reference arguments the attribute applies accesses the referenced object according to access-mode. The access-mode argument is required and must be one of four names: read_only, read_write, write_only, or none. The remaining two are positional arguments.

We have IR attributes read_only and write_only, so mapping for these two modes could be easy. In terms of size-index, maybe we could extend existing IR attributes to optionally take size-index?

cc @jdoerfert (IR attributes)
cc @fhahn (DSE)
cc @nikic (Rust side; can this generalization of IR attributes be useful for Rust?)

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 9, 2022

@llvm/issue-subscribers-clang-codegen

@davidbolvansky
Copy link
Collaborator Author

cc @nickdesaulniers for usage in Linux kernel..

@jdoerfert
Copy link
Member

I would recommend not to add size to the existing ones but instead replace them as whole. That said, mapping all but the size argument to existing ones would be great and pretty straight forward (IMHO).

@kees
Copy link
Contributor

kees commented Sep 23, 2022

I would love to start using this for the Linux kernel. Tracking it here: KSPP/linux#208
cc @gwelymernans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants