[flang-commits] [flang] [mlir] [MLIR][OpenMP] Improve assemblyFormat handling for clause-based ops (PR #108023)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed Sep 11 02:41:33 PDT 2024


================
@@ -59,26 +59,21 @@ def OpenMP_MapBoundsType : OpenMP_Type<"MapBounds", "map_bounds_ty"> {
 // Optionally, operation traits and extra class declarations might be attached
 // to clauses, which will be forwarded to all operations that include them.
 //
-// Each clause must specify whether it's required or optional. This impacts how
-// the `assemblyFormat` for operations including it get generated.
-//
 // An `OpenMP_Op` can inhibit the inheritance of `traits`, `arguments`,
-// `assemblyFormat`, `description` and `extraClassDeclaration` fields from any
-// given `OpenMP_Clause` by setting to 1 the corresponding "skip" template
-// argument bit.
-class OpenMP_Clause<bit isRequired, bit skipTraits, bit skipArguments,
-                    bit skipAssemblyFormat, bit skipDescription,
-                    bit skipExtraClassDeclaration> {
-  bit required = isRequired;
-
+// `{opt,req}assemblyFormat`, `description` and `extraClassDeclaration` fields
+// from any given `OpenMP_Clause` by setting to 1 the corresponding "skip"
+// template argument bit.
+class OpenMP_Clause<bit skipTraits, bit skipArguments, bit skipAssemblyFormat,
----------------
skatrak wrote:

The "skip" bits are intended to control what is inherited by the `OpenMP_Op`, so it makes sense to me that they would have the granularity of that class, even though `OpenMP_Clause` happened to split a property into two. Even if we can do it, At the moment, I'm not sure what the use case of allowing ops to skip the format string of just optional or required arguments associated with a clause is.

Do you have a strong opinion on this?

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


More information about the flang-commits mailing list