clang: clang::CodeGen::ReductionCodeGen Class Reference (original) (raw)

Class intended to support codegen of all kind of the reduction clauses. More...

#include "[/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h](CGOpenMPRuntime%5F8h%5Fsource.html)"

Public Member Functions
ReductionCodeGen (ArrayRef< const Expr * > Shareds, ArrayRef< const Expr * > Origs, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > ReductionOps)
void emitSharedOrigLValue (CodeGenFunction &CGF, unsigned N)
Emits lvalue for the shared and original reduction item.
void emitAggregateType (CodeGenFunction &CGF, unsigned N)
Emits the code for the variable-modified type, if required.
void emitAggregateType (CodeGenFunction &CGF, unsigned N, llvm::Value *Size)
Emits the code for the variable-modified type, if required.
void emitInitialization (CodeGenFunction &CGF, unsigned N, Address PrivateAddr, Address SharedAddr, llvm::function_ref< bool(CodeGenFunction &)> DefaultInit)
Performs initialization of the private copy for the reduction item.
bool needCleanups (unsigned N)
Returns true if the private copy requires cleanups.
void emitCleanups (CodeGenFunction &CGF, unsigned N, Address PrivateAddr)
Emits cleanup code for the reduction item.
Address adjustPrivateAddress (CodeGenFunction &CGF, unsigned N, Address PrivateAddr)
Adjusts PrivatedAddr for using instead of the original variable address in normal operations.
LValue getSharedLValue (unsigned N) const
Returns LValue for the reduction item.
LValue getOrigLValue (unsigned N) const
Returns LValue for the original reduction item.
std::pair< llvm::Value *, llvm::Value * > getSizes (unsigned N) const
Returns the size of the reduction item (in chars and total number of elements in the item), or nullptr, if the size is a constant.
const VarDecl * getBaseDecl (unsigned N) const
Returns the base declaration of the reduction item.
const Expr * getRefExpr (unsigned N) const
Returns the base declaration of the reduction item.
bool usesReductionInitializer (unsigned N) const
Returns true if the initialization of the reduction item uses initializer from declare reduction construct.
QualType getPrivateType (unsigned N) const
Return the type of the private item.

Class intended to support codegen of all kind of the reduction clauses.

Definition at line 129 of file CGOpenMPRuntime.h.

adjustPrivateAddress()

Adjusts PrivatedAddr for using instead of the original variable address in normal operations.

Parameters

N Number of the reduction item.
PrivateAddr Address of the corresponding private item.

Definition at line 961 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), castToBase(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::LValue::getAddress(), getBaseDecl(), clang::CodeGen::Address::getElementType(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::Address::getType(), and loadToBegin().

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), and clang::CodeGen::CodeGenFunction::processInReduction().

emitAggregateType() [1/2]

Emits the code for the variable-modified type, if required.

Parameters

N Number of the reduction item.

Definition at line 800 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), getPrivateType(), clang::VariableArrayType::getSizeExpr(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::isa(), and clang::Type::isVariablyModifiedType().

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitScanBasedDirectiveDecls(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), and clang::CodeGen::CodeGenFunction::processInReduction().

emitAggregateType() [2/2]

emitCleanups()

emitInitialization()

Performs initialization of the private copy for the reduction item.

Parameters

N Number of the reduction item.
PrivateAddr Address of the corresponding private item.
DefaultInit Default initialization sequence that should be performed if no reduction specific initialization is found.
SharedAddr Address of the original shared variable.

Definition at line 851 of file CGOpenMPRuntime.cpp.

References clang::cast(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), emitInitWithReductionInitializer(), clang::ASTContext::getAsArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPDeclareReductionDecl::getInitializer(), getReductionInit(), clang::CodeGen::Address::getType(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), and clang::Private.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), and emitReduceInitFunction().

emitSharedOrigLValue()

getBaseDecl()

const VarDecl * clang::CodeGen::ReductionCodeGen::getBaseDecl ( unsigned N) const inline

getOrigLValue()

LValue clang::CodeGen::ReductionCodeGen::getOrigLValue ( unsigned N) const inline

getPrivateType()

QualType clang::CodeGen::ReductionCodeGen::getPrivateType ( unsigned N) const inline

getRefExpr()

const Expr * clang::CodeGen::ReductionCodeGen::getRefExpr ( unsigned N) const inline

getSharedLValue()

LValue clang::CodeGen::ReductionCodeGen::getSharedLValue ( unsigned N) const inline

getSizes()

std::pair< llvm::Value *, llvm::Value * > clang::CodeGen::ReductionCodeGen::getSizes ( unsigned N) const inline

needCleanups()

usesReductionInitializer()

bool ReductionCodeGen::usesReductionInitializer ( unsigned N ) const

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