[PATCH] D53962: [COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 17:55:23 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:5238
+    ReturnAddrIndex =
+      MF.getFrameInfo().CreateFixedObject(SlotSize, -(uint64_t)SlotSize, false);
+    FI->setRAIndex(ReturnAddrIndex);
----------------
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.


https://reviews.llvm.org/D53962





More information about the llvm-commits mailing list