[llvm] [AArch64][SME2] Preserve ZT0 state around function calls (PR #78321)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 05:43:55 PST 2024


================
@@ -0,0 +1,165 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme2 -start-after=simplifycfg -enable-tail-merge=false -verify-machineinstrs < %s | FileCheck %s
+
+; Callee with no ZT state
+declare void @no_state_callee();
+
+; Callees with ZT0 state
+declare void @zt0_shared_callee() "aarch64_in_zt0";
+declare void @zt0_new_callee() "aarch64_new_zt0";
+
+; Callees with ZA state
+
+declare void @za_shared_callee() "aarch64_pstate_za_shared";
+declare void @za_zt0_shared_callee() "aarch64_pstate_za_shared" "aarch64_in_zt0";
----------------
sdesmalen-arm wrote:

Sorry I didn't spot this earlier, but you can create a single `declare void @callee()` and then add the attributes on the callsite. That avoids the need for all thees declarations.

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


More information about the llvm-commits mailing list