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

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 13:42:20 PST 2018

gberry added a comment.

I'm not sure using the redzone is safe on all targets.

Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:213
+  // DefaultSafeSPDisplacement is fine as we only emergency spill GP regs.
+  if (!MFI.isMaxCallFrameSizeComputed() ||
+      MFI.getMaxCallFrameSize() > DefaultSafeSPDisplacement)
efriedma wrote:
> isMaxCallFrameSizeComputed() is false until after register allocation, right?  That means register allocation will never allocate a value into the frame pointer register.  This needs better comments, and I'm not sure we want to unconditionally reserve the frame pointer register just to fix an obscure bug with very large call frames.
Part of this change is to call computeMaxCallFrameSize() from finalizeLowering() (called at the end of ISel), so I don't think this is a problem?


More information about the llvm-commits mailing list