9#ifndef FORTRAN_LOWER_OPENMPUTILS_H
10#define FORTRAN_LOWER_OPENMPUTILS_H
13#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
14#include "mlir/IR/Location.h"
15#include "mlir/IR/Value.h"
16#include "llvm/Support/CommandLine.h"
19extern llvm::cl::opt<bool> treatIndexAsSection;
20extern llvm::cl::opt<bool> enableDelayedPrivatization;
21extern llvm::cl::opt<bool> enableDelayedPrivatizationStaging;
38class StatementContext;
43class AbstractConverter;
47using DeclareTargetCapturePair =
48 std::pair<mlir::omp::DeclareTargetCaptureClause, const semantics::Symbol &>;
101 bool isDuplicateMemberMapInfo(llvm::SmallVectorImpl<int64_t> &memberIndices) {
102 return llvm::find_if(memberPlacementIndices, [&](
auto &memberData) {
103 return llvm::equal(memberIndices, memberData);
104 }) != memberPlacementIndices.end();
107 void addChildIndexAndMapToParent(
const omp::Object &
object,
108 mlir::omp::MapInfoOp &mapOp,
114 mlir::Value baseAddr, mlir::Value varPtrPtr,
117 mlir::ArrayAttr membersIndex, uint64_t mapType,
118 mlir::omp::VariableCaptureKind mapCaptureType, mlir::Type retTy,
119 bool partialMap =
false);
121void insertChildMapInfoIntoParent(
125 std::map<Object, OmpMapParentAndMemberData> &parentMemberIndices,
126 llvm::SmallVectorImpl<mlir::Value> &mapOperands,
127 llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms);
129void generateMemberPlacementIndices(
130 const Object &
object, llvm::SmallVectorImpl<int64_t> &indices,
133bool isMemberOrParentAllocatableOrPointer(
136mlir::Value createParentSymAndGenIntermediateMaps(
139 omp::ObjectList &objectList, llvm::SmallVectorImpl<int64_t> &indices,
141 llvm::omp::OpenMPOffloadMappingFlags mapTypeBits);
143omp::ObjectList gatherObjectsOf(omp::Object derivedTypeMember,
147 std::size_t loopVarTypeSize);
152void gatherFuncAndVarSyms(
153 const ObjectList &objects, mlir::omp::DeclareTargetCaptureClause clause,
154 llvm::SmallVectorImpl<DeclareTargetCapturePair> &symbolAndClause);
156int64_t getCollapseValue(
const List<Clause> &clauses);
158void genObjectList(
const ObjectList &objects,
160 llvm::SmallVectorImpl<mlir::Value> &operands);
162void lastprivateModifierNotSupported(
const omp::clause::Lastprivate &lastp,
Definition: AbstractConverter.h:82
Definition: StatementContext.h:46
Definition: semantics.h:67
Definition: FIRBuilder.h:55
Definition: bit-population-count.h:20
Definition: AbstractConverter.h:31
Definition: PFTBuilder.h:216