9#ifndef FORTRAN_LOWER_OPENMPUTILS_H
10#define FORTRAN_LOWER_OPENMPUTILS_H
12#include "flang/Lower/OpenMP/Clauses.h"
13#include "flang/Optimizer/Builder/HLFIRTools.h"
14#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
15#include "mlir/IR/Location.h"
16#include "mlir/IR/Value.h"
17#include "llvm/Support/CommandLine.h"
21extern llvm::cl::opt<bool> treatIndexAsSection;
48struct DeclareTargetCaptureInfo {
49 mlir::omp::DeclareTargetCaptureClause clause;
53 DeclareTargetCaptureInfo(mlir::omp::DeclareTargetCaptureClause c,
55 : clause(c), automap(a), symbol(s) {}
109 bool isDuplicateMemberMapInfo(llvm::SmallVectorImpl<int64_t> &memberIndices) {
110 return llvm::find_if(memberPlacementIndices, [&](
auto &memberData) {
111 return llvm::equal(memberIndices, memberData);
112 }) != memberPlacementIndices.end();
115 void addChildIndexAndMapToParent(
const omp::Object &
object,
116 mlir::omp::MapInfoOp &mapOp,
120void insertChildMapInfoIntoParent(
124 std::map<Object, OmpMapParentAndMemberData> &parentMemberIndices,
125 llvm::SmallVectorImpl<mlir::Value> &mapOperands,
126 llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms);
128void generateMemberPlacementIndices(
129 const Object &
object, llvm::SmallVectorImpl<int64_t> &indices,
132bool isMemberOrParentAllocatableOrPointer(
135mlir::Value createParentSymAndGenIntermediateMaps(
138 omp::ObjectList &objectList, llvm::SmallVectorImpl<int64_t> &indices,
140 mlir::omp::ClauseMapFlags mapTypeBits);
142bool requiresImplicitDefaultDeclareMapper(
145omp::ObjectList gatherObjectsOf(omp::Object derivedTypeMember,
149 std::size_t loopVarTypeSize);
154void gatherFuncAndVarSyms(
155 const ObjectList &objects, mlir::omp::DeclareTargetCaptureClause clause,
156 llvm::SmallVectorImpl<DeclareTargetCaptureInfo> &symbolAndClause,
157 bool automap =
false);
159int64_t getCollapseValue(
const List<Clause> &clauses);
161void genObjectList(
const ObjectList &objects,
163 llvm::SmallVectorImpl<mlir::Value> &operands);
165void lastprivateModifierNotSupported(
const omp::clause::Lastprivate &lastp,
170int64_t collectLoopRelatedInfo(
173 const omp::List<omp::Clause> &clauses,
174 mlir::omp::LoopRelatedClauseOps &result,
175 llvm::SmallVectorImpl<const semantics::Symbol *> &iv);
177void collectLoopRelatedInfo(
180 std::int64_t collapseValue,
182 mlir::omp::LoopRelatedClauseOps &result,
183 llvm::SmallVectorImpl<const semantics::Symbol *> &iv);
185void collectTileSizesFromOpenMPConstruct(
187 llvm::SmallVectorImpl<int64_t> &tileSizes,
192 const mlir::DataLayout &dl,
196 const omp::Object &
object,
211bool hasIteratorIVReference(
212 const omp::Object &
object,
213 const llvm::SmallPtrSetImpl<const Fortran::semantics::Symbol *> &ivSyms);
221 std::string &mapperIdName, llvm::StringRef memberName);
228std::optional<llvm::SmallVector<mlir::Value>> getIteratorElementIndices(
Definition AbstractConverter.h:87
Definition StatementContext.h:46
Definition semantics.h:67
Definition FIRBuilder.h:56
Definition HLFIRTools.h:52
Definition ParserActions.h:24
Definition check-expression.h:19
Definition bit-population-count.h:20
Definition AbstractConverter.h:37
Definition PFTBuilder.h:221
Definition parse-tree.h:3537
Definition parse-tree.h:3525
Definition parse-tree.h:5450