9#ifndef FORTRAN_LOWER_OPENMPUTILS_H
10#define FORTRAN_LOWER_OPENMPUTILS_H
12#include "flang/Lower/OpenMP/Clauses.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;
46struct DeclareTargetCaptureInfo {
47 mlir::omp::DeclareTargetCaptureClause clause;
51 DeclareTargetCaptureInfo(mlir::omp::DeclareTargetCaptureClause c,
53 : clause(c), automap(a), symbol(s) {}
107 bool isDuplicateMemberMapInfo(llvm::SmallVectorImpl<int64_t> &memberIndices) {
108 return llvm::find_if(memberPlacementIndices, [&](
auto &memberData) {
109 return llvm::equal(memberIndices, memberData);
110 }) != memberPlacementIndices.end();
113 void addChildIndexAndMapToParent(
const omp::Object &
object,
114 mlir::omp::MapInfoOp &mapOp,
118void insertChildMapInfoIntoParent(
122 std::map<Object, OmpMapParentAndMemberData> &parentMemberIndices,
123 llvm::SmallVectorImpl<mlir::Value> &mapOperands,
124 llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms);
126void generateMemberPlacementIndices(
127 const Object &
object, llvm::SmallVectorImpl<int64_t> &indices,
130bool isMemberOrParentAllocatableOrPointer(
133mlir::Value createParentSymAndGenIntermediateMaps(
136 omp::ObjectList &objectList, llvm::SmallVectorImpl<int64_t> &indices,
138 mlir::omp::ClauseMapFlags mapTypeBits);
140mlir::FlatSymbolRefAttr getOrGenImplicitDefaultDeclareMapper(
142 fir::RecordType recordType, llvm::StringRef mapperNameStr);
144bool requiresImplicitDefaultDeclareMapper(
147omp::ObjectList gatherObjectsOf(omp::Object derivedTypeMember,
151 std::size_t loopVarTypeSize);
156void gatherFuncAndVarSyms(
157 const ObjectList &objects, mlir::omp::DeclareTargetCaptureClause clause,
158 llvm::SmallVectorImpl<DeclareTargetCaptureInfo> &symbolAndClause,
159 bool automap =
false);
161int64_t getCollapseValue(
const List<Clause> &clauses);
163void genObjectList(
const ObjectList &objects,
165 llvm::SmallVectorImpl<mlir::Value> &operands);
167void lastprivateModifierNotSupported(
const omp::clause::Lastprivate &lastp,
172int64_t collectLoopRelatedInfo(
175 mlir::omp::LoopRelatedClauseOps &result,
176 llvm::SmallVectorImpl<const semantics::Symbol *> &iv);
178void collectLoopRelatedInfo(
182 mlir::omp::LoopRelatedClauseOps &result,
183 llvm::SmallVectorImpl<const semantics::Symbol *> &iv);
185void collectTileSizesFromOpenMPConstruct(
187 llvm::SmallVectorImpl<int64_t> &tileSizes,
Definition AbstractConverter.h:85
Definition StatementContext.h:46
Definition semantics.h:67
Definition FIRBuilder.h:55
Definition ParserActions.h:24
Definition check-expression.h:19
Definition bit-population-count.h:20
Definition AbstractConverter.h:34
Definition PFTBuilder.h:221
Definition parse-tree.h:3555
Definition parse-tree.h:3543
Definition parse-tree.h:5380