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/LLVMIR/LLVMAttrs.h"
15#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
16#include "mlir/IR/Location.h"
17#include "mlir/IR/Value.h"
18#include "llvm/Frontend/OpenMP/OMPContext.h"
19#include "llvm/Support/CommandLine.h"
23extern llvm::cl::opt<bool> treatIndexAsSection;
54struct DeclareTargetCaptureInfo {
55 mlir::omp::DeclareTargetCaptureClause clause;
59 DeclareTargetCaptureInfo(mlir::omp::DeclareTargetCaptureClause c,
61 : clause(c), automap(a), symbol(s) {}
116 return llvm::find_if(memberPlacementIndices, [&](
auto &memberData) {
117 return llvm::equal(memberIndices, memberData);
118 }) != memberPlacementIndices.end();
121 void addChildIndexAndMapToParent(
const omp::Object &
object,
122 mlir::omp::MapInfoOp &mapOp,
126void insertChildMapInfoIntoParent(
130 std::map<Object, OmpMapParentAndMemberData> &parentMemberIndices,
134void generateMemberPlacementIndices(
138bool isMemberOrParentAllocatableOrPointer(
141mlir::Value createParentSymAndGenIntermediateMaps(
146 mlir::omp::ClauseMapFlags mapTypeBits);
148bool requiresImplicitDefaultDeclareMapper(
151omp::ObjectList gatherObjectsOf(omp::Object derivedTypeMember,
155 std::size_t loopVarTypeSize);
160void gatherFuncAndVarSyms(
161 const ObjectList &objects, mlir::omp::DeclareTargetCaptureClause clause,
163 bool automap =
false);
165int64_t getCollapseValue(
const List<Clause> &clauses);
167void genObjectList(
const ObjectList &objects,
171void lastprivateModifierNotSupported(
const omp::clause::Lastprivate &lastp,
178int64_t collectLoopRelatedInfo(
181 const omp::List<omp::Clause> &clauses,
182 mlir::omp::LoopRelatedClauseOps &result,
185void collectLoopRelatedInfo(
188 std::int64_t collapseValue,
190 mlir::omp::LoopRelatedClauseOps &result,
193void collectTileSizesFromOpenMPConstruct(
200 const mlir::DataLayout &dl,
204 const omp::Object &
object,
219bool hasIteratorIVReference(
220 const omp::Object &
object,
221 const llvm::SmallPtrSetImpl<const Fortran::semantics::Symbol *> &ivSyms);
229 std::string &mapperIdName, llvm::StringRef memberName);
252mlir::FlatSymbolRefAttr resolveMapperId(
254 const omp::Object &
object, llvm::StringRef mapperIdName,
255 mlir::omp::ClauseMapFlags mapTypeBits, llvm::omp::Directive directive);
257std::optional<llvm::SmallVector<mlir::Value>> getIteratorElementIndices(
265void collectEnclosingConstructTraits(
271bool hasOnlyAMDGCNTargets(mlir::ModuleOp module);
275bool requiresUnifiedSharedMemory(mlir::ModuleOp module,
282 mlir::ModuleOp module,
Definition AbstractConverter.h:87
Definition StatementContext.h:46
Definition semantics.h:67
Definition openmp-utils.h:232
Definition FIRBuilder.h:66
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:222
Definition parse-tree.h:3646
Definition parse-tree.h:3634
Definition parse-tree.h:5681