aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmara Emerson <amara@apple.com>2024-05-15 14:38:18 -0700
committerAmara Emerson <amara@apple.com>2024-05-15 14:47:17 -0700
commit1daa7fd3fadd17e61d9dfa56f84228617c5514d9 (patch)
treedd76739e3fe23bf0bb05cb699b53a4c3e0adfc76
parent8530b1c464ae9af4a5c8be145a8db043798634f6 (diff)
downloadllvm-1daa7fd3fadd17e61d9dfa56f84228617c5514d9.zip
llvm-1daa7fd3fadd17e61d9dfa56f84228617c5514d9.tar.gz
llvm-1daa7fd3fadd17e61d9dfa56f84228617c5514d9.tar.bz2
[AArch64][SME] Remove Darwin compile error for ABI support routine calls.
These are allowed for Darwin and use the same ABI.
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp8
-rw-r--r--llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll12
2 files changed, 14 insertions, 6 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
index 5a5a18e..d82fa39 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
@@ -233,13 +233,9 @@ AArch64RegisterInfo::getDarwinCallPreservedMask(const MachineFunction &MF,
report_fatal_error(
"Calling convention SVE_VectorCall is unsupported on Darwin.");
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
- report_fatal_error(
- "Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
- "unsupported on Darwin.");
+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0_RegMask;
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
- report_fatal_error(
- "Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
- "unsupported on Darwin.");
+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2_RegMask;
if (CC == CallingConv::CFGuard_Check)
report_fatal_error(
"Calling convention CFGuard_Check is unsupported on Darwin.");
diff --git a/llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll b/llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll
index d88deec..7535638 100644
--- a/llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll
+++ b/llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll
@@ -1,5 +1,7 @@
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-apple-darwin -mattr=+sme -verify-machineinstrs < %s | FileCheck %s --check-prefix=DARWIN
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs -stop-after=finalize-isel < %s | FileCheck %s --check-prefix=CHECK-CSRMASK
+; RUN: llc -mtriple=aarch64-apple-darwin -mattr=+sme -verify-machineinstrs -stop-after=finalize-isel < %s | FileCheck %s --check-prefix=CHECK-CSRMASK
; Test that the PCS attribute is accepted and uses the correct register mask.
;
@@ -11,6 +13,11 @@ define void @test_sme_calling_convention_x0() nounwind {
; CHECK-NEXT: bl __arm_tpidr2_save
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT: ret
+; DARWIN-LABEL: test_sme_calling_convention_x0:
+; DARWIN: stp x29, x30, [sp, #-16]!
+; DARWIN: bl ___arm_tpidr2_save
+; DARWIN: ldp x29, x30, [sp], #16
+; DARWIN: ret
;
; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x0
; CHECK-CSRMASK: BL @__arm_tpidr2_save, csr_aarch64_sme_abi_support_routines_preservemost_from_x0
@@ -25,6 +32,11 @@ define i64 @test_sme_calling_convention_x2() nounwind {
; CHECK-NEXT: bl __arm_sme_state
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT: ret
+; DARWIN-LABEL: test_sme_calling_convention_x2:
+; DARWIN: stp x29, x30, [sp, #-16]!
+; DARWIN: bl ___arm_sme_state
+; DARWIN: ldp x29, x30, [sp], #16
+; DARWIN: ret
;
; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x2
; CHECK-CSRMASK: BL @__arm_sme_state, csr_aarch64_sme_abi_support_routines_preservemost_from_x2