[Mlir-commits] [mlir] Add more ZA modes (PR #77361)

Benjamin Maxwell llvmlistbot at llvm.org
Wed Jan 10 06:58:38 PST 2024


================
@@ -1715,6 +1717,10 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func,
 
   if (func->hasFnAttribute("aarch64_pstate_za_new"))
     funcOp.setArmNewZa(true);
+  if (func->hasFnAttribute("aarch64_pstate_za_preserved"))
+    funcOp.setArmPreservesZa(true);
+  if (func->hasFnAttribute("aarch64_pstate_za_shared"))
+    funcOp.setArmSharedZa(true);
----------------
MacDue wrote:

Maybe slightly rewrite this to show new/shared are mutually exclusive, and `za_preserved` can be used with either.
This would closer match the streaming mode handling above this. 

```suggestion
  if (func->hasFnAttribute("aarch64_pstate_za_new"))
    funcOp.setArmNewZa(true);
  else if (func->hasFnAttribute("aarch64_pstate_za_shared"))
    funcOp.setArmSharedZa(true);    
  // za_preserved can be used with za_new or za_shared. 
  if (func->hasFnAttribute("aarch64_pstate_za_preserved"))
    funcOp.setArmPreservesZa(true);

```

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


More information about the Mlir-commits mailing list