MLIR 24.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 "llvm/Frontend/OpenMP/OMPConstants.h"
22#include "llvm/Frontend/OpenMP/OMPDeviceConstants.h"
23
24#define GET_TYPEDEF_CLASSES
25#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.h.inc"
26
27#include "mlir/Dialect/OpenMP/OpenMPOpsDialect.h.inc"
28
30
31#include "mlir/Dialect/OpenMP/OpenMPTypeInterfaces.h.inc"
32
33#define GET_OP_CLASSES
34#include "mlir/Dialect/OpenMP/OpenMPOps.h.inc"
35
36/// Operations implementing LoopWrapperInterface.
37#define OMP_LOOP_WRAPPER_OPS \
38 mlir::omp::WorkshareLoopWrapperOp, mlir::omp::LoopOp, mlir::omp::WsloopOp, \
39 mlir::omp::SimdOp, mlir::omp::DistributeOp, mlir::omp::TaskloopWrapperOp
40
41/// Operations implementing OutlineableOpenMPOpInterface.
42#define OMP_OUTLINEABLE_OPS \
43 mlir::omp::ParallelOp, mlir::omp::TeamsOp, mlir::omp::TaskOp, \
44 mlir::omp::TargetOp
45
46namespace mlir::omp {
47/// Value of the `omp_null_allocator` handle. Using it as an allocator operand
48/// selects the default allocator of the binding task.
49constexpr int64_t kNullAllocator = 0;
50
51/// Find the omp.new_cli, generator, and consumer of a canonical loop info.
52std::tuple<NewCliOp, OpOperand *, OpOperand *> decodeCli(mlir::Value cli);
53
54/// Convert a proc_bind kind from the LLVM frontend enum to the corresponding
55/// OpenMP dialect enum. The LLVM 'default' and 'unknown' kinds have no dialect
56/// counterpart and are not valid inputs.
57ClauseProcBindKind convertProcBindKind(llvm::omp::ProcBindKind kind);
58} // namespace mlir::omp
59
60#endif // MLIR_DIALECT_OPENMP_OPENMPDIALECT_H_
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.
constexpr int64_t kNullAllocator
Value of the omp_null_allocator handle.