[llvm] [AArch64][SME] Allow spills of ZT0 around SME ABI routines again (PR #136726)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 05:20:10 PDT 2025


================
@@ -125,16 +126,16 @@ class SMEAttrs {
   bool isPreservesZT0() const {
     return decodeZT0State(Bitmask) == StateValue::Preserved;
   }
+  bool isUndefZT0() const { return Bitmask & ZT0_Undef; }
   bool sharesZT0() const {
     StateValue State = decodeZT0State(Bitmask);
     return State == StateValue::In || State == StateValue::Out ||
            State == StateValue::InOut || State == StateValue::Preserved;
   }
   bool hasZT0State() const { return isNewZT0() || sharesZT0(); }
   bool requiresPreservingZT0(const SMEAttrs &Callee) const {
-    return hasZT0State() && !Callee.sharesZT0() &&
-           !Callee.hasAgnosticZAInterface() &&
-           !(Callee.Bitmask & SME_ABI_Routine);
+    return hasZT0State() && !Callee.isUndefZT0() && !Callee.sharesZT0() &&
----------------
sdesmalen-arm wrote:

We've discussed this offline, but just putting it out here in case someone else is curious about this; `&& !Callee.isUndefZT0()` isn't really correct, because `isUndefZT0()` should be a question to ask the caller and is specific to that call-site. Hence why #137239 is in progress to fix that.

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


More information about the llvm-commits mailing list