MLIR 23.0.0git
OpenMPDialect.h
Go to the documentation of this file.
1//===- OpenMPDialect.h - MLIR Dialect for OpenMP ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the OpenMP dialect in MLIR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_OPENMP_OPENMPDIALECT_H_
14#define MLIR_DIALECT_OPENMP_OPENMPDIALECT_H_
15
21#include "mlir/IR/Dialect.h"
24#include "mlir/IR/SymbolTable.h"
27#include "llvm/Frontend/OpenMP/OMPConstants.h"
28#include "llvm/Frontend/OpenMP/OMPDeviceConstants.h"
29
30#define GET_TYPEDEF_CLASSES
31#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.h.inc"
32
33#include "mlir/Dialect/OpenMP/OpenMPOpsDialect.h.inc"
34
36
37#include "mlir/Dialect/OpenMP/OpenMPTypeInterfaces.h.inc"
38
39#define GET_OP_CLASSES
40#include "mlir/Dialect/OpenMP/OpenMPOps.h.inc"
41
42/// Operations implementing LoopWrapperInterface.
43#define OMP_LOOP_WRAPPER_OPS \
44 mlir::omp::WorkshareLoopWrapperOp, mlir::omp::LoopOp, mlir::omp::WsloopOp, \
45 mlir::omp::SimdOp, mlir::omp::DistributeOp, mlir::omp::TaskloopWrapperOp
46
47/// Operations implementing OutlineableOpenMPOpInterface.
48#define OMP_OUTLINEABLE_OPS \
49 mlir::omp::ParallelOp, mlir::omp::TeamsOp, mlir::omp::TaskOp, \
50 mlir::omp::TargetOp
51
52namespace mlir::omp {
53/// Find the omp.new_cli, generator, and consumer of a canonical loop info.
54std::tuple<NewCliOp, OpOperand *, OpOperand *> decodeCli(mlir::Value cli);
55
56/// Convert a proc_bind kind from the LLVM frontend enum to the corresponding
57/// OpenMP dialect enum. The LLVM 'default' and 'unknown' kinds have no dialect
58/// counterpart and are not valid inputs.
59ClauseProcBindKind convertProcBindKind(llvm::omp::ProcBindKind kind);
60} // namespace mlir::omp
61
62#endif // MLIR_DIALECT_OPENMP_OPENMPDIALECT_H_
Shared utilities for setting OpenMP offload module interface attributes.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
std::tuple< NewCliOp, OpOperand *, OpOperand * > decodeCli(mlir::Value cli)
Find the omp.new_cli, generator, and consumer of a canonical loop info.
ClauseProcBindKind convertProcBindKind(llvm::omp::ProcBindKind kind)
Convert a proc_bind kind from the LLVM frontend enum to the corresponding OpenMP dialect enum.