@@ -107,13 +107,22 @@ AArch64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
107107 if (MF->getFunction ().getCallingConv () ==
108108 CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
109109 report_fatal_error (
110- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
111- " only supported to improve calls to SME ACLE save/restore/disable-za "
110+ " Calling convention "
111+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is only "
112+ " supported to improve calls to SME ACLE save/restore/disable-za "
112113 " functions, and is not intended to be used beyond that scope." );
114+ if (MF->getFunction ().getCallingConv () ==
115+ CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
116+ report_fatal_error (
117+ " Calling convention "
118+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1 is "
119+ " only supported to improve calls to SME ACLE __arm_get_current_vg "
120+ " function, and is not intended to be used beyond that scope." );
113121 if (MF->getFunction ().getCallingConv () ==
114122 CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
115123 report_fatal_error (
116- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
124+ " Calling convention "
125+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
117126 " only supported to improve calls to SME ACLE __arm_sme_state "
118127 " and is not intended to be used beyond that scope." );
119128 if (MF->getSubtarget <AArch64Subtarget>().getTargetLowering ()
@@ -153,13 +162,22 @@ AArch64RegisterInfo::getDarwinCalleeSavedRegs(const MachineFunction *MF) const {
153162 if (MF->getFunction ().getCallingConv () ==
154163 CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
155164 report_fatal_error (
156- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
165+ " Calling convention "
166+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
157167 " only supported to improve calls to SME ACLE save/restore/disable-za "
158168 " functions, and is not intended to be used beyond that scope." );
169+ if (MF->getFunction ().getCallingConv () ==
170+ CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
171+ report_fatal_error (
172+ " Calling convention "
173+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1 is "
174+ " only supported to improve calls to SME ACLE __arm_get_current_vg "
175+ " function, and is not intended to be used beyond that scope." );
159176 if (MF->getFunction ().getCallingConv () ==
160177 CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
161178 report_fatal_error (
162- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
179+ " Calling convention "
180+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
163181 " only supported to improve calls to SME ACLE __arm_sme_state "
164182 " and is not intended to be used beyond that scope." );
165183 if (MF->getFunction ().getCallingConv () == CallingConv::CXX_FAST_TLS)
@@ -236,6 +254,8 @@ AArch64RegisterInfo::getDarwinCallPreservedMask(const MachineFunction &MF,
236254 " Calling convention SVE_VectorCall is unsupported on Darwin." );
237255 if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
238256 return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0_RegMask;
257+ if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
258+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1_RegMask;
239259 if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
240260 return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2_RegMask;
241261 if (CC == CallingConv::CFGuard_Check)
@@ -282,6 +302,8 @@ AArch64RegisterInfo::getCallPreservedMask(const MachineFunction &MF,
282302 : CSR_AArch64_SVE_AAPCS_RegMask;
283303 if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
284304 return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0_RegMask;
305+ if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
306+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1_RegMask;
285307 if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
286308 return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2_RegMask;
287309 if (CC == CallingConv::CFGuard_Check)
@@ -643,6 +665,7 @@ bool AArch64RegisterInfo::isArgumentRegister(const MachineFunction &MF,
643665 case CallingConv::AArch64_VectorCall:
644666 case CallingConv::AArch64_SVE_VectorCall:
645667 case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0:
668+ case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1:
646669 case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2:
647670 if (STI.isTargetWindows ())
648671 return HasReg (CC_AArch64_Win64PCS_ArgRegs, Reg);
0 commit comments