[all-commits] [llvm/llvm-project] 7247d0: [MLIR][OpenMP] Support clause-based representation...
Sergio Afonso via All-commits
all-commits at lists.llvm.org
Wed Jun 12 04:41:36 PDT 2024
Branch: refs/heads/users/skatrak/mlir-clauses-02-base
Home: https://github.com/llvm/llvm-project
Commit: 7247d08e006d99dee76878a582c359f391210e64
https://github.com/llvm/llvm-project/commit/7247d08e006d99dee76878a582c359f391210e64
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
Log Message:
-----------
[MLIR][OpenMP] Support clause-based representation of operations
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.
Commit: 5c766aca8437e3fee369bf7db757ade188faa5bf
https://github.com/llvm/llvm-project/commit/5c766aca8437e3fee369bf7db757ade188faa5bf
Author: Sergio Afonso <safonsof at amd.com>
Date: 2024-06-12 (Wed, 12 Jun 2024)
Changed paths:
A mlir/test/mlir-tblgen/openmp-ops.td
Log Message:
-----------
Add tablegen unit tests for the new features
Compare: https://github.com/llvm/llvm-project/compare/95f1a810966b...5c766aca8437
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