llvm-capstone/mlir
Razvan Lupusoru 61278ec348
[openacc][openmp] Add dialect representation for acc atomic operations (#65493)
The OpenACC standard specifies an `atomic` construct in section 2.12 (of
3.3 spec), used to ensure that a specific location is accessed or
updated atomically. Four different clauses are allowed: `read`, `write`,
`update`, or `capture`. If no clause appears, it is as if `update` is
used.

The OpenMP specification defines the same clauses for `omp atomic`. The
types of expression and the clauses in the OpenACC spec match the OpenMP
spec exactly. The main difference is that the OpenMP specification is a
superset - it includes clauses for `hint` and `memory order`. It also
allows conditional expression statements. But otherwise, the expression
definition matches.

Thus, for OpenACC, we refactor and reuse the OpenMP implementation as
follows:
* The atomic operations are duplicated in OpenACC dialect. This is
preferable so that each language's semantics are precisely represented
even if specs have divergence.
* However, since semantics overlap, a common interface between the
atomic operations is being added. The semantics for the interfaces are
not generic enough to be used outside of OpenACC and OpenMP, and thus
new folders were added to hold common pieces of the two dialects.
* The atomic interfaces define common accessors (such as getting `x` or
`v`) which match the OpenMP and OpenACC specs. It also adds common
verifiers intended to be called by each dialect's operation verifier.
* The OpenMP write operation was updated to use `x` and `expr` to be
consistent with its other operations (that use naming based on spec).

The frontend lowering necessary to generate the dialect can also be
reused. This will be done in a follow up change.
2023-09-06 13:54:39 -07:00
..
benchmark/python
cmake/modules
docs [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface 2023-08-31 11:28:23 +00:00
examples [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface 2023-08-31 11:28:23 +00:00
include [openacc][openmp] Add dialect representation for acc atomic operations (#65493) 2023-09-06 13:54:39 -07:00
lib [openacc][openmp] Add dialect representation for acc atomic operations (#65493) 2023-09-06 13:54:39 -07:00
python [mlir][python] Create all missing attribute builders. 2023-09-06 07:09:25 +00:00
test [openacc][openmp] Add dialect representation for acc atomic operations (#65493) 2023-09-06 13:54:39 -07:00
tools Revert "Revert "[MLIR] Move builtin.module LLVM IR translation to before nested operations"" 2023-09-04 11:35:59 +01:00
unittests [mlir] Add empty to StringAttr 2023-09-05 21:45:27 +00:00
utils
.clang-format
.clang-tidy
CMakeLists.txt
LICENSE.TXT
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.