FLANG
Public Types | Static Public Member Functions | List of all members
Fortran::lower::omp::ReductionProcessor Class Reference

Public Types

enum  ReductionIdentifier {
  ID , USER_DEF_OP , ADD , SUBTRACT ,
  MULTIPLY , AND , OR , EQV ,
  NEQV , MAX , MIN , IAND ,
  IOR , IEOR
}
 

Static Public Member Functions

static ReductionIdentifier getReductionType (const omp::clause::ProcedureDesignator &pd)
 
static ReductionIdentifier getReductionType (omp::clause::DefinedOperator::IntrinsicOperator intrinsicOp)
 
static bool supportedIntrinsicProcReduction (const omp::clause::ProcedureDesignator &pd)
 
static const semantics::SourceName getRealName (const semantics::Symbol *symbol)
 
static const semantics::SourceName getRealName (const omp::clause::ProcedureDesignator &pd)
 
static std::string getReductionName (llvm::StringRef name, const fir::KindMapping &kindMap, mlir::Type ty, bool isByRef)
 
static std::string getReductionName (omp::clause::DefinedOperator::IntrinsicOperator intrinsicOp, const fir::KindMapping &kindMap, mlir::Type ty, bool isByRef)
 
static int getOperationIdentity (ReductionIdentifier redId, mlir::Location loc)
 
static mlir::Value getReductionInitValue (mlir::Location loc, mlir::Type type, ReductionIdentifier redId, fir::FirOpBuilder &builder)
 
template<typename FloatOp , typename IntegerOp >
static mlir::Value getReductionOperation (fir::FirOpBuilder &builder, mlir::Type type, mlir::Location loc, mlir::Value op1, mlir::Value op2)
 
template<typename FloatOp , typename IntegerOp , typename ComplexOp >
static mlir::Value getReductionOperation (fir::FirOpBuilder &builder, mlir::Type type, mlir::Location loc, mlir::Value op1, mlir::Value op2)
 
static mlir::Value createScalarCombiner (fir::FirOpBuilder &builder, mlir::Location loc, ReductionIdentifier redId, mlir::Type type, mlir::Value op1, mlir::Value op2)
 
static mlir::omp::DeclareReductionOp createDeclareReduction (fir::FirOpBuilder &builder, llvm::StringRef reductionOpName, const ReductionIdentifier redId, mlir::Type type, mlir::Location loc, bool isByRef)
 
static void addDeclareReduction (mlir::Location currentLocation, lower::AbstractConverter &converter, const omp::clause::Reduction &reduction, llvm::SmallVectorImpl< mlir::Value > &reductionVars, llvm::SmallVectorImpl< bool > &reduceVarByRef, llvm::SmallVectorImpl< mlir::Attribute > &reductionDeclSymbols, llvm::SmallVectorImpl< const semantics::Symbol * > &reductionSymbols)
 

Member Function Documentation

◆ addDeclareReduction()

void Fortran::lower::omp::ReductionProcessor::addDeclareReduction ( mlir::Location  currentLocation,
lower::AbstractConverter converter,
const omp::clause::Reduction &  reduction,
llvm::SmallVectorImpl< mlir::Value > &  reductionVars,
llvm::SmallVectorImpl< bool > &  reduceVarByRef,
llvm::SmallVectorImpl< mlir::Attribute > &  reductionDeclSymbols,
llvm::SmallVectorImpl< const semantics::Symbol * > &  reductionSymbols 
)
static

Creates a reduction declaration and associates it with an OpenMP block directive.

◆ createDeclareReduction()

mlir::omp::DeclareReductionOp Fortran::lower::omp::ReductionProcessor::createDeclareReduction ( fir::FirOpBuilder builder,
llvm::StringRef  reductionOpName,
const ReductionIdentifier  redId,
mlir::Type  type,
mlir::Location  loc,
bool  isByRef 
)
static

Creates an OpenMP reduction declaration and inserts it into the provided symbol table. The declaration has a constant initializer with the neutral value initValue, and the reduction combiner carried over from reduce. TODO: add atomic region.

◆ getOperationIdentity()

int Fortran::lower::omp::ReductionProcessor::getOperationIdentity ( ReductionIdentifier  redId,
mlir::Location  loc 
)
static

This function returns the identity value of the operator reductionOpName. For example: 0 + x = x, 1 * x = x


The documentation for this class was generated from the following files: