[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:12:10 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.


================
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).
As for RT_AllRegs, you are probably right. Currently we do not really use this convention on AArch64, it was implemented more for a sake of completeness. 

But may be indeed, we should add x15 and the high half of vector registers and the argument registers there. 


http://reviews.llvm.org/D17996





More information about the llvm-commits mailing list