[PATCH] D45358: [AArch64] Use FP to access the emergency spill slot

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 02:47:01 PDT 2018


thegameg created this revision.
thegameg added reviewers: MatzeB, t.p.northover, qcolombet, aemerson, rengolin, eli.friedman, gberry, efriedma.
Herald added subscribers: kristof.beyls, javed.absar.

In the presence of variable-sized stack objects, we always picked the base pointer when resolving frame indices if it was available.

This makes us hit an assert where we can't reach the emergency spill slot if it's too far away from the base pointer. Since on AArch64 we decide to place the emergency spill slot at the top of the frame, it makes more sense to use FP to access it.

The changes here don't affect only emergency spill slots but all the frame indices. The goal here is to try to choose between FP, BP and SP so that we minimize the offset and avoid scavenging, or worse, asserting when trying to access a slot allocated by the scavenger.


https://reviews.llvm.org/D45358

Files:
  lib/Target/AArch64/AArch64FrameLowering.cpp
  test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll
  test/CodeGen/AArch64/unreachable-emergency-spill-slot.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45358.141299.patch
Type: text/x-patch
Size: 4818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180406/e58b33b9/attachment.bin>


More information about the llvm-commits mailing list