aarch64: fix apple_aarch64 stack slot size for sext/uext spilled args - #14235
Conversation
|
If I understand this right, you are asserting that the Apple aarch64 convention actually does 8-align args just because they are extended to 64 bits (in registers). That doesn't sound right to me but I'm happy to be corrected; could you link the documentation you're using as a reference for this change? Thanks! (If the extension only applies to in-register values instead, as I suspect, then the correct fix is instead to do narrow (true-width) loads/stores when values live on the stack, I think.) |
c6bf9ee to
a5120cd
Compare
5b858ab to
6dc6bd1
Compare
|
you're right. The extension should only apply to registers. get_ext_mode didn't know the location though, so it was forcing 8-byte loads/stores for anything extended. I've updated the PR to thread an ABIArgLocation into get_ext_mode so we can correctly return None for stack args on apple AArch64. I also added a precise-output test for it. |
|
Thanks! I'll repeat a question from earlier:
Both for my own use and ideally linked in a comment so we can have a canonical source going forward. |
6dc6bd1 to
e61cf2e
Compare
Fixes #13973
For
apple_aarch64,get_ext_modereturns specified extensions (sext/uext), which causes caller/callee to load and store full 64-bit words for stack arguments. The slot size condition previously allowed sub-word sizes for spilled arguments wheneverargs_or_rets == Args, causing 8-byte stores to overwrite adjacent stack slots.This updates the check to only allow sub-word stack slots when
param.extension == None.