[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 8 15:56:16 PDT 2024
================
@@ -494,6 +494,29 @@ def CC_AArch64_GHC : CallingConv<[
CCIfType<[i64], CCAssignToReg<[X19, X20, X21, X22, X23, X24, X25, X26, X27, X28]>>
]>;
+let Entry = 1 in
+def CC_AArch64_Preserve_None : CallingConv<[
+ // We only preserve:
+ // - X18, which is used for the 'nest' parameter.
+ // - X29, the frame pointer
+ // - X30, the link register
+ // All other registers can be used to pass arguments.
+ // Non-volatile registers are used first, so functions may call
+ // normal functions without saving and reloading arguments.
+ CCIfType<[i32], CCAssignToReg<[W19, W20, W21, W22, W23,
+ W24, W25, W26, W27, W28,
+ W0, W1, W2, W3, W4, W5,
+ W6, W7, W8, W9, W10, W11,
+ W12, W13, W14, W15, W16, W17]>>,
+ CCIfType<[i64], CCAssignToReg<[X19, X20, X21, X22, X23,
+ X24, X25, X26, X27, X28,
+ X0, X1, X2, X3, X4, X5,
+ X6, X7, X8, X9, X10, X11,
----------------
weiguozhi wrote:
X8 is used to pass SRet parameter in AArch64_Common, so it can not be used as a general argument register.
https://github.com/llvm/llvm-project/pull/91046
More information about the cfe-commits
mailing list