[all-commits] [llvm/llvm-project] 3c9a9c: [MLIR][OpenMP] Support clause-based representation...
Sergio Afonso via All-commits
all-commits at lists.llvm.org
Wed Jun 12 05:26:48 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3c9a9c736532ea1ed997aae069c516b2564c3235
https://github.com/llvm/llvm-project/commit/3c9a9c736532ea1ed997aae069c516b2564c3235
Author: Sergio Afonso <safonsof at amd.com>
Date: 2024-06-12 (Wed, 12 Jun 2024)
Changed paths:
M mlir/include/mlir/Dialect/OpenMP/OpenMPOpBase.td
A mlir/test/mlir-tblgen/openmp-ops.td
Log Message:
-----------
[MLIR][OpenMP] Support clause-based representation of operations (#92519)
Currently, OpenMP operations are defined independently of each other.
However, one property of the OpenMP specification is that many clauses
can be applied to multiple constructs.
Keeping the MLIR representation of clauses consistent across all
operations that can accept them is important, but since this information
is scattered into multiple operation definitions, it is currently prone
to divergence as new features and changes are added to the dialect.
Furthermore, centralizing this information allows for a single source of
truth and avoids redundancy in the dialect.
The proposal in this patch is to make OpenMP clauses independent top
level definitions which can then be passed in a template argument list
to OpenMP operation definitions, just as it's done for traits. Clauses
can define these properties, which are joined together in order to make
a default initialization for the fields of the same name of the OpenMP
operation:
- `traits`: Optional. It gets added to the list of traits of the
operation.
- `arguments`: Mandatory. It defines how the clause is represented.
- `assemblyFormat`: Optional (though it should almost always be
defined). This is the declarative definition of the printer/parser for
the `arguments`. How these are combined depends on whether this is an
optional or required clause.
- `description`: Optional. It's used to populate a `clausesDescription`
field, so each operation definition must still define a `description`
itself. That field is intended to be appended to the end of the
`OpenMP_Op`'s `description`.
- `extraClassDeclaration`: Optional. It can define some C++ code to be
added to every OpenMP operation that includes that clause.
In order to give operation definitions fine-grained control over
features of a certain clause might need to be inhibited, the
`OpenMP_Clause` class takes "skipTraits", "skipArguments",
"skipAssemblyFormat", "skipDescription" and "skipExtraClassDeclaration"
bit template arguments. These are intended to be used very sparingly for
cases where some of the clauses might collide in some way otherwise.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list