clang
7.0.0
|
#include "/work/llvm-www-releases/7.0.0/docsbuild/llvm.src/tools/clang/lib/CodeGen/CGOpenMPRuntime.h"
Classes | |
class | DisableAutoDeclareTargetRAII |
Allows to disable automatic handling of functions used in target regions as those marked as omp declare target . More... | |
Protected Member Functions | |
CGOpenMPRuntime (CodeGenModule &CGM, StringRef FirstSeparator, StringRef Separator) | |
Constructor allowing to redefine the name separator for the variables. More... | |
virtual void | createOffloadEntry (llvm::Constant *ID, llvm::Constant *Addr, uint64_t Size, int32_t Flags, llvm::GlobalValue::LinkageTypes Linkage) |
Creates offloading entry for the provided entry ID ID, address Addr, size Size, and flags Flags. More... | |
virtual void | emitTargetOutlinedFunctionHelper (const OMPExecutableDirective &D, StringRef ParentName, llvm::Function *&OutlinedFn, llvm::Constant *&OutlinedFnID, bool IsOffloadEntry, const RegionCodeGenTy &CodeGen) |
Helper to emit outlined function for 'target' directive. More... | |
void | emitOMPIfClause (CodeGenFunction &CGF, const Expr *Cond, const RegionCodeGenTy &ThenGen, const RegionCodeGenTy &ElseGen) |
Emits code for OpenMP 'if' clause using specified CodeGen function. More... | |
llvm::Value * | emitUpdateLocation (CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags=0) |
Emits object of ident_t type with info for source location. More... | |
llvm::Type * | getIdentTyPointerTy () |
Returns pointer to ident_t type. More... | |
llvm::Value * | getThreadID (CodeGenFunction &CGF, SourceLocation Loc) |
Gets thread id value for the current thread. More... | |
virtual StringRef | getOutlinedHelperName () const |
Get the function name of an outlined region. More... | |
void | emitCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *Callee, ArrayRef< llvm::Value *> Args=llvm::None) const |
Emits Callee function call with arguments Args with location Loc . More... | |
virtual Address | emitThreadIDAddress (CodeGenFunction &CGF, SourceLocation Loc) |
Emits address of the word in a memory where current thread id is stored. More... | |
Protected Attributes | |
CodeGenModule & | CGM |
StringRef | FirstSeparator |
StringRef | Separator |
Definition at line 201 of file CGOpenMPRuntime.h.
|
explicitprotected |
Constructor allowing to redefine the name separator for the variables.
Definition at line 1198 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::CodeGen::clear(), clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::getName(), clang::ASTContext::getRecordType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::loadOffloadInfoMetadata(), clang::TagDecl::startDefinition(), and clang::ASTContext::VoidPtrTy.
|
protectedvirtual |
Creates offloading entry for the provided entry ID ID, address Addr, size Size, and flags Flags.
Definition at line 3830 of file CGOpenMPRuntime.cpp.
References CGM, createConstantGlobalStruct(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::getName(), clang::CodeGen::getTgtOffloadEntryQTy(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::InternalLinkage, clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
protected |
Emits Callee
function call with arguments Args
with location Loc
.
Definition at line 8877 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::emitOutlinedFunctionCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::getParameterAddress(), clang::CodeGen::Address::invalid(), and clang::SourceLocation::isValid().
|
protected |
Emits code for OpenMP 'if' clause using specified CodeGen function.
Here is the logic: if (Cond) { ThenGen(); } else { ElseGen(); }
Definition at line 2751 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::emitParallelCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::Stmt::getSourceRange(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPRTL__kmpc_end_serialized_parallel, OMPRTL__kmpc_fork_call, and OMPRTL__kmpc_serialized_parallel.
Referenced by emitOffloadingArraysArgument(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall(), and clang::CodeGen::markAsGlobalTarget().
|
protectedvirtual |
Helper to emit outlined function for 'target' directive.
D | Directive to emit. |
ParentName | Name of the function that encloses the target region. |
OutlinedFn | Outlined function value to be defined by this call. |
OutlinedFnID | Outlined function ID value to be defined by this call. |
IsOffloadEntry | True if the outlined function is an offload entry. |
CodeGen | Lambda codegen specific to an accelerator device. An outlined function may not be an entry if, e.g. the if clause always evaluates to false. |
Definition at line 6242 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::OMPExecutableDirective::getLocStart(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::getName(), getTargetEntryUniqueInfo(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, and Line.
|
protectedvirtual |
Emits address of the word in a memory where current thread id is stored.
Definition at line 2853 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CapturedStmtInfo, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), getThreadID(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall(), and clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsCall().
|
protected |
Emits object of ident_t type with info for source location.
Flags | Flags for OpenMP location. |
Definition at line 1495 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::Address::getPointer(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::Address::invalid(), clang::SourceLocation::isInvalid(), and clang::codegenoptions::NoDebugInfo.
Referenced by addMonoNonMonoModifier(), emitForStaticInitCall(), emitOMPIfClause(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), emitReduceFiniFunction(), clang::CodeGen::emitThreadPrivateVarInit(), getCancellationKind(), clang::CodeGen::getCriticalRegionLock(), clang::CodeGen::getOrCreateThreadPrivateCache(), and clang::CodeGen::markAsGlobalTarget().
|
protected |
Returns pointer to ident_t type.
Definition at line 1614 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::createRuntimeFunction().
|
inlineprotectedvirtual |
Get the function name of an outlined region.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeNVPTX.
Definition at line 271 of file CGOpenMPRuntime.h.
Referenced by emitParallelOrTeamsOutlinedFunction().
|
protected |
Gets thread id value for the current thread.
Definition at line 1554 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn.
Referenced by addMonoNonMonoModifier(), emitForStaticInitCall(), emitOMPIfClause(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), emitReduceFiniFunction(), emitThreadIDAddress(), getCancellationKind(), clang::CodeGen::getCriticalRegionLock(), clang::CodeGen::getOrCreateThreadPrivateCache(), and clang::CodeGen::markAsGlobalTarget().
|
protected |
Definition at line 215 of file CGOpenMPRuntime.h.
Referenced by createConstantGlobalStructAndAddToParent(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), createOffloadEntry(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), clang::CodeGen::createRuntimeFunction(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitForStaticInitCall(), clang::CodeGen::emitKmpRoutineEntryT(), emitOMPIfClause(), emitParallelOrTeamsOutlinedFunction(), emitReductionCombiner(), clang::CodeGen::emitTaskInit(), clang::CodeGen::emitThreadPrivateVarInit(), emitUpdateLocation(), clang::CodeGen::emitUserDefinedReduction(), clang::CodeGen::getAddrOfDeclareTargetLink(), clang::CodeGen::getCriticalRegionLock(), clang::CodeGen::getKmpc_MicroPointerTy(), clang::CodeGen::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenMPRuntimeNVPTX::getOutlinedHelperName(), clang::CodeGen::getTgtBinaryDescriptorQTy(), clang::CodeGen::getTgtDeviceImageQTy(), clang::CodeGen::getTgtOffloadEntryQTy(), and clang::CodeGen::loadOffloadInfoMetadata().
|
protected |
Definition at line 216 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 216 of file CGOpenMPRuntime.h.