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