eleviant wrote:

> As I understand it, the reason to extend the size of the argument is to 
> maintain the 8-byte alignment of the stack, and when passing in registers, 
> there's no register that contains more than one composite type.

This condition seems to be enforced by backend allocating slot of minimum 8 
bytes in size, no matter what size does integer argument have in IR. BTW, this 
patch https://reviews.llvm.org/D100591 already does the same for return values
 
> If the code here maintains the AAPCS rules then no objections from me. I'm 
> not sufficiently familiar with code to check that, will need someone more 
> familiar with clang to approve.

As per rule C.16 in 
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#682parameter-passing-rules

```
If the size of the argument is less than 8 bytes then the size of the argument 
is set to 8 bytes. The effect is as if the argument was copied to the least 
significant bits of a 64-bit register and the remaining bits filled with 
unspecified values.
```
So I think we still follow the rules for small composites, even if we narrow 
down arguments in IR.


https://github.com/llvm/llvm-project/pull/215264
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to