45 using GenInitValueCBTy = std::function<mlir::Value(
47 mlir::Value ompOrig, mlir::Value ompPriv)>;
48 using GenCombinerCBTy = std::function<void(
50 mlir::Value op1, mlir::Value op2,
bool isByRef)>;
53 enum ReductionIdentifier {
70 static bool doReductionByRef(mlir::Type reductionType);
71 static bool doReductionByRef(mlir::Value reductionVar);
73 static ReductionIdentifier
74 getReductionType(
const omp::clause::ProcedureDesignator &pd);
76 static ReductionIdentifier
77 getReductionType(omp::clause::DefinedOperator::IntrinsicOperator intrinsicOp);
79 static ReductionIdentifier
80 getReductionType(
const fir::ReduceOperationEnum &pd);
83 supportedIntrinsicProcReduction(
const omp::clause::ProcedureDesignator &pd);
85 static const semantics::SourceName
88 static const semantics::SourceName
89 getRealName(
const omp::clause::ProcedureDesignator &pd);
91 static std::string getReductionName(llvm::StringRef name,
93 mlir::Type ty,
bool isByRef);
95 static std::string getReductionName(ReductionIdentifier redId,
97 mlir::Type ty,
bool isByRef);
106 static mlir::Value getReductionInitValue(mlir::Location loc, mlir::Type type,
107 ReductionIdentifier redId,
110 template <
typename FloatOp,
typename IntegerOp>
112 mlir::Type type, mlir::Location loc,
113 mlir::Value op1, mlir::Value op2);
114 template <
typename FloatOp,
typename IntegerOp,
typename ComplexOp>
116 mlir::Type type, mlir::Location loc,
117 mlir::Value op1, mlir::Value op2);
121 ReductionIdentifier redId,
122 mlir::Type type, mlir::Value op1,
127 template <
typename DeclareRedType>
130 mlir::Type type, mlir::Location loc,
bool isByRef,
131 GenCombinerCBTy genCombinerCB, GenInitValueCBTy genInitValueCB,
138 template <
typename OpType>
140 llvm::StringRef reductionOpName,
141 const ReductionIdentifier redId,
142 mlir::Type type, mlir::Location loc,
153 template <
typename OpType,
typename RedOperatorListTy>
156 const RedOperatorListTy &redOperatorList,
157 llvm::SmallVectorImpl<mlir::Value> &reductionVars,
158 llvm::SmallVectorImpl<bool> &reduceVarByRef,
159 llvm::SmallVectorImpl<mlir::Attribute> &reductionDeclSymbols,
160 const llvm::SmallVectorImpl<const semantics::Symbol *> &reductionSymbols,
161 llvm::DenseMap<const semantics::Symbol *, mlir::Value>
162 *reductionVarCache =
nullptr);
static bool processReductionArguments(mlir::Location currentLocation, lower::AbstractConverter &converter, const RedOperatorListTy &redOperatorList, llvm::SmallVectorImpl< mlir::Value > &reductionVars, llvm::SmallVectorImpl< bool > &reduceVarByRef, llvm::SmallVectorImpl< mlir::Attribute > &reductionDeclSymbols, const llvm::SmallVectorImpl< const semantics::Symbol * > &reductionSymbols, llvm::DenseMap< const semantics::Symbol *, mlir::Value > *reductionVarCache=nullptr)
Definition ReductionProcessor.cpp:657
static DeclareRedType createDeclareReductionHelper(AbstractConverter &converter, llvm::StringRef reductionOpName, mlir::Type type, mlir::Location loc, bool isByRef, GenCombinerCBTy genCombinerCB, GenInitValueCBTy genInitValueCB, const semantics::Symbol *sym=nullptr)
Definition ReductionProcessor.cpp:549