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

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 19 12:48:59 PDT 2026


Author: Benjamin Maxwell
Date: 2026-04-19T20:48:55+01:00
New Revision: 4bd6175f718f032cc391de9263a3d4c14ae5109d

URL: https://github.com/llvm/llvm-project/commit/4bd6175f718f032cc391de9263a3d4c14ae5109d
DIFF: https://github.com/llvm/llvm-project/commit/4bd6175f718f032cc391de9263a3d4c14ae5109d.diff

LOG: [AArch64][SME] Remove a couple of unused functions (NFC) (#192649)

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

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64SMEAttributes.h
    llvm/unittests/Target/AArch64/SMEAttributesTest.cpp

Removed: 
    


################################################################################
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