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(
151 bool enableImplicitDefaultMapperAllocatableMembers);
153omp::ObjectList gatherObjectsOf(omp::Object derivedTypeMember,
157 std::size_t loopVarTypeSize);
164void gatherFuncAndVarSyms(
165 const ObjectList &objects, mlir::omp::DeclareTargetCaptureClause clause,
167 bool automap =
false);
169int64_t getCollapseValue(
const List<Clause> &clauses);
171void genObjectList(
const ObjectList &objects,
175void lastprivateModifierNotSupported(
const omp::clause::Lastprivate &lastp,
182int64_t collectLoopRelatedInfo(
185 const omp::List<omp::Clause> &clauses,
186 mlir::omp::LoopRelatedClauseOps &result,
189void collectLoopRelatedInfo(
192 std::int64_t collapseValue,
194 mlir::omp::LoopRelatedClauseOps &result,
197void collectTileSizesFromOpenMPConstruct(
204 const mlir::DataLayout &dl,
208 const omp::Object &
object,
227getIteratorRangesForObject(
const omp::Object &
object,
236 std::string &mapperIdName, llvm::StringRef memberName);
252mlir::FlatSymbolRefAttr
254 mlir::Location loc,
const omp::Object &
object,
255 llvm::StringRef mapperIdName,
256 mlir::omp::ClauseMapFlags mapTypeBits);
258std::optional<llvm::SmallVector<mlir::Value>> getIteratorElementIndices(
271 bool isDerivedTypeMember =
false;
272 bool hasArrayValuedParent =
false;
274 std::optional<evaluate::ArrayRef> arrayRef;
294void collectEnclosingConstructTraits(
297 bool excludeNearestDispatch =
false);
301bool hasOnlyAMDGCNTargets(mlir::ModuleOp module);
305bool isHostOffloadCompilation(mlir::ModuleOp module);
316bool requiresUnifiedSharedMemory(mlir::ModuleOp module,
323 mlir::ModuleOp module,
Definition variable.h:209
Definition AbstractConverter.h:87
Definition StatementContext.h:46
Definition semantics.h:71
Definition openmp-utils.h:254
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:3654
Definition parse-tree.h:3642
Definition parse-tree.h:5692