[Mlir-commits] [mlir] [mlir][OpenACC][OpenMP] Use explicit attribute APIs (PR #218901)
Sergio Afonso
llvmlistbot at llvm.org
Wed Aug 26 05:30:15 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());
+ }]
----------------
skatrak wrote:
Copying below the comment I made to this same change in the original PR:
I think this shouldn't be a single extra interface method to `BlockArgOpenMPOpInterface`.
To keep consistency across similar clauses, even though we currently only query this for `private`, we should make it another definition inside of `BlockArgOpenMPClause` to introduce `get<ClauseName>Syms()` interface methods, getting that inherent attribute (named `clauseNameSnake # "_syms"`, which we can do because we have a strict naming scheme for these arguments) if present or nullptr.
That would make this work for `private`, `in_reduction`, `reduction` and `task_reduction` and any future similar clauses we might add.
https://github.com/llvm/llvm-project/pull/218901
More information about the Mlir-commits
mailing list