clang 20.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 128 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 769 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 964 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, 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().
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 803 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), getPrivateType(), clang::VariableArrayType::getSizeExpr(), clang::CodeGen::CodeGenFunction::getTypeSize(), and clang::Type::isVariablyModifiedType().
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitScanBasedDirectiveDecls(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
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 837 of file CGOpenMPRuntime.cpp.
References 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 885 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 854 of file CGOpenMPRuntime.cpp.
References 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 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 788 of file CGOpenMPRuntime.cpp.
References clang::First.
Referenced by emitScanBasedDirectiveDecls(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
Returns the base declaration of the reduction item.
Definition at line 216 of file CGOpenMPRuntime.h.
Referenced by adjustPrivateAddress().
Returns LValue for the original reduction item.
Definition at line 209 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
Return the type of the private item.
Definition at line 223 of file CGOpenMPRuntime.h.
References clang::Private.
Referenced by emitAggregateType(), emitCleanups(), emitReduceInitFunction(), and needCleanups().
Returns the base declaration of the reduction item.
Definition at line 218 of file CGOpenMPRuntime.h.
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups().
Returns LValue for the reduction item.
Definition at line 207 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
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 212 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 879 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 991 of file CGOpenMPRuntime.cpp.
References clang::OMPDeclareReductionDecl::getInitializer(), and getReductionInit().
Referenced by emitReduceInitFunction().