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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 09:46:32 PDT 2026


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

I'm not sure this is the right place to make that change. This will make codegen insert a lazy-save before the call, which means we'll enter a function with a shared-ZA interface in the dormant mode. 

I somewhat think we should just emit an error in this case as it's not supported and is really a silent miscompile. 

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


More information about the llvm-commits mailing list