[clang] [llvm] [mlir] [AArch64] Replace LLVM IR function attributes for PSTATE.ZA. (PR #79166)

Cullen Rhodes via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 00:30:54 PST 2024


================
@@ -1098,11 +1098,15 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) {
     llvmFunc->addFnAttr("aarch64_pstate_sm_compatible");
 
   if (func.getArmNewZa())
-    llvmFunc->addFnAttr("aarch64_pstate_za_new");
-  else if (func.getArmSharedZa())
-    llvmFunc->addFnAttr("aarch64_pstate_za_shared");
+    llvmFunc->addFnAttr("aarch64_new_za");
+  else if (func.getArmInZa())
+    llvmFunc->addFnAttr("aarch64_in_za");
+  else if (func.getArmOutZa())
+    llvmFunc->addFnAttr("aarch64_out_za");
+  else if (func.getArmInoutZa())
+    llvmFunc->addFnAttr("aarch64_inout_za");
   if (func.getArmPreservesZa())
-    llvmFunc->addFnAttr("aarch64_pstate_za_preserved");
+    llvmFunc->addFnAttr("aarch64_preserves_za");
----------------
c-rhodes wrote:

this should be `else if`, I missed this from https://llvm.org/docs/AArch64SME.html#restrictions-on-attributes
> It is not allowed for a function to be decorated with both aarch64_pstate_za_new and aarch64_pstate_za_preserved.

when I originally reviewed this. I see you've fixed it for import, please could you fix it here as well?

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


More information about the cfe-commits mailing list