[llvm] [clang] New calling convention preserve_none (PR #76868)
James Y Knight via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 16:16:27 PST 2024
================
@@ -1056,6 +1056,23 @@ def CC_Intel_OCL_BI : CallingConv<[
CCDelegateTo<CC_X86_32_C>
]>;
+def CC_X86_64_Preserve_None : CallingConv<[
+ // We don't preserve general registers, so all of them can be used to pass
+ // arguments except
+ // - RBP frame pointer
+ // - R10 'nest' parameter
+ // - RBX base pointer
+ // - R16 - R31 these are not available everywhere
+ CCIfType<[i32], CCAssignToReg<[EDI, ESI, EDX, ECX, R8D, R9D,
+ R11D, R12D, R13D, R14D, R15D, EAX]>>,
+
+ CCIfType<[i64], CCAssignToReg<[RDI, RSI, RDX, RCX, R8, R9,
+ R11, R12, R13, R14, R15, RAX]>>,
+
+ // Otherwise it's the same as the regular C calling convention.
+ CCDelegateTo<CC_X86_64_C>
----------------
jyknight wrote:
This delegation seems questionable -- what about the interaction with the swift attributes which use dedicated registers in CC_X86_64_C, which you're now also using for normal parameters?
https://github.com/llvm/llvm-project/pull/76868
More information about the llvm-commits
mailing list