[PATCH] D17996: Add support for preserve_most/preserve_all calling conventions to the AArch64 backend.

Roman Levenstein via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 11:15:50 PST 2016


swiftix added inline comments.

================
Comment at: lib/Target/AArch64/AArch64CallingConvention.td:314-315
@@ +313,4 @@
+
+def CSR_AArch64_RT_MostRegs :  CalleeSavedRegs<(add CSR_AArch64_AAPCS,
+                                                (sequence "X%u", 9, 14))>;
+
----------------
t.p.northover wrote:
> I think some more comments on the choices here would be useful. Obviously you can't preserve x16 or x17 because the linker may use them to resolve a PLT call, and x18 is the platform register on Darwin.
> 
> But you're excluding x15 too, which makes "RT_AllRegs" increasingly misnamed (it also excludes the high half of vector registers and the argument registers).
x15 was excluded, because AArch64 backend seems to need pairs of registers, when it store/restores them in the epilogue. With x15 included, we get an odd number of registers to store/restore, which triggers an assertion in the backend.

The argument registers were not included (yet), because LLVM seems to have problems in situations, where a set of callee-saved registers overlaps with the sets of argument/return registers. In particular, it led the incorrect code being produced, when functions using these new calling conventions call each other or are using tail calls. I've filed a couple of radars about it, but they are not resolved yet.



http://reviews.llvm.org/D17996





More information about the llvm-commits mailing list