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);
87 static parser::DefinedOperator::IntrinsicOperator
90 static ReductionIdentifier
91 getReductionType(
const fir::ReduceOperationEnum &pd);
94 supportedIntrinsicProcReduction(
const omp::clause::ProcedureDesignator &pd);
101 const omp::clause::ProcedureDesignator &reductionIntrinsic,
104 static const semantics::SourceName
107 static const semantics::SourceName
108 getRealName(
const omp::clause::ProcedureDesignator &pd);
110 static std::string getReductionName(llvm::StringRef name,
112 mlir::Type ty,
bool isByRef);
114 static std::string getReductionName(ReductionIdentifier redId,
116 mlir::Type ty,
bool isByRef);
130 mlir::Type reductionType,
bool isByRef);
139 static mlir::Value getReductionInitValue(mlir::Location loc, mlir::Type type,
140 ReductionIdentifier redId,
143 template <
typename FloatOp,
typename IntegerOp>
145 mlir::Type type, mlir::Location loc,
146 mlir::Value op1, mlir::Value op2);
147 template <
typename FloatOp,
typename IntegerOp,
typename ComplexOp>
149 mlir::Type type, mlir::Location loc,
150 mlir::Value op1, mlir::Value op2);
154 ReductionIdentifier redId,
155 mlir::Type type, mlir::Value op1,
160 template <
typename DeclareRedType>
163 mlir::Type type, mlir::Location loc,
bool isByRef,
164 GenCombinerCBTy genCombinerCB, GenInitValueCBTy genInitValueCB,
171 template <
typename OpType>
173 llvm::StringRef reductionOpName,
174 const ReductionIdentifier redId,
175 mlir::Type type, mlir::Location loc,
186 template <
typename OpType,
typename RedOperatorListTy>
189 const RedOperatorListTy &redOperatorList,
195 llvm::DenseMap<const semantics::Symbol *, mlir::Value>
196 *reductionVarCache =
nullptr);
208 template <
typename OpType>
209 static bool processOpenMPReductionOperator(
211 const omp::clause::ReductionOperatorList &redOperatorList,
216 ReductionIdentifier &redId);
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:1315
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:649