clang  9.0.0svn
Classes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
clang::CodeGen::CGOpenMPRuntime Class Reference

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h"

Inheritance diagram for clang::CodeGen::CGOpenMPRuntime:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGen::CGOpenMPRuntime:
Collaboration graph
[legend]

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::ValueemitUpdateLocation (CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags=0)
 Emits object of ident_t type with info for source location. More...
 
llvm::TypegetIdentTyPointerTy ()
 Returns pointer to ident_t type. More...
 
llvm::ValuegetThreadID (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...
 
void setLocThreadIdInsertPt (CodeGenFunction &CGF, bool AtCurrentPoint=false)
 
void clearLocThreadIdInsertPt (CodeGenFunction &CGF)
 
virtual bool isDefaultLocationConstant () const
 Check if the default location must be constant. More...
 
virtual unsigned getDefaultLocationReserved2Flags () const
 Returns additional flags that can be stored in reserved_2 field of the default location. More...
 
llvm::ArrayType * getKmpCriticalNameTy () const
 Get the LLVM type for the critical name. More...
 
llvm::ValuegetCriticalRegionLock (StringRef CriticalName)
 Returns corresponding lock object for the specified critical region name. More...
 

Static Protected Member Functions

static unsigned getDefaultFlagsForBarriers (OpenMPDirectiveKind Kind)
 Returns default flags for the barriers depending on the directive, for which this barier is going to be emitted. More...
 

Protected Attributes

CodeGenModuleCGM
 
StringRef FirstSeparator
 
StringRef Separator
 

Detailed Description

Definition at line 202 of file CGOpenMPRuntime.h.

Constructor & Destructor Documentation

◆ CGOpenMPRuntime()

CGOpenMPRuntime::CGOpenMPRuntime ( CodeGenModule CGM,
StringRef  FirstSeparator,
StringRef  Separator 
)
explicitprotected

Member Function Documentation

◆ clearLocThreadIdInsertPt()

void CGOpenMPRuntime::clearLocThreadIdInsertPt ( CodeGenFunction CGF)
protected

◆ createOffloadEntry()

void CGOpenMPRuntime::createOffloadEntry ( llvm::Constant *  ID,
llvm::Constant *  Addr,
uint64_t  Size,
int32_t  Flags,
llvm::GlobalValue::LinkageTypes  Linkage 
)
protectedvirtual

◆ emitCall()

void CGOpenMPRuntime::emitCall ( CodeGenFunction CGF,
SourceLocation  Loc,
llvm::Value Callee,
ArrayRef< llvm::Value *>  Args = llvm::None 
) const
protected

◆ emitOMPIfClause()

void CGOpenMPRuntime::emitOMPIfClause ( CodeGenFunction CGF,
const Expr Cond,
const RegionCodeGenTy ThenGen,
const RegionCodeGenTy ElseGen 
)
protected

◆ emitTargetOutlinedFunctionHelper()

void CGOpenMPRuntime::emitTargetOutlinedFunctionHelper ( const OMPExecutableDirective D,
StringRef  ParentName,
llvm::Function *&  OutlinedFn,
llvm::Constant *&  OutlinedFnID,
bool  IsOffloadEntry,
const RegionCodeGenTy CodeGen 
)
protectedvirtual

Helper to emit outlined function for 'target' directive.

Parameters
DDirective to emit.
ParentNameName of the function that encloses the target region.
OutlinedFnOutlined function value to be defined by this call.
OutlinedFnIDOutlined function ID value to be defined by this call.
IsOffloadEntryTrue if the outlined function is an offload entry.
CodeGenLambda 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 6329 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::OMPExecutableDirective::getBeginLoc(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::getName(), getTargetEntryUniqueInfo(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, and Line.

◆ emitThreadIDAddress()

Address CGOpenMPRuntime::emitThreadIDAddress ( CodeGenFunction CGF,
SourceLocation  Loc 
)
protectedvirtual

◆ emitUpdateLocation()

llvm::Value * CGOpenMPRuntime::emitUpdateLocation ( CodeGenFunction CGF,
SourceLocation  Loc,
unsigned  Flags = 0 
)
protected

Emits object of ident_t type with info for source location.

Parameters
FlagsFlags for OpenMP location.

Definition at line 1529 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::CurFuncDecl, clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::PresumedLoc::getColumn(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::CodeGen::Address::getPointer(), clang::SourceManager::getPresumedLoc(), clang::SourceLocation::getRawEncoding(), clang::ASTContext::getSourceManager(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenFunction::getTypeSize(), IdentField_PSource, clang::CodeGen::Address::invalid(), clang::SourceLocation::isInvalid(), clang::CodeGen::Address::isValid(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::codegenoptions::NoDebugInfo, and setLocThreadIdInsertPt().

Referenced by addMonoNonMonoModifier(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitBarrierCall(), clang::CodeGen::emitDeclareSimdFunction(), emitForStaticInitCall(), emitOMPIfClause(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), emitReduceFiniFunction(), clang::CodeGen::emitTaskInit(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(), clang::CodeGen::emitThreadPrivateVarInit(), getCancellationKind(), getCriticalRegionLock(), getDefaultFlagsForBarriers(), clang::CodeGen::getOrCreateThreadPrivateCache(), getThreadID(), and clang::CodeGen::markAsGlobalTarget().

◆ getCriticalRegionLock()

llvm::Value * CGOpenMPRuntime::getCriticalRegionLock ( StringRef  CriticalName)
protected

◆ getDefaultFlagsForBarriers()

unsigned CGOpenMPRuntime::getDefaultFlagsForBarriers ( OpenMPDirectiveKind  Kind)
staticprotected

◆ getDefaultLocationReserved2Flags()

virtual unsigned clang::CodeGen::CGOpenMPRuntime::getDefaultLocationReserved2Flags ( ) const
inlineprotectedvirtual

Returns additional flags that can be stored in reserved_2 field of the default location.

Reimplemented in clang::CodeGen::CGOpenMPRuntimeNVPTX.

Definition at line 292 of file CGOpenMPRuntime.h.

Referenced by createConstantGlobalStructAndAddToParent().

◆ getIdentTyPointerTy()

llvm::Type * CGOpenMPRuntime::getIdentTyPointerTy ( )
protected

Returns pointer to ident_t type.

Definition at line 1654 of file CGOpenMPRuntime.cpp.

Referenced by clang::CodeGen::createRuntimeFunction(), and clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelCall().

◆ getKmpCriticalNameTy()

llvm::ArrayType* clang::CodeGen::CGOpenMPRuntime::getKmpCriticalNameTy ( ) const
inlineprotected

Get the LLVM type for the critical name.

Definition at line 299 of file CGOpenMPRuntime.h.

◆ getOutlinedHelperName()

virtual StringRef clang::CodeGen::CGOpenMPRuntime::getOutlinedHelperName ( ) const
inlineprotectedvirtual

Get the function name of an outlined region.

Reimplemented in clang::CodeGen::CGOpenMPRuntimeNVPTX.

Definition at line 272 of file CGOpenMPRuntime.h.

Referenced by emitParallelOrTeamsOutlinedFunction().

◆ getThreadID()

llvm::Value * CGOpenMPRuntime::getThreadID ( CodeGenFunction CGF,
SourceLocation  Loc 
)
protected

◆ isDefaultLocationConstant()

virtual bool clang::CodeGen::CGOpenMPRuntime::isDefaultLocationConstant ( ) const
inlineprotectedvirtual

Check if the default location must be constant.

Default is false to support OMPT/OMPD.

Reimplemented in clang::CodeGen::CGOpenMPRuntimeNVPTX.

Definition at line 288 of file CGOpenMPRuntime.h.

Referenced by createConstantGlobalStructAndAddToParent().

◆ setLocThreadIdInsertPt()

void CGOpenMPRuntime::setLocThreadIdInsertPt ( CodeGenFunction CGF,
bool  AtCurrentPoint = false 
)
protected

Member Data Documentation

◆ CGM

CodeGenModule& clang::CodeGen::CGOpenMPRuntime::CGM
protected

◆ FirstSeparator

StringRef clang::CodeGen::CGOpenMPRuntime::FirstSeparator
protected

Definition at line 217 of file CGOpenMPRuntime.h.

Referenced by CGOpenMPRuntime().

◆ Separator

StringRef clang::CodeGen::CGOpenMPRuntime::Separator
protected

Definition at line 217 of file CGOpenMPRuntime.h.

Referenced by CGOpenMPRuntime().


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