clang 22.0.0git
|
Class intended to support codegen of all kind of the reduction clauses. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h"
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.
ReductionCodeGen::ReductionCodeGen | ( | ArrayRef< const Expr * > | Shareds, |
ArrayRef< const Expr * > | Origs, | ||
ArrayRef< const Expr * > | Privates, | ||
ArrayRef< const Expr * > | ReductionOps ) |
Definition at line 765 of file CGOpenMPRuntime.cpp.
Address ReductionCodeGen::adjustPrivateAddress | ( | CodeGenFunction & | CGF, |
unsigned | N, | ||
Address | PrivateAddr ) |
Adjusts PrivatedAddr
for using instead of the original variable address in normal operations.
N | Number of the reduction item. |
PrivateAddr | Address of the corresponding private item. |
Definition at line 960 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().
void ReductionCodeGen::emitAggregateType | ( | CodeGenFunction & | CGF, |
unsigned | N ) |
Emits the code for the variable-modified type, if required.
N | Number of the reduction item. |
Definition at line 799 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().
void ReductionCodeGen::emitAggregateType | ( | CodeGenFunction & | CGF, |
unsigned | N, | ||
llvm::Value * | Size ) |
Emits the code for the variable-modified type, if required.
N | Number of the reduction item. |
Size | Size of the type in chars. |
Definition at line 833 of file CGOpenMPRuntime.cpp.
References clang::cast(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), getPrivateType(), clang::VariableArrayType::getSizeExpr(), and clang::Type::isVariablyModifiedType().
void ReductionCodeGen::emitCleanups | ( | CodeGenFunction & | CGF, |
unsigned | N, | ||
Address | PrivateAddr ) |
Emits cleanup code for the reduction item.
N | Number of the reduction item. |
PrivateAddr | Address of the corresponding private item. |
Definition at line 881 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), getPrivateType(), clang::QualType::isDestructedType(), needCleanups(), clang::CodeGen::CodeGenFunction::pushDestroy(), and clang::CodeGen::Address::withElementType().
Referenced by emitReduceFiniFunction().
void ReductionCodeGen::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.
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 850 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().
void ReductionCodeGen::emitSharedOrigLValue | ( | CodeGenFunction & | CGF, |
unsigned | N ) |
Emits lvalue for the shared and original reduction item.
N | Number of the reduction item. |
Definition at line 784 of file CGOpenMPRuntime.cpp.
References clang::First.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), emitScanBasedDirectiveDecls(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), and clang::CodeGen::CodeGenFunction::processInReduction().
Returns the base declaration of the reduction item.
Definition at line 217 of file CGOpenMPRuntime.h.
Referenced by adjustPrivateAddress(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), and clang::CodeGen::CodeGenFunction::processInReduction().
Returns LValue for the original reduction item.
Definition at line 210 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
Return the type of the private item.
Definition at line 224 of file CGOpenMPRuntime.h.
References clang::cast(), and clang::Private.
Referenced by emitAggregateType(), emitAggregateType(), emitCleanups(), emitReduceInitFunction(), and needCleanups().
Returns the base declaration of the reduction item.
Definition at line 219 of file CGOpenMPRuntime.h.
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups().
Returns LValue for the reduction item.
Definition at line 208 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), and clang::CodeGen::CodeGenFunction::processInReduction().
|
inline |
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.
Definition at line 213 of file CGOpenMPRuntime.h.
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
Returns true if the private copy requires cleanups.
Definition at line 875 of file CGOpenMPRuntime.cpp.
References clang::QualType::DK_none, getPrivateType(), and clang::QualType::isDestructedType().
Referenced by emitCleanups(), and emitReduceFiniFunction().
Returns true if the initialization of the reduction item uses initializer from declare reduction construct.
Definition at line 987 of file CGOpenMPRuntime.cpp.
References clang::OMPDeclareReductionDecl::getInitializer(), and getReductionInit().
Referenced by emitReduceInitFunction().