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 {
37
38enum class DeclOperationKind {
39 PrivateOrLocal,
40 FirstPrivateOrLocalInit,
41 Reduction
42};
43inline bool isPrivatization(DeclOperationKind kind) {
44 return (kind == DeclOperationKind::FirstPrivateOrLocalInit) ||
45 (kind == DeclOperationKind::PrivateOrLocal);
46}
47inline bool isReduction(DeclOperationKind kind) {
48 return kind == DeclOperationKind::Reduction;
49}
50
56 AbstractConverter &converter, mlir::Location loc, mlir::Type argType,
57 mlir::Value scalarInitValue, mlir::Block *initBlock,
58 mlir::Value allocatedPrivVarArg, mlir::Value moldArg,
59 mlir::Region &cleanupRegion, DeclOperationKind kind,
60 const Fortran::semantics::Symbol *sym = nullptr,
61 bool cannotHaveNonDefaultLowerBounds = false, bool isDoConcurrent = false);
62
69fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc,
70 mlir::Value box,
71 bool cannotHaveNonDefaultLowerBounds = false,
72 bool useDefaultLowerBounds = false);
73
74} // namespace lower
75} // namespace Fortran
76
77#endif // FORTRAN_LOWER_OPENMP_PRIVATEREDUCTIONUTILS_H
Definition AbstractConverter.h:85
Definition symbol.h:778
Definition FIRBuilder.h:55
Definition ParserActions.h:24
void populateByRefInitAndCleanupRegions(AbstractConverter &converter, mlir::Location loc, mlir::Type argType, mlir::Value scalarInitValue, mlir::Block *initBlock, mlir::Value allocatedPrivVarArg, mlir::Value moldArg, mlir::Region &cleanupRegion, DeclOperationKind kind, const Fortran::semantics::Symbol *sym=nullptr, bool cannotHaveNonDefaultLowerBounds=false, bool isDoConcurrent=false)
Definition PrivateReductionUtils.cpp:675
fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Value box, bool cannotHaveNonDefaultLowerBounds=false, bool useDefaultLowerBounds=false)
Definition PrivateReductionUtils.cpp:137
Definition bit-population-count.h:20
Definition AbstractConverter.h:34
Definition AbstractConverter.h:29