FLANG
OpenMP.h
1//===-- include/flang/Utils/OpenMP.h ----------------------------*- 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#ifndef FORTRAN_UTILS_OPENMP_H_
10#define FORTRAN_UTILS_OPENMP_H_
11
12#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
13
14namespace fir {
15class FirOpBuilder;
16class RecordType;
17} // namespace fir
18
19namespace Fortran::utils::openmp {
20// TODO We can probably move the stuff inside `Support/OpenMP-utils.h/.cpp` here
21// as well.
22
45mlir::omp::MapInfoOp createMapInfoOp(mlir::OpBuilder &builder,
46 mlir::Location loc, mlir::Value baseAddr, mlir::Value varPtrPtr,
47 llvm::StringRef name, llvm::ArrayRef<mlir::Value> bounds,
48 llvm::ArrayRef<mlir::Value> members, mlir::ArrayAttr membersIndex,
49 mlir::omp::ClauseMapFlags mapType,
50 mlir::omp::VariableCaptureKind mapCaptureType, mlir::Type retTy,
51 bool partialMap = false,
52 mlir::FlatSymbolRefAttr mapperId = mlir::FlatSymbolRefAttr(),
53 mlir::Type varPtrTy = mlir::Type());
54
66mlir::Value mapTemporaryValue(fir::FirOpBuilder &firOpBuilder,
67 mlir::omp::TargetOp targetOp, mlir::Value val,
68 llvm::StringRef name = "tmp.map");
69
78void cloneOrMapRegionOutsiders(
79 fir::FirOpBuilder &firOpBuilder, mlir::omp::TargetOp targetOp);
80
81using RecordMemberMapperMangler =
82 std::function<void(std::string &mapperId, llvm::StringRef memberName)>;
83
87std::string getCanonicalDefaultDeclareMapperName(fir::RecordType recordType);
88
89mlir::FlatSymbolRefAttr getOrGenImplicitDefaultDeclareMapper(
90 fir::FirOpBuilder &firOpBuilder, mlir::Location loc,
91 fir::RecordType recordType, llvm::StringRef mapperNameStr,
92 RecordMemberMapperMangler mangler = {},
93 bool emitAllocatableMemberMaps = true);
94} // namespace Fortran::utils::openmp
95
96#endif // FORTRAN_UTILS_OPENMP_H_
Definition FIRBuilder.h:66
Definition AbstractConverter.h:37