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 DerivedTypeSpec;
26class Symbol;
27} // namespace semantics
28} // namespace Fortran
29
30namespace fir {
31class FirOpBuilder;
32class ShapeShiftOp;
33} // namespace fir
34
35namespace Fortran {
36namespace lower {
38
39enum class DeclOperationKind {
40 PrivateOrLocal,
41 FirstPrivateOrLocalInit,
42 Reduction
43};
44inline bool isPrivatization(DeclOperationKind kind) {
45 return (kind == DeclOperationKind::FirstPrivateOrLocalInit) ||
46 (kind == DeclOperationKind::PrivateOrLocal);
47}
48inline bool isReduction(DeclOperationKind kind) {
49 return kind == DeclOperationKind::Reduction;
50}
51
57 AbstractConverter &converter, mlir::Location loc, mlir::Type argType,
58 mlir::Value scalarInitValue, mlir::Block *initBlock,
59 mlir::Value allocatedPrivVarArg, mlir::Value moldArg,
60 mlir::Region &cleanupRegion, DeclOperationKind kind,
61 const Fortran::semantics::Symbol *sym = nullptr,
62 bool cannotHaveNonDefaultLowerBounds = false, bool isDoConcurrent = false,
63 bool forceHeapAllocation = false);
64
71fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc,
72 mlir::Value box,
73 bool cannotHaveNonDefaultLowerBounds = false,
74 bool useDefaultLowerBounds = false);
75
83 AbstractConverter &converter, fir::FirOpBuilder &builder,
84 mlir::Location loc, mlir::Type type, mlir::Value destRef,
85 const Fortran::semantics::DerivedTypeSpec *derivedTypeSpec = nullptr,
86 const Fortran::semantics::Symbol *sym = nullptr);
87
88} // namespace lower
89} // namespace Fortran
90
91#endif // FORTRAN_LOWER_OPENMP_PRIVATEREDUCTIONUTILS_H
Definition AbstractConverter.h:87
Definition symbol.h:881
Definition FIRBuilder.h:59
Definition ParserActions.h:24
void genInlineTypeDefaultInit(AbstractConverter &converter, fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type type, mlir::Value destRef, const Fortran::semantics::DerivedTypeSpec *derivedTypeSpec=nullptr, const Fortran::semantics::Symbol *sym=nullptr)
Definition PrivateReductionUtils.cpp:813
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, bool forceHeapAllocation=false)
Definition PrivateReductionUtils.cpp:787
fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Value box, bool cannotHaveNonDefaultLowerBounds=false, bool useDefaultLowerBounds=false)
Definition PrivateReductionUtils.cpp:176
Definition bit-population-count.h:20
Definition AbstractConverter.h:37
Definition AbstractConverter.h:32