[clang] [llvm] [AArch64][SME] Allow more inlining when SME attributes are incompatible. (PR #223393)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 01:54:49 PDT 2026


================
@@ -200,7 +200,9 @@ class SMECallAttrs {
   }
 
   bool requiresZASave() const {
-    return requiresLazySave() || requiresPreservingAllZAState();
+    return requiresLazySave() || requiresPreservingAllZAState() ||
+           (caller().hasZAState() && callee().hasSharedZAInterface() &&
+            !callee().sharesZA());
----------------
sdesmalen-arm wrote:

Note that Clang already gives an error diagnostic for this case being unimplemented (https://godbolt.org/z/sYWb7sEn7). I've created #227608 to emit the error in LLVM as well.

I still think that `requiresZASave` should return `true` if a non-lazy save of ZA is required and that optimizations like inlining should [be able to] take this case into account, even though we don't support it in codegen yet.




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


More information about the cfe-commits mailing list