49 using GenInitValueCBTy = std::function<mlir::Value(
51 mlir::Value ompOrig, mlir::Value ompPriv)>;
52 using GenCombinerCBTy = std::function<void(
54 mlir::Value op1, mlir::Value op2,
bool isByRef)>;
57 enum ReductionIdentifier {
74 static bool doReductionByRef(mlir::Type reductionType);
75 static bool doReductionByRef(mlir::Value reductionVar);
77 static ReductionIdentifier
78 getReductionType(
const omp::clause::ProcedureDesignator &pd);
80 static ReductionIdentifier
81 getReductionType(omp::clause::DefinedOperator::IntrinsicOperator intrinsicOp);
88 static parser::DefinedOperator::IntrinsicOperator
91 static ReductionIdentifier
92 getReductionType(
const fir::ReduceOperationEnum &pd);
95 supportedIntrinsicProcReduction(
const omp::clause::ProcedureDesignator &pd);
102 const omp::clause::ProcedureDesignator &reductionIntrinsic,
105 static const semantics::SourceName
108 static const semantics::SourceName
109 getRealName(
const omp::clause::ProcedureDesignator &pd);
111 static std::string getReductionName(llvm::StringRef name,
113 mlir::Type ty,
bool isByRef);
115 static std::string getReductionName(ReductionIdentifier redId,
117 mlir::Type ty,
bool isByRef);
131 mlir::Type reductionType,
bool isByRef);
140 static mlir::Value getReductionInitValue(mlir::Location loc, mlir::Type type,
141 ReductionIdentifier redId,
144 template <
typename FloatOp,
typename IntegerOp>
146 mlir::Type type, mlir::Location loc,
147 mlir::Value op1, mlir::Value op2);
148 template <
typename FloatOp,
typename IntegerOp,
typename ComplexOp>
150 mlir::Type type, mlir::Location loc,
151 mlir::Value op1, mlir::Value op2);
155 ReductionIdentifier redId,
156 mlir::Type type, mlir::Value op1,
161 template <
typename DeclareRedType>
164 mlir::Type type, mlir::Location loc,
bool isByRef,
165 GenCombinerCBTy genCombinerCB, GenInitValueCBTy genInitValueCB,
172 template <
typename OpType>
174 llvm::StringRef reductionOpName,
175 const ReductionIdentifier redId,
176 mlir::Type type, mlir::Location loc,
187 template <
typename OpType,
typename RedOperatorListTy>
190 const RedOperatorListTy &redOperatorList,
191 llvm::SmallVectorImpl<mlir::Value> &reductionVars,
192 llvm::SmallVectorImpl<bool> &reduceVarByRef,
193 llvm::SmallVectorImpl<mlir::Attribute> &reductionDeclSymbols,
194 const llvm::SmallVectorImpl<const semantics::Symbol *> &reductionSymbols,
196 llvm::DenseMap<const semantics::Symbol *, mlir::Value>
197 *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, semantics::SemanticsContext *semaCtx=nullptr, llvm::DenseMap< const semantics::Symbol *, mlir::Value > *reductionVarCache=nullptr)
Definition ReductionProcessor.cpp:915
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:648