-
Notifications
You must be signed in to change notification settings - Fork 140
[CIR][ABI][AArch64][Lowering] support for passing struct types > 128 bits #1068
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
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
@bzcheeseman: @gitoleg has also been working on aarch64 in case you want to follow / also provide insights. |
If you can do that it would be great, will make everyone's life easier when trying to reach completeness |
Actually |
…bits (#1068) This PR adds a partial support for so-called indirect function arguments for struct types with size > 128 bits for aarch64. #### Couple words about the implementation The hard part is that it's not one-to-one copy from the original codegen, but the code is inspired by it of course. In the original codegen there is no much job is done for the indirect arguments inside the loop in the `EmitFunctionProlog`, and additional alloca is added in the end, in the call for `EmitParamDecl` function. In our case, for the indirect argument (which is a pointer) we replace the original alloca with a new one, and store the pointer in there. And replace all the uses of the old alloca with the load from the new one, i.e. in both cases users works with the pointer to a structure. Also, I added several missed features in the `constructAttributeList` for indirect arguments, but didn't preserve the original code structure, so let me know if I need to do it.
This PR adds a partial support for so-called indirect function arguments for struct types with size > 128 bits for aarch64.
Couple words about the implementation
The hard part is that it's not one-to-one copy from the original codegen, but the code is inspired by it of course.
In the original codegen there is no much job is done for the indirect arguments inside the loop in the
EmitFunctionProlog
, and additional alloca is added in the end, in the call forEmitParamDecl
function.In our case, for the indirect argument (which is a pointer) we replace the original alloca with a new one, and store the pointer in there. And replace all the uses of the old alloca with the load from the new one, i.e. in both cases users works with the pointer to a structure.
Also, I added several missed features in the
constructAttributeList
for indirect arguments, but didn't preserve the original code structure, so let me know if I need to do it.