[PATCH] D40876: AArch64: Fix emergency spillslot being out of reach for large callframes

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 15:10:57 PST 2017


MatzeB added a comment.

In https://reviews.llvm.org/D40876#958718, @gberry wrote:

> In https://reviews.llvm.org/D40876#958683, @gberry wrote:
>
> > One thing I noticed when looking at this: it seems fragile to me to have MachineFrameInfo::computeMaxCallFrameSize() and PEI::calculateFrameInfo() doing essentially the same calculation with duplicated code.
> >  Would it make sense to add an assert to PEI::calculateFrameInfo that checks that the previously calculated MaxCallFrameSize isn't smaller than the one calculated later?
>
>
> After thinking about this some more, adding this assert doesn't make much sense, since e.g. spilling will increase the MaxCallFrameSize.  Speaking of which, don't we still have a problem if e.g. spilling puts us over the large frame size threshold?


Spilling is no problem as the emergency spillslot is placed last in the stackframe (when doing SP relative access). The problem with callframe is just that they have to come after the stackframe. With this change the problematice cases are switched to use a frame pointer which means we will move the emergency spillslot to the beginning of the stackframe where it will always be in reach for the FP.


Repository:
  rL LLVM

https://reviews.llvm.org/D40876





More information about the llvm-commits mailing list