[llvm] [AArch64][SME] Remove a couple of unused functions (NFC) (PR #192649)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 06:21:46 PDT 2026


https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/192649

Follow up to https://github.com/llvm/llvm-project/pull/190950

>From ddbb43351ed386eb01f0f56b6ae7996c02581b5f Mon Sep 17 00:00:00 2001
From: Benjamin Maxwell <benjamin.maxwell at arm.com>
Date: Thu, 16 Apr 2026 19:03:40 +0000
Subject: [PATCH] [AArch64][SME] Remove a couple of unused functions (NFC)

Follow up to https://github.com/llvm/llvm-project/pull/190950
---
 .../lib/Target/AArch64/AArch64SMEAttributes.h |  9 --------
 .../Target/AArch64/SMEAttributesTest.cpp      | 23 ++++++++-----------
 2 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64SMEAttributes.h b/llvm/lib/Target/AArch64/AArch64SMEAttributes.h
index a01333087594a..58381a9a75bf2 100644
--- a/llvm/lib/Target/AArch64/AArch64SMEAttributes.h
+++ b/llvm/lib/Target/AArch64/AArch64SMEAttributes.h
@@ -194,15 +194,6 @@ class SMECallAttrs {
            !callee().hasAgnosticZAInterface();
   }
 
-  bool requiresDisablingZABeforeCall() const {
-    return caller().hasZT0State() && !caller().hasZAState() &&
-           callee().hasPrivateZAInterface() && !callee().isSMEABIRoutine();
-  }
-
-  bool requiresEnablingZAAfterCall() const {
-    return requiresDisablingZABeforeCall();
-  }
-
   bool requiresPreservingAllZAState() const {
     return caller().hasAgnosticZAInterface() &&
            !callee().hasAgnosticZAInterface() && !callee().isSMEABIRoutine();
diff --git a/llvm/unittests/Target/AArch64/SMEAttributesTest.cpp b/llvm/unittests/Target/AArch64/SMEAttributesTest.cpp
index f628755c4426f..c98405e4aea23 100644
--- a/llvm/unittests/Target/AArch64/SMEAttributesTest.cpp
+++ b/llvm/unittests/Target/AArch64/SMEAttributesTest.cpp
@@ -230,8 +230,7 @@ TEST(SMEAttributes, Transitions) {
   // Normal -> Normal
   ASSERT_FALSE(CA(SA::Normal, SA::Normal).requiresSMChange());
   ASSERT_FALSE(CA(SA::Normal, SA::Normal).requiresPreservingZT0());
-  ASSERT_FALSE(CA(SA::Normal, SA::Normal).requiresDisablingZABeforeCall());
-  ASSERT_FALSE(CA(SA::Normal, SA::Normal).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(SA::Normal, SA::Normal).requiresLazySave());
   // Normal -> Normal + LocallyStreaming
   ASSERT_FALSE(CA(SA::Normal, SA::Normal | SA::SM_Body).requiresSMChange());
 
@@ -287,30 +286,26 @@ TEST(SMEAttributes, Transitions) {
                         SA::encodeZT0State(SA::StateValue::In));
 
   // Shared ZA -> Private ZA Interface
-  ASSERT_FALSE(CA(ZA_Shared, Private_ZA).requiresDisablingZABeforeCall());
-  ASSERT_FALSE(CA(ZA_Shared, Private_ZA).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(ZA_Shared, Private_ZA).requiresPreservingZT0());
+  ASSERT_TRUE(CA(ZA_Shared, Private_ZA).requiresLazySave());
 
   // Shared ZT0 -> Private ZA Interface
-  ASSERT_TRUE(CA(ZT0_Shared, Private_ZA).requiresDisablingZABeforeCall());
   ASSERT_TRUE(CA(ZT0_Shared, Private_ZA).requiresPreservingZT0());
-  ASSERT_TRUE(CA(ZT0_Shared, Private_ZA).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(ZT0_Shared, Private_ZA).requiresLazySave());
 
   // Shared ZA & ZT0 -> Private ZA Interface
-  ASSERT_FALSE(CA(ZA_ZT0_Shared, Private_ZA).requiresDisablingZABeforeCall());
   ASSERT_TRUE(CA(ZA_ZT0_Shared, Private_ZA).requiresPreservingZT0());
-  ASSERT_FALSE(CA(ZA_ZT0_Shared, Private_ZA).requiresEnablingZAAfterCall());
+  ASSERT_TRUE(CA(ZA_ZT0_Shared, Private_ZA).requiresLazySave());
 
   // Shared ZA -> Shared ZA Interface
-  ASSERT_FALSE(CA(ZA_Shared, ZT0_Shared).requiresDisablingZABeforeCall());
-  ASSERT_FALSE(CA(ZA_Shared, ZT0_Shared).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(ZA_Shared, ZT0_Shared).requiresPreservingZT0());
+  ASSERT_FALSE(CA(ZA_Shared, ZT0_Shared).requiresLazySave());
 
   // Shared ZT0 -> Shared ZA Interface
-  ASSERT_FALSE(CA(ZT0_Shared, ZT0_Shared).requiresDisablingZABeforeCall());
   ASSERT_FALSE(CA(ZT0_Shared, ZT0_Shared).requiresPreservingZT0());
-  ASSERT_FALSE(CA(ZT0_Shared, ZT0_Shared).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(ZT0_Shared, ZT0_Shared).requiresLazySave());
 
   // Shared ZA & ZT0 -> Shared ZA Interface
-  ASSERT_FALSE(CA(ZA_ZT0_Shared, ZT0_Shared).requiresDisablingZABeforeCall());
   ASSERT_FALSE(CA(ZA_ZT0_Shared, ZT0_Shared).requiresPreservingZT0());
-  ASSERT_FALSE(CA(ZA_ZT0_Shared, ZT0_Shared).requiresEnablingZAAfterCall());
+  ASSERT_FALSE(CA(ZA_ZT0_Shared, ZT0_Shared).requiresLazySave());
 }



More information about the llvm-commits mailing list