FLANG
OpenMP.h
1//===-- Lower/OpenMP.h -- lower Open MP directives --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef FORTRAN_LOWER_OPENMP_H
14#define FORTRAN_LOWER_OPENMP_H
15
16#include "llvm/ADT/SmallVector.h"
17
18#include <cinttypes>
19#include <utility>
20
21namespace mlir {
22class Operation;
23class Location;
24namespace omp {
25enum class DeclareTargetDeviceType : uint32_t;
26enum class DeclareTargetCaptureClause : uint32_t;
27} // namespace omp
28} // namespace mlir
29
30namespace fir {
31class FirOpBuilder;
32} // namespace fir
33
34namespace Fortran {
35namespace parser {
36struct OpenMPConstruct;
37struct OpenMPDeclarativeConstruct;
38struct OmpEndLoopDirective;
39struct OmpClauseList;
40} // namespace parser
41
42namespace semantics {
43class Symbol;
44class SemanticsContext;
45} // namespace semantics
46
47namespace lower {
48
49class AbstractConverter;
50class SymMap;
51
52namespace pft {
53struct Evaluation;
54struct Variable;
55} // namespace pft
56
58 mlir::omp::DeclareTargetCaptureClause declareTargetCaptureClause;
59 mlir::omp::DeclareTargetDeviceType declareTargetDeviceType;
61};
62
63// Generate the OpenMP terminator for Operation at Location.
64mlir::Operation *genOpenMPTerminator(fir::FirOpBuilder &, mlir::Operation *,
65 mlir::Location);
66
67void genOpenMPConstruct(AbstractConverter &, Fortran::lower::SymMap &,
70void genOpenMPDeclarativeConstruct(AbstractConverter &,
80 const pft::Variable &var);
81
82int64_t getCollapseValue(const Fortran::parser::OmpClauseList &clauseList);
83void genThreadprivateOp(AbstractConverter &, const pft::Variable &);
84void genDeclareTargetIntGlobal(AbstractConverter &, const pft::Variable &);
85bool isOpenMPTargetConstruct(const parser::OpenMPConstruct &);
86bool isOpenMPDeviceDeclareTarget(Fortran::lower::AbstractConverter &,
90void gatherOpenMPDeferredDeclareTargets(
94 llvm::SmallVectorImpl<OMPDeferredDeclareTargetInfo> &);
95bool markOpenMPDeferredDeclareTargetFunctions(
96 mlir::Operation *, llvm::SmallVectorImpl<OMPDeferredDeclareTargetInfo> &,
98void genOpenMPRequires(mlir::Operation *, const Fortran::semantics::Symbol *);
99
100} // namespace lower
101} // namespace Fortran
102
103#endif // FORTRAN_LOWER_OPENMP_H
Definition: AbstractConverter.h:82
Definition: SymbolMap.h:146
Definition: semantics.h:67
Definition: symbol.h:712
Definition: FIRBuilder.h:55
void genOpenMPSymbolProperties(AbstractConverter &converter, const pft::Variable &var)
Definition: OpenMP.cpp:3511
Definition: bit-population-count.h:20
Definition: AbstractConverter.h:31
Definition: AbstractConverter.h:27
Definition: PFTBuilder.h:216
Definition: PFTBuilder.h:400
Definition: parse-tree.h:4333
Definition: parse-tree.h:4756
Definition: parse-tree.h:4494