[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 19 13:25:24 PDT 2024


================
@@ -408,17 +408,26 @@ class ElementsAttrBase<Pred condition, string summary> :
   let storageType = [{ ::mlir::ElementsAttr }];
   let returnType = [{ ::mlir::ElementsAttr }];
   let convertFromStorage = "$_self";
+
+  // The underlying C++ value type of each element.
+  string elementReturnType = ?;
----------------
kparzysz wrote:

This may need wider support, specifically we may need to generate an accessor function in .h.inc/.cpp.inc.  Something like https://github.com/llvm/llvm-project/blob/main/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp#L1204, for example.

I'm wary about making this kind of change in a widely shared file.  Maybe we could just handle this in OmpOpGen.cpp?  Specifically, infer this information in there based on the type of the attribute?

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


More information about the llvm-branch-commits mailing list