[llvm] [AArch64] Don't emit stack restore for SME ZA non-sibling tail calls (PR #224721)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 05:05:15 PDT 2026
================
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple arm64-apple-ios -mattr +sme -o - < %s | FileCheck %s
+
+declare void @callee() "aarch64_inout_za"
+
+define void @caller0(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4,
+; CHECK-LABEL: caller0:
+; CHECK: ; %bb.0:
+; CHECK-NEXT: b _callee
+ i64 %5, i64 %6, i64 %7, i64 %8) "aarch64_inout_za" {
+ tail call void @callee() "aarch64_inout_za"
+ ret void
+}
+
+define void @caller1(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4,
+; CHECK-LABEL: caller1:
+; CHECK: ; %bb.0:
+; CHECK-NEXT: b _callee
----------------
MacDue wrote:
You should include a test that has a non-inout-za call before the tail call. That would test that the `inout_za` marker was placed correctly and should result in a ZA restore before the tail call.
Something like:
```
declare void @clobber()
define void @caller_with_clobber(...)
call void @clobber()
tail call void @callee() "aarch64_inout_za"
ret void
}
https://github.com/llvm/llvm-project/pull/224721
More information about the llvm-commits
mailing list