[PATCH] D124841: [PowerPC] Stash GPR to VSR if emergency spill slot is not reachable
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 8 13:35:48 PDT 2022
efriedma added a comment.
In D124841#3499199 <https://reviews.llvm.org/D124841#3499199>, @nemanjai wrote:
> In D124841#3489679 <https://reviews.llvm.org/D124841#3489679>, @efriedma wrote:
>
>>> If such an emergency spill also needs to be spilled to a location with a large offset
>>
>> This shouldn't happen; the emergency spill slot should be placed in a location with a small offset from the frame/stack pointer.
>>
>> If it's impossible to allocate an emergency spill slot close to the stack pointer, I think we should force a frame pointer, and the emergency spill slot should be allocated close to that. See, for example, AArch64FrameLowering::hasFP().
>
> That certainly works in cases where the problem is a dynamic allocation in the stack frame. However, the issue here is that the fixed stack part of the frame (i.e. the parameter save area mandated by the ABI) is so large that all stack allocations are more than 32kB away from the stack pointer.
Are you saying that even though we have a frame pointer, it's impossible to allocate a stack slot close to the frame pointer? That seems unlikely to me; normal stack layout rules should allow allocating as much space as we need close to the frame pointer. Depending on how the stack is laid out, I guess it's possible that normal spill slots are never close enough to the frame pointer. But if we really need it, we could allocate the emergency spill slot next to the callee-saved registers. (This currently isn't implemented, but shouldn't be complicated.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124841/new/
https://reviews.llvm.org/D124841
More information about the llvm-commits
mailing list