50 using GenInitValueCBTy = std::function<mlir::Value(
52 mlir::Value ompOrig, mlir::Value ompPriv)>;
53 using GenCombinerCBTy = std::function<void(
55 mlir::Value op1, mlir::Value op2,
bool isByRef)>;
58 enum ReductionIdentifier {
75 static bool doReductionByRef(mlir::Type reductionType);
76 static bool doReductionByRef(mlir::Value reductionVar);
78 static ReductionIdentifier
79 getReductionType(
const omp::clause::ProcedureDesignator &pd);
81 static ReductionIdentifier
82 getReductionType(omp::clause::DefinedOperator::IntrinsicOperator intrinsicOp);
89 static parser::DefinedOperator::IntrinsicOperator
92 static ReductionIdentifier
93 getReductionType(
const fir::ReduceOperationEnum &pd);
96 supportedIntrinsicProcReduction(
const omp::clause::ProcedureDesignator &pd);
98 static const semantics::SourceName
101 static const semantics::SourceName
102 getRealName(
const omp::clause::ProcedureDesignator &pd);
104 static std::string getReductionName(llvm::StringRef name,
106 mlir::Type ty,
bool isByRef);
108 static std::string getReductionName(ReductionIdentifier redId,
110 mlir::Type ty,
bool isByRef);
124 mlir::Type reductionType,
bool isByRef);
133 static mlir::Value getReductionInitValue(mlir::Location loc, mlir::Type type,
134 ReductionIdentifier redId,
137 template <
typename FloatOp,
typename IntegerOp>
139 mlir::Type type, mlir::Location loc,
140 mlir::Value op1, mlir::Value op2);
141 template <
typename FloatOp,
typename IntegerOp,
typename ComplexOp>
143 mlir::Type type, mlir::Location loc,
144 mlir::Value op1, mlir::Value op2);
148 ReductionIdentifier redId,
149 mlir::Type type, mlir::Value op1,
154 template <
typename DeclareRedType>
157 mlir::Type type, mlir::Location loc,
bool isByRef,
158 GenCombinerCBTy genCombinerCB, GenInitValueCBTy genInitValueCB,
165 template <
typename OpType>
167 llvm::StringRef reductionOpName,
168 const ReductionIdentifier redId,
169 mlir::Type type, mlir::Location loc,
180 template <
typename OpType,
typename RedOperatorListTy>
183 const RedOperatorListTy &redOperatorList,
184 llvm::SmallVectorImpl<mlir::Value> &reductionVars,
185 llvm::SmallVectorImpl<bool> &reduceVarByRef,
186 llvm::SmallVectorImpl<mlir::Attribute> &reductionDeclSymbols,
187 const llvm::SmallVectorImpl<const semantics::Symbol *> &reductionSymbols,
190 llvm::DenseMap<const semantics::Symbol *, mlir::Value>
191 *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::ArrayRef< Object > reductionObjects, lower::SymMap &symMap, semantics::SemanticsContext *semaCtx=nullptr, llvm::DenseMap< const semantics::Symbol *, mlir::Value > *reductionVarCache=nullptr)
Definition ReductionProcessor.cpp:742
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:634