[Mlir-commits] [mlir] [mlir][OpenACC][OpenMP] Use explicit attribute APIs (PR #218901)

Mehdi Amini llvmlistbot at llvm.org
Wed Aug 26 05:51:01 PDT 2026


================
@@ -157,6 +157,13 @@ def BlockArgOpenMPOpInterface : OpInterface<"BlockArgOpenMPOpInterface"> {
                 "iface." # clause.blockArgsMethod.name # "()))" # [{
             pairs.emplace_back(var, arg);
         } }]), "\n")
+      >,
+      InterfaceMethod<
+        "Get the symbols referenced by the private clause.",
+        "::mlir::ArrayAttr", "getPrivateSymsAttribute", (ins), [{}], [{
+          auto attr = $_op->getInherentAttr("private_syms");
+          return ::llvm::cast<::mlir::ArrayAttr>(attr.value());
+        }]
----------------
joker-eph wrote:

I moved the symbols accessor into BlockArgOpenMPClause, so the interface now generates `get<ClauseName>Syms()` consistently for all such clauses. The default implementation queries the corresponding `<clause_name>_syms` inherent attribute and returns no value when it is absent, matching the existing optional ODS accessors. This covers private, in_reduction, reduction, and task_reduction, as well as future clauses following the same naming convention.

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


More information about the Mlir-commits mailing list