clang
6.0.0
|
Class intended to support codegen of all kind of the reduction clauses. More...
#include "/work/www-prereleases/6.0.0/rc3/llvm.src/tools/clang/lib/CodeGen/CGOpenMPRuntime.h"
Public Member Functions | |
ReductionCodeGen (ArrayRef< const Expr *> Shareds, ArrayRef< const Expr *> Privates, ArrayRef< const Expr *> ReductionOps) | |
void | emitSharedLValue (CodeGenFunction &CGF, unsigned N) |
Emits lvalue for a reduction item. More... | |
void | emitAggregateType (CodeGenFunction &CGF, unsigned N) |
Emits the code for the variable-modified type, if required. More... | |
void | emitAggregateType (CodeGenFunction &CGF, unsigned N, llvm::Value *Size) |
Emits the code for the variable-modified type, if required. More... | |
void | emitInitialization (CodeGenFunction &CGF, unsigned N, Address PrivateAddr, LValue SharedLVal, llvm::function_ref< bool(CodeGenFunction &)> DefaultInit) |
Performs initialization of the private copy for the reduction item. More... | |
bool | needCleanups (unsigned N) |
Returns true if the private copy requires cleanups. More... | |
void | emitCleanups (CodeGenFunction &CGF, unsigned N, Address PrivateAddr) |
Emits cleanup code for the reduction item. More... | |
Address | adjustPrivateAddress (CodeGenFunction &CGF, unsigned N, Address PrivateAddr) |
Adjusts PrivatedAddr for using instead of the original variable address in normal operations. More... | |
LValue | getSharedLValue (unsigned N) const |
Returns LValue for the reduction item. More... | |
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. More... | |
const VarDecl * | getBaseDecl (unsigned N) const |
Returns the base declaration of the reduction item. More... | |
bool | usesReductionInitializer (unsigned N) const |
Returns true if the initialization of the reduction item uses initializer from declare reduction construct. More... | |
Class intended to support codegen of all kind of the reduction clauses.
Definition at line 113 of file CGOpenMPRuntime.h.
ReductionCodeGen::ReductionCodeGen | ( | ArrayRef< const Expr *> | Shareds, |
ArrayRef< const Expr *> | Privates, | ||
ArrayRef< const Expr *> | ReductionOps | ||
) |
Definition at line 924 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 1104 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::Base, clang::CodeGen::CodeGenFunction::Builder, castToBase(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::DeclRefExpr::getDecl(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::ValueDecl::getType(), and loadToBegin().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
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 948 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::VariableArrayType::getSizeExpr(), clang::CodeGen::CodeGenFunction::getTypeSize(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), emitReduceCombFunction(), emitReduceFiniFunction(), and emitReduceInitFunction().
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 986 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), and clang::VariableArrayType::getSizeExpr().
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 1043 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), and clang::CodeGen::CodeGenFunction::pushDestroy().
Referenced by emitReduceFiniFunction().
void ReductionCodeGen::emitInitialization | ( | CodeGenFunction & | CGF, |
unsigned | N, | ||
Address | PrivateAddr, | ||
LValue | SharedLVal, | ||
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. |
SharedLVal | Address of the original shared variable. |
Definition at line 1005 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), emitInitWithReductionInitializer(), clang::CodeGen::LValue::getAddress(), clang::ASTContext::getAsArrayType(), clang::CodeGen::CodeGenFunction::getContext(), getReductionInit(), clang::CodeGen::CodeGenModule::getTBAAInfoForSubobject(), clang::CodeGen::Address::getType(), clang::CodeGen::LValue::getType(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), and emitReduceInitFunction().
void ReductionCodeGen::emitSharedLValue | ( | CodeGenFunction & | CGF, |
unsigned | N | ||
) |
Emits lvalue for a reduction item.
N | Number of the reduction item. |
Definition at line 940 of file CGOpenMPRuntime.cpp.
|
inline |
Returns the base declaration of the reduction item.
Definition at line 193 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
inline |
Returns LValue for the reduction item.
Definition at line 186 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), and emitReduceFiniFunction().
|
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 189 of file CGOpenMPRuntime.h.
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), and emitReduceInitFunction().
bool ReductionCodeGen::needCleanups | ( | unsigned | N | ) |
Returns true if the private copy requires cleanups.
Definition at line 1035 of file CGOpenMPRuntime.cpp.
References clang::QualType::DK_none.
Referenced by emitReduceFiniFunction().
bool ReductionCodeGen::usesReductionInitializer | ( | unsigned | N | ) | const |
Returns true if the initialization of the reduction item uses initializer from declare reduction construct.
Definition at line 1146 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::OMPDeclareReductionDecl::getInitializer(), getReductionInit(), clang::CodeGen::Address::getType(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::EHScopeStack::popTerminate(), and clang::CodeGen::EHScopeStack::pushTerminate().
Referenced by emitReduceFiniFunction(), and emitReduceInitFunction().