llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
386 stars 98 forks source link

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

Closed bruteforceboy closed 10 hours ago

bruteforceboy commented 6 days ago

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 commented 4 days ago

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.