| 1 |
//===-- Decomposer.h -- Compound directive decomposition ------------------===// |
| 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 |
#ifndef FORTRAN_LOWER_OPENMP_DECOMPOSER_H |
| 9 |
#define FORTRAN_LOWER_OPENMP_DECOMPOSER_H |
| 10 |
|
| 11 |
#include "Clauses.h" |
| 12 |
#include "mlir/IR/BuiltinOps.h" |
| 13 |
#include "llvm/Frontend/OpenMP/ConstructCompositionT.h" |
| 14 |
#include "llvm/Frontend/OpenMP/ConstructDecompositionT.h" |
| 15 |
#include "llvm/Frontend/OpenMP/OMP.h" |
| 16 |
#include "llvm/Support/Compiler.h" |
| 17 |
|
| 18 |
namespace llvm { |
| 19 |
class raw_ostream; |
| 20 |
} |
| 21 |
|
| 22 |
namespace Fortran { |
| 23 |
namespace semantics { |
| 24 |
class SemanticsContext; |
| 25 |
} |
| 26 |
namespace lower::pft { |
| 27 |
struct Evaluation; |
| 28 |
} |
| 29 |
} // namespace Fortran |
| 30 |
|
| 31 |
namespace Fortran::lower::omp { |
| 32 |
using UnitConstruct = tomp::DirectiveWithClauses<lower::omp::Clause>; |
| 33 |
using ConstructQueue = List<UnitConstruct>; |
| 34 |
|
| 35 |
LLVM_DUMP_METHOD llvm::raw_ostream &operator<<(llvm::raw_ostream &os, |
| 36 |
const UnitConstruct &uc); |
| 37 |
|
| 38 |
// Given a potentially compound construct with a list of clauses that |
| 39 |
// apply to it, break it up into individual sub-constructs each with |
| 40 |
// the subset of applicable clauses (plus implicit clauses, if any). |
| 41 |
// From that create a work queue where each work item corresponds to |
| 42 |
// the sub-construct with its clauses. |
| 43 |
ConstructQueue buildConstructQueue(mlir::ModuleOp modOp, |
| 44 |
semantics::SemanticsContext &semaCtx, |
| 45 |
lower::pft::Evaluation &eval, |
| 46 |
const parser::CharBlock &source, |
| 47 |
llvm::omp::Directive compound, |
| 48 |
const List<Clause> &clauses); |
| 49 |
|
| 50 |
bool isLastItemInQueue(ConstructQueue::iterator item, |
| 51 |
const ConstructQueue &queue); |
| 52 |
} // namespace Fortran::lower::omp |
| 53 |
|
| 54 |
#endif // FORTRAN_LOWER_OPENMP_DECOMPOSER_H |