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