FLANG
PrivateReductionUtils.h
1//===-- Lower/OpenMP/PrivateReductionUtils.h --------------------*- 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_PRIVATEREDUCTIONUTILS_H
14#define FORTRAN_LOWER_OPENMP_PRIVATEREDUCTIONUTILS_H
15
16#include "mlir/IR/Location.h"
17#include "mlir/IR/Value.h"
18
19namespace mlir {
20class Region;
21} // namespace mlir
22
23namespace Fortran {
24namespace semantics {
25class Symbol;
26} // namespace semantics
27} // namespace Fortran
28
29namespace fir {
30class FirOpBuilder;
31class ShapeShiftOp;
32} // namespace fir
33
34namespace Fortran {
35namespace lower {
36class AbstractConverter;
37
38namespace omp {
39
40enum class DeclOperationKind { Private, FirstPrivate, Reduction };
41inline bool isPrivatization(DeclOperationKind kind) {
42 return (kind == DeclOperationKind::FirstPrivate) ||
43 (kind == DeclOperationKind::Private);
44}
45inline bool isReduction(DeclOperationKind kind) {
46 return kind == DeclOperationKind::Reduction;
47}
48
53void populateByRefInitAndCleanupRegions(
54 AbstractConverter &converter, mlir::Location loc, mlir::Type argType,
55 mlir::Value scalarInitValue, mlir::Block *initBlock,
56 mlir::Value allocatedPrivVarArg, mlir::Value moldArg,
57 mlir::Region &cleanupRegion, DeclOperationKind kind,
58 const Fortran::semantics::Symbol *sym = nullptr);
59
61fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc,
62 mlir::Value box);
63
64} // namespace omp
65} // namespace lower
66} // namespace Fortran
67
68#endif // FORTRAN_LOWER_OPENMP_PRIVATEREDUCTIONUTILS_H
Definition: symbol.h:712
Definition: FIRBuilder.h:55
Definition: bit-population-count.h:20
Definition: AbstractConverter.h:31
Definition: AbstractConverter.h:27