[PATCH] D53962: [COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic
Mandeep Singh Grang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 31 17:59:48 PDT 2018
mgrang added inline comments.
================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:5238
+ ReturnAddrIndex =
+ MF.getFrameInfo().CreateFixedObject(SlotSize, -(uint64_t)SlotSize, false);
+ FI->setRAIndex(ReturnAddrIndex);
----------------
efriedma wrote:
> This won't work for a varags function; in that case, this would point to the spill of r7, not lr. Maybe it would be more straightforward to just compute it as FP+8?
>
> I think you need to call `MFI.setFrameAddressIsTaken(true);` or something like that to ensure lr is spilled.
MSVC always seem to generate: ldr lr,[sp],#0x10
https://reviews.llvm.org/D53962
More information about the llvm-commits
mailing list