[clang] [llvm] New calling convention preserve_none (PR #76868)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 09:06:31 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
----------------
jyknight wrote:

They should not be used to pass arguments conditionally based on the current subtarget, since that creates two incompatible calling conventions.

There's no reason "preserve none" has to be read to imply "uses all possible registers to pass arguments.", so I don't see an issue with leaving it like it is.

https://github.com/llvm/llvm-project/pull/76868


More information about the cfe-commits mailing list