clang 17.0.0git
|
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h"
Classes | |
struct | DebugLocThreadIdTy |
Stores debug location and ThreadID for the function. More... | |
class | DisableAutoDeclareTargetRAII |
Allows to disable automatic handling of functions used in target regions as those marked as omp declare target . More... | |
struct | DispatchRTInput |
struct with the values to be passed to the dispatch runtime function More... | |
struct | LastprivateConditionalData |
Maps the expression for the lastprivate variable to the global copy used to store new value because original variables are not mapped in inner parallel regions. More... | |
class | LastprivateConditionalRAII |
Manages list of lastprivate conditional decls for the specified directive. More... | |
class | NontemporalDeclsRAII |
Manages list of nontemporal decls for the specified directive. More... | |
struct | ReductionOptionsTy |
struct | StaticRTInput |
Struct with the values to be passed to the static runtime function. More... | |
class | TargetDataInfo |
Struct that keeps all the relevant information that should be kept throughout a 'target data' region. More... | |
struct | TaskResultTy |
class | UntiedTaskLocalDeclsRAII |
Manages list of nontemporal decls for the specified directive. More... | |
Public Member Functions | |
llvm::OpenMPIRBuilder & | getOMPBuilder () |
CGOpenMPRuntime (CodeGenModule &CGM) | |
virtual | ~CGOpenMPRuntime () |
virtual void | clear () |
virtual bool | isTargetCodegen () const |
Returns true if the current target is a GPU. | |
void | emitIfClause (CodeGenFunction &CGF, const Expr *Cond, const RegionCodeGenTy &ThenGen, const RegionCodeGenTy &ElseGen) |
Emits code for OpenMP 'if' clause using specified CodeGen function. | |
std::string | getName (ArrayRef< StringRef > Parts) const |
Get the platform-specific name separator. | |
virtual void | emitUserDefinedReduction (CodeGenFunction *CGF, const OMPDeclareReductionDecl *D) |
Emit code for the specified user defined reduction construct. | |
virtual std::pair< llvm::Function *, llvm::Function * > | getUserDefinedReduction (const OMPDeclareReductionDecl *D) |
Get combiner/initializer for the specified user-defined reduction, if any. | |
void | emitUserDefinedMapper (const OMPDeclareMapperDecl *D, CodeGenFunction *CGF=nullptr) |
Emit the function for the user defined mapper construct. | |
llvm::Function * | getOrCreateUserDefinedMapperFunc (const OMPDeclareMapperDecl *D) |
Get the function for the specified user-defined mapper. | |
virtual llvm::Function * | emitParallelOutlinedFunction (CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) |
Emits outlined function for the specified OpenMP parallel directive D. | |
virtual llvm::Function * | emitTeamsOutlinedFunction (CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) |
Emits outlined function for the specified OpenMP teams directive D. | |
virtual llvm::Function * | emitTaskOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, const VarDecl *PartIDVar, const VarDecl *TaskTVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, bool Tied, unsigned &NumberOfParts) |
Emits outlined function for the OpenMP task directive D. | |
virtual void | functionFinished (CodeGenFunction &CGF) |
Cleans up references to the objects in finished function. | |
virtual void | emitParallelCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars, const Expr *IfCond, llvm::Value *NumThreads) |
Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct. | |
virtual void | emitCriticalRegion (CodeGenFunction &CGF, StringRef CriticalName, const RegionCodeGenTy &CriticalOpGen, SourceLocation Loc, const Expr *Hint=nullptr) |
Emits a critical region. | |
virtual void | emitMasterRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MasterOpGen, SourceLocation Loc) |
Emits a master region. | |
virtual void | emitMaskedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MaskedOpGen, SourceLocation Loc, const Expr *Filter=nullptr) |
Emits a masked region. | |
virtual void | emitTaskyieldCall (CodeGenFunction &CGF, SourceLocation Loc) |
Emits code for a taskyield directive. | |
virtual void | emitErrorCall (CodeGenFunction &CGF, SourceLocation Loc, Expr *ME, bool IsFatal) |
Emit __kmpc_error call for error directive extern void __kmpc_error(ident_t *loc, int severity, const char *message);. | |
virtual void | emitTaskgroupRegion (CodeGenFunction &CGF, const RegionCodeGenTy &TaskgroupOpGen, SourceLocation Loc) |
Emit a taskgroup region. | |
virtual void | emitSingleRegion (CodeGenFunction &CGF, const RegionCodeGenTy &SingleOpGen, SourceLocation Loc, ArrayRef< const Expr * > CopyprivateVars, ArrayRef< const Expr * > DestExprs, ArrayRef< const Expr * > SrcExprs, ArrayRef< const Expr * > AssignmentOps) |
Emits a single region. | |
virtual void | emitOrderedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &OrderedOpGen, SourceLocation Loc, bool IsThreads) |
Emit an ordered region. | |
virtual void | emitBarrierCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind Kind, bool EmitChecks=true, bool ForceSimpleCall=false) |
Emit an implicit/explicit barrier for OpenMP threads. | |
virtual bool | isStaticNonchunked (OpenMPScheduleClauseKind ScheduleKind, bool Chunked) const |
Check if the specified ScheduleKind is static non-chunked. | |
virtual bool | isStaticNonchunked (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) const |
Check if the specified ScheduleKind is static non-chunked. | |
virtual bool | isStaticChunked (OpenMPScheduleClauseKind ScheduleKind, bool Chunked) const |
Check if the specified ScheduleKind is static chunked. | |
virtual bool | isStaticChunked (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) const |
Check if the specified ScheduleKind is static non-chunked. | |
virtual bool | isDynamic (OpenMPScheduleClauseKind ScheduleKind) const |
Check if the specified ScheduleKind is dynamic. | |
virtual void | emitForDispatchInit (CodeGenFunction &CGF, SourceLocation Loc, const OpenMPScheduleTy &ScheduleKind, unsigned IVSize, bool IVSigned, bool Ordered, const DispatchRTInput &DispatchValues) |
Call the appropriate runtime routine to initialize it before start of loop. | |
virtual void | emitForStaticInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind DKind, const OpenMPScheduleTy &ScheduleKind, const StaticRTInput &Values) |
Call the appropriate runtime routine to initialize it before start of loop. | |
virtual void | emitDistributeStaticInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDistScheduleClauseKind SchedKind, const StaticRTInput &Values) |
virtual void | emitForOrderedIterationEnd (CodeGenFunction &CGF, SourceLocation Loc, unsigned IVSize, bool IVSigned) |
Call the appropriate runtime routine to notify that we finished iteration of the ordered loop with the dynamic scheduling. | |
virtual void | emitForStaticFinish (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind DKind) |
Call the appropriate runtime routine to notify that we finished all the work with current loop. | |
virtual llvm::Value * | emitForNext (CodeGenFunction &CGF, SourceLocation Loc, unsigned IVSize, bool IVSigned, Address IL, Address LB, Address UB, Address ST) |
Call __kmpc_dispatch_next( ident_t *loc, kmp_int32 tid, kmp_int32 *p_lastiter, kmp_int[32|64] *p_lower, kmp_int[32|64] *p_upper, kmp_int[32|64] *p_stride);. | |
virtual void | emitNumThreadsClause (CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc) |
Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
global_tid, kmp_int32 num_threads) to generate code for 'num_threads' clause. | |
virtual void | emitProcBindClause (CodeGenFunction &CGF, llvm::omp::ProcBindKind ProcBind, SourceLocation Loc) |
Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32
global_tid, int proc_bind) to generate code for 'proc_bind' clause. | |
virtual Address | getAddrOfThreadPrivate (CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr, SourceLocation Loc) |
Returns address of the threadprivate variable for the current thread. | |
virtual Address | getAddrOfDeclareTargetVar (const VarDecl *VD) |
Returns the address of the variable marked as declare target with link clause OR as declare target with to clause and unified memory. | |
virtual llvm::Function * | emitThreadPrivateVarDefinition (const VarDecl *VD, Address VDAddr, SourceLocation Loc, bool PerformInit, CodeGenFunction *CGF=nullptr) |
Emit a code for initialization of threadprivate variable. | |
virtual bool | emitDeclareTargetVarDefinition (const VarDecl *VD, llvm::GlobalVariable *Addr, bool PerformInit) |
Emit a code for initialization of declare target variable. | |
virtual Address | getAddrOfArtificialThreadPrivate (CodeGenFunction &CGF, QualType VarType, StringRef Name) |
Creates artificial threadprivate variable with name Name and type VarType . | |
virtual void | emitFlush (CodeGenFunction &CGF, ArrayRef< const Expr * > Vars, SourceLocation Loc, llvm::AtomicOrdering AO) |
Emit flush of the variables specified in 'omp flush' directive. | |
virtual void | emitTaskCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, llvm::Function *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data) |
Emit task region for the task directive. | |
virtual void | emitTaskLoopCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPLoopDirective &D, llvm::Function *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data) |
Emit task region for the taskloop directive. | |
virtual void | emitInlinedDirective (CodeGenFunction &CGF, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, bool HasCancel=false) |
Emit code for the directive that does not require outlining. | |
llvm::Function * | emitReductionFunction (StringRef ReducerName, SourceLocation Loc, llvm::Type *ArgsElemType, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps) |
Emits reduction function. | |
void | emitSingleReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp, const Expr *PrivateRef, const DeclRefExpr *LHS, const DeclRefExpr *RHS) |
Emits single reduction combiner. | |
virtual void | emitReduction (CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps, ReductionOptionsTy Options) |
Emit a code for reduction clause. | |
virtual llvm::Value * | emitTaskReductionInit (CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, const OMPTaskDataTy &Data) |
Emit a code for initialization of task reduction clause. | |
virtual void | emitTaskReductionFini (CodeGenFunction &CGF, SourceLocation Loc, bool IsWorksharingReduction) |
Emits the following code for reduction clause with task modifier: | |
virtual void | emitTaskReductionFixups (CodeGenFunction &CGF, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) |
Required to resolve existing problems in the runtime. | |
virtual Address | getTaskReductionItem (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *ReductionsPtr, LValue SharedLVal) |
Get the address of void * type of the privatue copy of the reduction item specified by the SharedLVal . | |
virtual void | emitTaskwaitCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPTaskDataTy &Data) |
Emit code for 'taskwait' directive. | |
virtual void | emitCancellationPointCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind CancelRegion) |
Emit code for 'cancellation point' construct. | |
virtual void | emitCancelCall (CodeGenFunction &CGF, SourceLocation Loc, const Expr *IfCond, OpenMPDirectiveKind CancelRegion) |
Emit code for 'cancel' construct. | |
virtual void | emitTargetOutlinedFunction (const OMPExecutableDirective &D, StringRef ParentName, llvm::Function *&OutlinedFn, llvm::Constant *&OutlinedFnID, bool IsOffloadEntry, const RegionCodeGenTy &CodeGen) |
Emit outilined function for 'target' directive. | |
virtual void | emitTargetCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, llvm::Function *OutlinedFn, llvm::Value *OutlinedFnID, const Expr *IfCond, llvm::PointerIntPair< const Expr *, 2, OpenMPDeviceClauseModifier > Device, llvm::function_ref< llvm::Value *(CodeGenFunction &CGF, const OMPLoopDirective &D)> SizeEmitter) |
Emit the target offloading code associated with D. | |
virtual bool | emitTargetFunctions (GlobalDecl GD) |
Emit the target regions enclosed in GD function definition or the function itself in case it is a valid device function. | |
virtual bool | emitTargetGlobalVariable (GlobalDecl GD) |
Emit the global variable if it is a valid device global variable. | |
virtual void | registerTargetGlobalVariable (const VarDecl *VD, llvm::Constant *Addr) |
Checks if the provided global decl GD is a declare target variable and registers it when emitting code for the host. | |
virtual bool | emitTargetGlobal (GlobalDecl GD) |
Emit the global GD if it is meaningful for the target. | |
llvm::Function * | emitRequiresDirectiveRegFun () |
Creates and returns a registration function for when at least one requires directives was used in the current module. | |
void | createOffloadEntriesAndInfoMetadata () |
Creates all the offload entries in the current compilation unit along with the associated metadata. | |
virtual void | emitTeamsCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars) |
Emits code for teams call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct. | |
virtual void | emitNumTeamsClause (CodeGenFunction &CGF, const Expr *NumTeams, const Expr *ThreadLimit, SourceLocation Loc) |
Emits call to void __kmpc_push_num_teams(ident_t *loc, kmp_int32
global_tid, kmp_int32 num_teams, kmp_int32 thread_limit) to generate code for num_teams clause. | |
virtual void | emitTargetDataCalls (CodeGenFunction &CGF, const OMPExecutableDirective &D, const Expr *IfCond, const Expr *Device, const RegionCodeGenTy &CodeGen, CGOpenMPRuntime::TargetDataInfo &Info) |
Emit the target data mapping code associated with D. | |
virtual void | emitTargetDataStandAloneCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, const Expr *IfCond, const Expr *Device) |
Emit the data mapping/movement code associated with the directive D that should be of the form 'target [{enter|exit} data | update]'. | |
virtual void | emitDeclareSimdFunction (const FunctionDecl *FD, llvm::Function *Fn) |
Marks function Fn with properly mangled versions of vector functions. | |
virtual void | emitDoacrossInit (CodeGenFunction &CGF, const OMPLoopDirective &D, ArrayRef< Expr * > NumIterations) |
Emit initialization for doacross loop nesting support. | |
virtual void | emitDoacrossOrdered (CodeGenFunction &CGF, const OMPDependClause *C) |
Emit code for doacross ordered directive with 'depend' clause. | |
virtual const VarDecl * | translateParameter (const FieldDecl *FD, const VarDecl *NativeParam) const |
Translates the native parameter of outlined function if this is required for target. | |
virtual Address | getParameterAddress (CodeGenFunction &CGF, const VarDecl *NativeParam, const VarDecl *TargetParam) const |
Gets the address of the native argument basing on the address of the target-specific parameter. | |
virtual void | getDefaultDistScheduleAndChunk (CodeGenFunction &CGF, const OMPLoopDirective &S, OpenMPDistScheduleClauseKind &ScheduleKind, llvm::Value *&Chunk) const |
Choose default schedule type and chunk value for the dist_schedule clause. | |
virtual void | getDefaultScheduleAndChunk (CodeGenFunction &CGF, const OMPLoopDirective &S, OpenMPScheduleClauseKind &ScheduleKind, const Expr *&ChunkExpr) const |
Choose default schedule type and chunk value for the schedule clause. | |
virtual void | emitOutlinedFunctionCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::FunctionCallee OutlinedFn, ArrayRef< llvm::Value * > Args=std::nullopt) const |
Emits call of the outlined function with the provided arguments, translating these arguments to correct target-specific arguments. | |
virtual void | emitFunctionProlog (CodeGenFunction &CGF, const Decl *D) |
Emits OpenMP-specific function prolog. | |
virtual Address | getAddressOfLocalVariable (CodeGenFunction &CGF, const VarDecl *VD) |
Gets the OpenMP-specific address of the local variable. | |
bool | markAsGlobalTarget (GlobalDecl GD) |
Marks the declaration as already emitted for the device code and returns true, if it was marked already, and false, otherwise. | |
void | emitDeferredTargetDecls () const |
Emit deferred declare target variables marked for deferred emission. | |
virtual void | adjustTargetSpecificDataForLambdas (CodeGenFunction &CGF, const OMPExecutableDirective &D) const |
Adjust some parameters for the target-based directives, like addresses of the variables captured by reference in lambdas. | |
virtual void | processRequiresDirective (const OMPRequiresDecl *D) |
Perform check on requires decl to ensure that target architecture supports unified addressing. | |
llvm::AtomicOrdering | getDefaultMemoryOrdering () const |
Gets default memory ordering as specified in requires directive. | |
virtual bool | hasAllocateAttributeForGlobalVar (const VarDecl *VD, LangAS &AS) |
Checks if the variable has associated OMPAllocateDeclAttr attribute with the predefined allocator and translates it into the corresponding address space. | |
bool | hasRequiresUnifiedSharedMemory () const |
Return whether the unified_shared_memory has been specified. | |
bool | isNontemporalDecl (const ValueDecl *VD) const |
Checks if the VD variable is marked as nontemporal declaration in current context. | |
Address | emitLastprivateConditionalInit (CodeGenFunction &CGF, const VarDecl *VD) |
Create specialized alloca to handle lastprivate conditionals. | |
virtual void | checkAndEmitLastprivateConditional (CodeGenFunction &CGF, const Expr *LHS) |
Checks if the provided LVal is lastprivate conditional and emits the code to update the value of the original variable. | |
virtual void | checkAndEmitSharedLastprivateConditional (CodeGenFunction &CGF, const OMPExecutableDirective &D, const llvm::DenseSet< CanonicalDeclPtr< const VarDecl > > &IgnoredDecls) |
Checks if the lastprivate conditional was updated in inner region and writes the value. | |
virtual void | emitLastprivateConditionalFinalUpdate (CodeGenFunction &CGF, LValue PrivLVal, const VarDecl *VD, SourceLocation Loc) |
Gets the address of the global copy used for lastprivate conditional update, if any. | |
std::pair< llvm::Value *, Address > | emitDependClause (CodeGenFunction &CGF, ArrayRef< OMPTaskDataTy::DependData > Dependencies, SourceLocation Loc) |
Emits list of dependecies based on the provided data (array of dependence/expression pairs). | |
Address | emitDepobjDependClause (CodeGenFunction &CGF, const OMPTaskDataTy::DependData &Dependencies, SourceLocation Loc) |
Emits list of dependecies based on the provided data (array of dependence/expression pairs) for depobj construct. | |
void | emitDestroyClause (CodeGenFunction &CGF, LValue DepobjLVal, SourceLocation Loc) |
Emits the code to destroy the dependency object provided in depobj directive. | |
void | emitUpdateClause (CodeGenFunction &CGF, LValue DepobjLVal, OpenMPDependClauseKind NewDepKind, SourceLocation Loc) |
Updates the dependency kind in the specified depobj object. | |
void | emitUsesAllocatorsInit (CodeGenFunction &CGF, const Expr *Allocator, const Expr *AllocatorTraits) |
Initializes user defined allocators specified in the uses_allocators clauses. | |
void | emitUsesAllocatorsFini (CodeGenFunction &CGF, const Expr *Allocator) |
Destroys user defined allocators specified in the uses_allocators clause. | |
bool | isLocalVarInUntiedTask (CodeGenFunction &CGF, const VarDecl *VD) const |
Returns true if the variable is a local variable in untied task. | |
Static Public Member Functions | |
static const Stmt * | getSingleCompoundChild (ASTContext &Ctx, const Stmt *Body) |
Checks if the Body is the CompoundStmt and returns its child statement iff there is only one that is not evaluatable at the compile time. | |
Protected Types | |
typedef llvm::DenseMap< SourceLocation, llvm::Value * > | OpenMPDebugLocMapTy |
Map for SourceLocation and OpenMP runtime library debug locations. | |
typedef llvm::DenseMap< llvm::Function *, DebugLocThreadIdTy > | OpenMPLocThreadIDMapTy |
Map of local debug location, ThreadId and functions. | |
typedef llvm::DenseMap< const OMPDeclareReductionDecl *, std::pair< llvm::Function *, llvm::Function * > > | UDRMapTy |
Map of UDRs and corresponding combiner/initializer. | |
typedef llvm::DenseMap< llvm::Function *, SmallVector< const OMPDeclareReductionDecl *, 4 > > | FunctionUDRMapTy |
Map of functions and locally defined UDRs. | |
using | FunctionUDMMapTy = llvm::DenseMap< llvm::Function *, SmallVector< const OMPDeclareMapperDecl *, 4 > > |
Map of functions and their local user-defined mappers. | |
using | NontemporalDeclsSet = llvm::SmallDenseSet< CanonicalDeclPtr< const Decl > > |
using | UntiedLocalVarsAddressesMap = llvm::MapVector< CanonicalDeclPtr< const VarDecl >, std::pair< Address, Address > > |
Protected Member Functions | |
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. | |
llvm::Value * | emitUpdateLocation (CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags=0, bool EmitLoc=false) |
Emits object of ident_t type with info for source location. | |
const Expr * | getNumTeamsExprForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D, int32_t &DefaultVal) |
Emit the number of teams for a target directive. | |
llvm::Value * | emitNumTeamsForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
const Expr * | getNumThreadsExprForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D, int32_t &DefaultVal) |
Emit the number of threads for a target directive. | |
llvm::Value * | emitNumThreadsForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
llvm::Type * | getIdentTyPointerTy () |
Returns pointer to ident_t type. | |
llvm::Value * | getThreadID (CodeGenFunction &CGF, SourceLocation Loc) |
Gets thread id value for the current thread. | |
std::string | getOutlinedHelperName (StringRef Name) const |
Get the function name of an outlined region. | |
std::string | getOutlinedHelperName (CodeGenFunction &CGF) const |
std::string | getReductionFuncName (StringRef Name) const |
Get the function name of a reduction function. | |
void | emitCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::FunctionCallee Callee, ArrayRef< llvm::Value * > Args=std::nullopt) const |
Emits Callee function call with arguments Args with location Loc . | |
virtual Address | emitThreadIDAddress (CodeGenFunction &CGF, SourceLocation Loc) |
Emits address of the word in a memory where current thread id is stored. | |
void | setLocThreadIdInsertPt (CodeGenFunction &CGF, bool AtCurrentPoint=false) |
void | clearLocThreadIdInsertPt (CodeGenFunction &CGF) |
virtual bool | isDefaultLocationConstant () const |
Check if the default location must be constant. | |
virtual unsigned | getDefaultLocationReserved2Flags () const |
Returns additional flags that can be stored in reserved_2 field of the default location. | |
llvm::ArrayType * | getKmpCriticalNameTy () const |
Get the LLVM type for the critical name. | |
llvm::Value * | getCriticalRegionLock (StringRef CriticalName) |
Returns corresponding lock object for the specified critical region name. | |
void | scanForTargetRegionsFunctions (const Stmt *S, StringRef ParentName) |
Start scanning from statement S and emit all target regions found along the way. | |
void | emitKmpRoutineEntryT (QualType KmpInt32Ty) |
Build type kmp_routine_entry_t (if not built yet). | |
llvm::Type * | getKmpc_MicroPointerTy () |
Returns pointer to kmpc_micro type. | |
llvm::FunctionCallee | createForStaticInitFunction (unsigned IVSize, bool IVSigned, bool IsGPUDistribute) |
Returns __kmpc_for_static_init_* runtime function for the specified size IVSize and sign IVSigned. | |
llvm::FunctionCallee | createDispatchInitFunction (unsigned IVSize, bool IVSigned) |
Returns __kmpc_dispatch_init_* runtime function for the specified size IVSize and sign IVSigned. | |
llvm::FunctionCallee | createDispatchNextFunction (unsigned IVSize, bool IVSigned) |
Returns __kmpc_dispatch_next_* runtime function for the specified size IVSize and sign IVSigned. | |
llvm::FunctionCallee | createDispatchFiniFunction (unsigned IVSize, bool IVSigned) |
Returns __kmpc_dispatch_fini_* runtime function for the specified size IVSize and sign IVSigned. | |
llvm::Constant * | getOrCreateThreadPrivateCache (const VarDecl *VD) |
If the specified mangled name is not in the module, create and return threadprivate cache object. | |
void | emitThreadPrivateVarInit (CodeGenFunction &CGF, Address VDAddr, llvm::Value *Ctor, llvm::Value *CopyCtor, llvm::Value *Dtor, SourceLocation Loc) |
Emits initialization code for the threadprivate variables. | |
void | emitUDMapperArrayInitOrDel (CodeGenFunction &MapperCGF, llvm::Value *Handle, llvm::Value *BasePtr, llvm::Value *Ptr, llvm::Value *Size, llvm::Value *MapType, llvm::Value *MapName, CharUnits ElementSize, llvm::BasicBlock *ExitBB, bool IsInit) |
Emit the array initialization or deletion portion for user-defined mapper code generation. | |
TaskResultTy | emitTaskInit (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, llvm::Function *TaskFunction, QualType SharedsTy, Address Shareds, const OMPTaskDataTy &Data) |
Emit task region for the task directive. | |
llvm::Value * | emitTargetNumIterationsCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, llvm::function_ref< llvm::Value *(CodeGenFunction &CGF, const OMPLoopDirective &D)> SizeEmitter) |
Return the trip count of loops associated with constructs / 'target teams distribute' and 'teams distribute parallel for'. | |
void | emitLastprivateConditionalUpdate (CodeGenFunction &CGF, LValue IVLVal, StringRef UniqueDeclName, LValue LVal, SourceLocation Loc) |
Emit update for lastprivate conditional data. | |
std::pair< llvm::Value *, LValue > | getDepobjElements (CodeGenFunction &CGF, LValue DepobjLVal, SourceLocation Loc) |
Returns the number of the elements and the address of the depobj dependency array. | |
SmallVector< llvm::Value *, 4 > | emitDepobjElementsSizes (CodeGenFunction &CGF, QualType &KmpDependInfoTy, const OMPTaskDataTy::DependData &Data) |
void | emitDepobjElements (CodeGenFunction &CGF, QualType &KmpDependInfoTy, LValue PosLVal, const OMPTaskDataTy::DependData &Data, Address DependenciesArray) |
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. | |
Protected Attributes | |
CodeGenModule & | CGM |
llvm::OpenMPIRBuilder | OMPBuilder |
An OpenMP-IR-Builder instance. | |
OpenMPDebugLocMapTy | OpenMPDebugLocMap |
llvm::FunctionType * | Kmpc_MicroTy = nullptr |
The type for a microtask which gets passed to __kmpc_fork_call(). | |
OpenMPLocThreadIDMapTy | OpenMPLocThreadIDMap |
UDRMapTy | UDRMap |
FunctionUDRMapTy | FunctionUDRMap |
llvm::DenseMap< const OMPDeclareMapperDecl *, llvm::Function * > | UDMMap |
Map from the user-defined mapper declaration to its corresponding functions. | |
FunctionUDMMapTy | FunctionUDMMap |
llvm::DenseMap< llvm::Function *, llvm::DenseMap< CanonicalDeclPtr< const Decl >, std::tuple< QualType, const FieldDecl *, const FieldDecl *, LValue > > > | LastprivateConditionalToTypes |
Maps local variables marked as lastprivate conditional to their internal types. | |
llvm::DenseMap< llvm::Function *, unsigned > | FunctionToUntiedTaskStackMap |
Maps function to the position of the untied task locals stack. | |
llvm::ArrayType * | KmpCriticalNameTy |
Type kmp_critical_name, originally defined as typedef kmp_int32 kmp_critical_name[8];. | |
llvm::StringMap< llvm::AssertingVH< llvm::GlobalVariable >, llvm::BumpPtrAllocator > | InternalVars |
An ordered map of auto-generated variables to their unique names. | |
llvm::Type * | KmpRoutineEntryPtrTy = nullptr |
Type typedef kmp_int32 (* kmp_routine_entry_t)(kmp_int32, void *);. | |
QualType | KmpRoutineEntryPtrQTy |
QualType | KmpTaskTQTy |
Type typedef struct kmp_task { void * shareds; /**< pointer to block of pointers to shared vars / kmp_routine_entry_t routine; /**< pointer to routine to call for executing task */ kmp_int32 part_id; /**< part id for the task */ kmp_routine_entry_t destructors; / pointer to function to invoke deconstructors of firstprivate C++ objects */ } kmp_task_t;. | |
QualType | SavedKmpTaskTQTy |
Saved kmp_task_t for task directive. | |
QualType | SavedKmpTaskloopTQTy |
Saved kmp_task_t for taskloop-based directive. | |
QualType | KmpDependInfoTy |
Type typedef struct kmp_depend_info { kmp_intptr_t base_addr; size_t len; struct { bool in:1; bool out:1; } flags; } kmp_depend_info_t;. | |
QualType | KmpTaskAffinityInfoTy |
Type typedef struct kmp_task_affinity_info { kmp_intptr_t base_addr; size_t len; struct { bool flag1 : 1; bool flag2 : 1; kmp_int32 reserved : 30; } flags; } kmp_task_affinity_info_t;. | |
QualType | KmpDimTy |
struct kmp_dim { // loop bounds info casted to kmp_int64 kmp_int64 lo; // lower kmp_int64 up; // upper kmp_int64 st; // stride }; | |
bool | ShouldMarkAsGlobal = true |
llvm::DenseSet< CanonicalDeclPtr< const Decl > > | AlreadyEmittedTargetDecls |
List of the emitted declarations. | |
llvm::StringMap< llvm::WeakTrackingVH > | EmittedNonTargetVariables |
List of the global variables with their addresses that should not be emitted for the target. | |
llvm::SmallDenseSet< const VarDecl * > | DeferredGlobalVariables |
List of variables that can become declare target implicitly and, thus, must be emitted. | |
llvm::SmallVector< NontemporalDeclsSet, 4 > | NontemporalDeclsStack |
Stack for list of declarations in current context marked as nontemporal. | |
llvm::SmallVector< UntiedLocalVarsAddressesMap, 4 > | UntiedLocalVarsStack |
llvm::SmallVector< LastprivateConditionalData, 4 > | LastprivateConditionalStack |
Stack for list of addresses of declarations in current context marked as lastprivate conditional. | |
bool | HasRequiresUnifiedSharedMemory = false |
Flag for keeping track of weather a requires unified_shared_memory directive is present. | |
llvm::AtomicOrdering | RequiresAtomicOrdering = llvm::AtomicOrdering::Monotonic |
Atomic ordering from the omp requires directive. | |
bool | HasEmittedTargetRegion = false |
Flag for keeping track of weather a target region has been emitted. | |
bool | HasEmittedDeclareTargetRegion = false |
Flag for keeping track of weather a device routine has been emitted. | |
llvm::StringSet | ThreadPrivateWithDefinition |
Set of threadprivate variables with the generated initializer. | |
llvm::StringSet | DeclareTargetWithDefinition |
Set of declare target variables with the generated initializer. | |
Definition at line 229 of file CGOpenMPRuntime.h.
|
protected |
Map of functions and their local user-defined mappers.
Definition at line 448 of file CGOpenMPRuntime.h.
|
protected |
Map of functions and locally defined UDRs.
Definition at line 442 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 525 of file CGOpenMPRuntime.h.
|
protected |
Map for SourceLocation and OpenMP runtime library debug locations.
Definition at line 417 of file CGOpenMPRuntime.h.
|
protected |
Map of local debug location, ThreadId and functions.
Definition at line 432 of file CGOpenMPRuntime.h.
|
protected |
Map of UDRs and corresponding combiner/initializer.
Definition at line 437 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 530 of file CGOpenMPRuntime.h.
|
explicit |
Definition at line 1056 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getLangOpts(), hasRequiresUnifiedSharedMemory(), clang::CodeGen::CodeGenTypeCache::Int32Ty, KmpCriticalNameTy, OMPBuilder, and clang::LangOptions::OMPHostIRFile.
|
inlinevirtual |
Definition at line 687 of file CGOpenMPRuntime.h.
|
virtual |
Adjust some parameters for the target-based directives, like addresses of the variables captured by reference in lambdas.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10422 of file CGOpenMPRuntime.cpp.
References clang::OMPExecutableDirective::getDirectiveKind(), and clang::isOpenMPTargetExecutionDirective().
Referenced by emitOMPSimdRegion(), emitTargetParallelRegion(), emitTargetRegion(), and emitTargetTeamsRegion().
|
virtual |
Checks if the provided LVal
is lastprivate conditional and emits the code to update the value of the original variable.
Definition at line 12232 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitAtomicStore(), emitLastprivateConditionalUpdate(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getExprLoc(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::ASTContext::getPointerType(), clang::ValueDecl::getType(), LastprivateConditionalStack, LastprivateConditionalToTypes, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by checkForLastprivateConditionalUpdate(), emitOMPAtomicCaptureExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), and emitOMPAtomicWriteExpr().
|
virtual |
Checks if the lastprivate conditional was updated in inner region and writes the value.
Definition at line 12276 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CapturedStmt::capturesVariable(), clang::CodeGen::ApplyDebugLocation::CreateArtificial(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitBlock(), emitLastprivateConditionalUpdate(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::OMPExecutableDirective::getBeginLoc(), clang::OMPExecutableDirective::getCapturedStmt(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::QualType::getNonReferenceType(), clang::getOpenMPCaptureRegions(), clang::ValueDecl::getType(), clang::Type::isReferenceType(), LastprivateConditionalStack, LastprivateConditionalToTypes, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by checkForLastprivateConditionalUpdate().
|
virtual |
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1068 of file CGOpenMPRuntime.cpp.
References Data, EmittedNonTargetVariables, and InternalVars.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::clear().
|
protected |
Definition at line 1356 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn, and OpenMPLocThreadIDMap.
Referenced by functionFinished().
|
protected |
Returns __kmpc_dispatch_fini_* runtime function for the specified size IVSize and sign IVSigned.
Definition at line 1565 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), getIdentTyPointerTy(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by emitForOrderedIterationEnd().
|
protected |
Returns __kmpc_dispatch_init_* runtime function for the specified size IVSize and sign IVSigned.
Definition at line 1543 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), getIdentTyPointerTy(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by emitForDispatchInit().
|
protected |
Returns __kmpc_dispatch_next_* runtime function for the specified size IVSize and sign IVSigned.
Definition at line 1582 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), getIdentTyPointerTy(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and clang::CodeGen::CodeGenTypeCache::Int64Ty.
Referenced by emitForNext().
|
protected |
Returns __kmpc_for_static_init_* runtime function for the specified size IVSize and sign IVSigned.
Will create a distribute call __kmpc_distribute_static_init* if IsGPUDistribute is set.
Definition at line 1508 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), getIdentTyPointerTy(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by emitDistributeStaticInit(), and emitForStaticInit().
void CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata | ( | ) |
Creates all the offload entries in the current compilation unit along with the associated metadata.
Definition at line 2963 of file CGOpenMPRuntime.cpp.
References CGM, clang::DiagnosticsEngine::Error, clang::SourceManager::fileinfo_begin(), clang::SourceManager::fileinfo_end(), clang::CodeGen::CodeGenModule::getContext(), clang::DiagnosticsEngine::getCustomDiagID(), clang::CodeGen::CodeGenModule::getDiags(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::ASTContext::getSourceManager(), OMPBuilder, clang::DiagnosticsEngine::Report(), and clang::SourceManager::translateFileLineCol().
|
virtual |
Emit an implicit/explicit barrier for OpenMP threads.
Kind | Directive for which this implicit barrier call must be generated. Must be OMPD_barrier for explicit barrier generation. |
EmitChecks | true if need to emit checks for cancellation barriers. |
ForceSimpleCall | true simple barrier call must be emitted, false if runtime class decides which one to emit (simple or with cancellation checks). |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2529 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranchThroughCleanup(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getDefaultFlagsForBarriers(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::getOMPCancelDestination(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::Result.
Referenced by emitCancelCall(), emitCancellationPointCall(), emitInterWarpCopyFunction(), emitOMPCopyinClause(), and emitWorksharingDirective().
|
protected |
Emits Callee
function call with arguments Args
with location Loc
.
Definition at line 11659 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), and clang::SourceLocation::isValid().
Referenced by emitOutlinedFunctionCall().
|
virtual |
Emit code for 'cancel' construct.
IfCond | Condition in the associated 'if' clause, if it was specified, nullptr otherwise. |
CancelRegion | Region kind for which the cancel must be emitted. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5928 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, emitBarrierCall(), emitIfClause(), emitUpdateLocation(), getCancellationKind(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::Result.
|
virtual |
Emit code for 'cancellation point' construct.
CancelRegion | Region kind for which the cancellation point must be emitted. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5888 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), emitBarrierCall(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranchThroughCleanup(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getCancellationKind(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::getOMPCancelDestination(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::Result.
|
virtual |
Emits a critical region.
CriticalName | Name of the critical region. |
CriticalOpGen | Generator for the statement associated with the given critical region. |
Hint | Value of the 'hint' clause (optional). |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2192 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), getCriticalRegionLock(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), emitLastprivateConditionalUpdate(), and emitReduction().
|
virtual |
Marks function Fn with properly mangled versions of vector functions.
FD | Function marked as 'declare simd'. |
Fn | LLVM function that must be marked with 'declare simd' attributes. |
Definition at line 11377 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, emitAArch64DeclareSimdFunction(), emitX86DeclareSimdFunction(), clang::Expr::EvaluateKnownConstInt(), clang::CodeGen::CodeGenModule::getContext(), clang::Expr::getExprLoc(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::getTarget(), clang::CodeGen::CodeGenModule::getTriple(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::TargetInfo::hasFeature(), clang::Expr::IgnoreParenImpCasts(), P, clang::FunctionDecl::parameters(), clang::Result, clang::Expr::SE_AllowSideEffects, and clang::Decl::specific_attrs().
|
virtual |
Emit a code for initialization of declare target variable.
VD | Declare target variable. |
Addr | Address of the global variable VD. |
PerformInit | true if initialization expression is not constant. |
Definition at line 1844 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeNullaryFunction(), CGM, clang::CodeGen::ApplyDebugLocation::CreateArtificial(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenModule::CreateGlobalInitOrCleanUpFunction(), DeclareTargetWithDefinition, clang::QualType::DK_none, clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::emitDestroy(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::VarDecl::getAnyInitializer(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getDeclAlign(), clang::VarDecl::getDefinition(), clang::CodeGen::CodeGenFunction::getDestroyer(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), clang::CodeGen::CodeGenModule::getModule(), clang::NamedDecl::getName(), getTargetEntryUniqueInfo(), clang::CodeGen::CodeGenModule::getTriple(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), HasRequiresUnifiedSharedMemory, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::QualType::isDestructedType(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), OMPBuilder, clang::LangOptions::OMPTargetTriples, clang::CodeGen::CodeGenFunction::StartFunction(), and clang::ASTContext::VoidTy.
void CGOpenMPRuntime::emitDeferredTargetDecls | ( | ) | const |
Emit deferred declare target variables marked for deferred emission.
Definition at line 10401 of file CGOpenMPRuntime.cpp.
References CGM, DeferredGlobalVariables, clang::CodeGen::CodeGenModule::EmitGlobal(), getAddrOfDeclareTargetVar(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and HasRequiresUnifiedSharedMemory.
std::pair< llvm::Value *, Address > CGOpenMPRuntime::emitDependClause | ( | CodeGenFunction & | CGF, |
ArrayRef< OMPTaskDataTy::DependData > | Dependencies, | ||
SourceLocation | Loc | ||
) |
Emits list of dependecies based on the provided data (array of dependence/expression pairs).
Definition at line 4390 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::ImplicitParamDecl::Create(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::OMPTaskDataTy::DependData::DepExprs, clang::CodeGen::OMPTaskDataTy::DependData::DepKind, emitDependData(), emitDepobjElements(), emitDepobjElementsSizes(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::Address::invalid(), clang::CodeGen::OMPTaskDataTy::DependData::IteratorExpr, KmpDependInfoTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ArrayType::Normal, clang::OMPIteratorExpr::numOfIterators(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenTypeCache::SizeTy, V, clang::VK_PRValue, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitTaskCall(), and emitTaskwaitCall().
Address CGOpenMPRuntime::emitDepobjDependClause | ( | CodeGenFunction & | CGF, |
const OMPTaskDataTy::DependData & | Dependencies, | ||
SourceLocation | Loc | ||
) |
Emits list of dependecies based on the provided data (array of dependence/expression pairs) for depobj construct.
In this case, the variable is allocated in dynamically.
Definition at line 4515 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignTo(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::OMPTaskDataTy::DependData::DepExprs, emitDependData(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getSize(), getThreadID(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::Address::invalid(), clang::CodeGen::OMPTaskDataTy::DependData::IteratorExpr, KmpDependInfoTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ArrayType::Normal, clang::OMPIteratorExpr::numOfIterators(), OMPBuilder, clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
protected |
Definition at line 4353 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), Data, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), getDepobjElements(), clang::Expr::getExprLoc(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::Expr::IgnoreParenImpCasts(), KmpDependInfoTy, and clang::CodeGen::CodeGenTypeCache::SizeTy.
Referenced by emitDependClause().
|
protected |
Definition at line 4315 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreateStore(), Data, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), getDepobjElements(), clang::Expr::getExprLoc(), clang::Expr::IgnoreParenImpCasts(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by emitDependClause().
void CGOpenMPRuntime::emitDestroyClause | ( | CodeGenFunction & | CGF, |
LValue | DepobjLVal, | ||
SourceLocation | Loc | ||
) |
Emits the code to destroy the dependency object provided in depobj directive.
Definition at line 4602 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::CodeGen::Address::getElementType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, KmpDependInfoTy, OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
SchedKind | Schedule kind, specified by the 'dist_schedule' clause. |
Values | Input arguments for the construct. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2811 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, createForStaticInitFunction(), emitForStaticInitCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), getRuntimeSchedule(), getThreadID(), clang::CodeGen::CodeGenModule::getTriple(), clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSigned, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSize, and clang::OMPC_SCHEDULE_MODIFIER_unknown.
|
virtual |
Emit initialization for doacross loop nesting support.
D | Loop-based construct used in doacross nesting construct. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 11555 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::RecordDecl::completeDefinition(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitUpdateLocation(), clang::RecordDecl::field_begin(), clang::Type::getAsTagDecl(), clang::OMPExecutableDirective::getBeginLoc(), clang::CodeGen::CodeGenModule::getContext(), clang::OMPExecutableDirective::getEndLoc(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::QualType::isNull(), KmpDimTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ArrayType::Normal, clang::CodeGen::NormalAndEHCleanup, OMPBuilder, clang::TagDecl::startDefinition(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit code for doacross ordered directive with 'depend' clause.
C | 'depend' clause with 'sink|source' dependency kind. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 11626 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitUpdateLocation(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::Expr::getExprLoc(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::Expr::getType(), clang::ArrayType::Normal, and OMPBuilder.
|
virtual |
Emit __kmpc_error call for error directive extern void __kmpc_error(ident_t *loc, int severity, const char *message);.
Definition at line 2579 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStringLiteralLValue(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit flush of the variables specified in 'omp flush' directive.
Vars | List of variables to flush. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2923 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and OMPBuilder.
Referenced by emitOMPAtomicCaptureExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), and emitOMPAtomicWriteExpr().
|
virtual |
Call the appropriate runtime routine to initialize it before start of loop.
This is used for non static scheduled types and when the ordered clause is present on the loop construct. Depending on the loop schedule, it is necessary to call some runtime routine before start of the OpenMP loop to get the loop upper / lower bounds LB and UB and stride ST.
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
ScheduleKind | Schedule kind, specified by the 'schedule' clause. |
IVSize | Size of the iteration variable in bits. |
IVSigned | Sign of the iteration variable. |
Ordered | true if loop is ordered, false otherwise. |
DispatchValues | struct containing llvm values for lower bound, upper bound, and chunk expression. For the default (nullptr) value, the chunk 1 will be used. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2708 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGOpenMPRuntime::DispatchRTInput::Chunk, createDispatchInitFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getRuntimeSchedule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CGOpenMPRuntime::DispatchRTInput::LB, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, clang::OpenMPScheduleTy::Schedule, and clang::CodeGen::CGOpenMPRuntime::DispatchRTInput::UB.
|
virtual |
Call __kmpc_dispatch_next( ident_t *loc, kmp_int32 tid, kmp_int32 *p_lastiter, kmp_int[32|64] *p_lower, kmp_int[32|64] *p_upper, kmp_int[32|64] *p_stride);.
IVSize | Size of the iteration variable in bits. |
IVSigned | Sign of the iteration variable. |
IL | Address of the output variable in which the flag of the last iteration is returned. |
LB | Address of the output variable in which the lower iteration number is returned. |
UB | Address of the output variable in which the upper iteration number is returned. |
ST | Address of the output variable in which the stride value is returned. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2870 of file CGOpenMPRuntime.cpp.
References clang::ASTContext::BoolTy, createDispatchNextFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), emitUpdateLocation(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::Address::getPointer(), and getThreadID().
|
virtual |
Call the appropriate runtime routine to notify that we finished iteration of the ordered loop with the dynamic scheduling.
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
IVSize | Size of the iteration variable in bits. |
IVSigned | Sign of the iteration variable. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2859 of file CGOpenMPRuntime.cpp.
References createDispatchFiniFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getThreadID(), and clang::CodeGen::CodeGenFunction::HaveInsertPoint().
|
virtual |
Call the appropriate runtime routine to notify that we finished all the work with current loop.
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
DKind | Kind of the directive for which the static finish is emitted. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2832 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenModule::getTriple(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::isOpenMPDistributeDirective(), clang::isOpenMPLoopDirective(), and OMPBuilder.
|
virtual |
Call the appropriate runtime routine to initialize it before start of loop.
This is used only in case of static schedule, when the user did not specify a ordered clause on the loop construct. Depending on the loop schedule, it is necessary to call some runtime routine before start of the OpenMP loop to get the loop upper / lower bounds LB and UB and stride ST.
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
DKind | Kind of the directive. |
ScheduleKind | Schedule kind, specified by the 'schedule' clause. |
Values | Input arguments for the construct. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2790 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), createForStaticInitFunction(), emitForStaticInitCall(), emitUpdateLocation(), getRuntimeSchedule(), getThreadID(), clang::isOpenMPLoopDirective(), clang::isOpenMPWorksharingDirective(), clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSigned, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSize, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Ordered, and clang::OpenMPScheduleTy::Schedule.
|
virtual |
Emits OpenMP-specific function prolog.
Required for device constructs.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 11680 of file CGOpenMPRuntime.cpp.
References HasEmittedDeclareTargetRegion.
void CGOpenMPRuntime::emitIfClause | ( | CodeGenFunction & | CGF, |
const Expr * | Cond, | ||
const RegionCodeGenTy & | ThenGen, | ||
const RegionCodeGenTy & | ElseGen | ||
) |
Emits code for OpenMP 'if' clause using specified CodeGen function.
Here is the logic: if (Cond) { ThenGen(); } else { ElseGen(); }
Definition at line 2009 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), and clang::Stmt::getSourceRange().
Referenced by emitCancelCall(), emitCommonSimdLoop(), emitParallelCall(), emitTargetCall(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), and emitTaskCall().
|
virtual |
Emit code for the directive that does not require outlining.
InnermostKind | Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive). |
CodeGen | Code generation sequence for the D directive. |
HasCancel | true if region has inner cancel directive, false otherwise. |
Definition at line 5850 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CapturedStmtInfo, clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::EmitBody(), and clang::CodeGen::CodeGenFunction::HaveInsertPoint().
Referenced by emitCommonOMPTargetDirective(), emitCriticalRegion(), emitMaskedRegion(), emitMasterRegion(), emitOrderedRegion(), emitSingleRegion(), emitTargetCall(), emitTargetDataStandAloneCall(), emitTargetTeamsDistributeParallelForRegion(), emitTargetTeamsDistributeParallelForSimdRegion(), emitTargetTeamsDistributeRegion(), emitTargetTeamsDistributeSimdRegion(), and emitTaskgroupRegion().
|
protected |
Build type kmp_routine_entry_t (if not built yet).
Definition at line 3013 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getTypes(), KmpRoutineEntryPtrQTy, and KmpRoutineEntryPtrTy.
Referenced by emitTaskInit().
|
virtual |
Gets the address of the global copy used for lastprivate conditional update, if any.
PrivLVal | LValue for the private copy. |
VD | Original lastprivate declaration. |
Definition at line 12326 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::QualType::getNonReferenceType(), clang::CodeGen::LValue::getType(), LastprivateConditionalStack, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Address CGOpenMPRuntime::emitLastprivateConditionalInit | ( | CodeGenFunction & | CGF, |
const VarDecl * | VD | ||
) |
Create specialized alloca to handle lastprivate conditionals.
Definition at line 12040 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::C, CGM, clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getContext(), clang::NamedDecl::getName(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), LastprivateConditionalToTypes, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::TagDecl::startDefinition().
|
protected |
Emit update for lastprivate conditional data.
Definition at line 12146 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), emitCriticalRegion(), clang::CodeGen::CodeGenFunction::EmitLoadOfComplex(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfComplex(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::LValue::getAlignment(), clang::CharUnits::getAsAlign(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::CodeGen::CodeGenModule::getLangOpts(), getName(), clang::CodeGen::LValue::getType(), clang::Type::isSignedIntegerType(), clang::Type::isUnsignedIntegerType(), clang::Last, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), OMPBuilder, clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, and clang::CodeGen::TEK_Scalar.
Referenced by checkAndEmitLastprivateConditional(), and checkAndEmitSharedLastprivateConditional().
|
virtual |
Emits a masked region.
MaskedOpGen | Generator for the statement associated with the given masked region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2245 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
Referenced by emitMasked().
|
virtual |
Emits a master region.
MasterOpGen | Generator for the statement associated with the given master region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2222 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
Referenced by emitMaster().
|
virtual |
Emits call to void __kmpc_push_num_teams(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_teams, kmp_int32 thread_limit) to generate code for num_teams clause.
NumTeams | An integer expression of teams. |
ThreadLimit | An integer expression of threads. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10584 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and OMPBuilder.
Referenced by emitCommonOMPTeamsDirective().
|
protected |
Definition at line 6286 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), getNumTeamsExprForTargetDirective(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by emitTargetCall().
|
virtual |
Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads) to generate code for 'num_threads' clause.
NumThreads | An integer value of threads. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2894 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and OMPBuilder.
Referenced by emitCommonOMPParallelDirective().
|
protected |
Definition at line 6538 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Expr::EvaluateAsBooleanCondition(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CapturedStmt::getCapturedStmt(), clang::OMPExecutableDirective::getClausesOfKind(), clang::OMPIfClause::getCondition(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), getNumThreads(), clang::OMPExecutableDirective::getSingleClause(), getSingleCompoundChild(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::isOpenMPDistributeDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTeamsDirective(), and clang::Result.
Referenced by emitTargetCall().
|
virtual |
Emit an ordered region.
OrderedOpGen | Generator for the statement associated with the given ordered region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2472 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
|
virtual |
Emits call of the outlined function with the provided arguments, translating these arguments to correct target-specific arguments.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 11674 of file CGOpenMPRuntime.cpp.
References emitCall().
Referenced by emitGlobalToListReduceFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitOutlinedFunctionCall(), emitParallelCall(), emitProxyTaskFunction(), emitShuffleAndReduceFunction(), and emitTargetCall().
|
virtual |
Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.
OutlinedFn | Outlined function to be run in parallel threads. Type of this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*). |
CapturedVars | A pointer to the record with the references to variables used in OutlinedFn function. |
IfCond | Condition in the associated 'if' clause, if it was specified, nullptr otherwise. |
NumThreads | The value corresponding to the num_threads clause, if any, or nullptr. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2048 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CreateDefaultAlignTempAlloca(), clang::CodeGen::CGBuilderTy::CreateStore(), emitIfClause(), emitOutlinedFunctionCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitThreadIDAddress(), emitUpdateLocation(), getKmpc_MicroPointerTy(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and OMPBuilder.
Referenced by emitCommonOMPParallelDirective().
|
virtual |
Emits outlined function for the specified OpenMP parallel directive D.
This outlined function has type void(*)(kmp_int32 ThreadID, kmp_int32 BoundID, struct context_vars).
CGF | Reference to current CodeGenFunction. |
D | OpenMP directive. |
ThreadIDVar | Variable for thread id in the current OpenMP region. |
InnermostKind | Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive). |
CodeGen | Code generation sequence for the D directive. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1273 of file CGOpenMPRuntime.cpp.
References CGM, emitParallelOrTeamsOutlinedFunction(), clang::OMPExecutableDirective::getCapturedStmt(), and getOutlinedHelperName().
Referenced by emitCommonOMPParallelDirective(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelOutlinedFunction().
|
virtual |
Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid, int proc_bind) to generate code for 'proc_bind' clause.
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2908 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::IntTy, and OMPBuilder.
Referenced by emitCommonOMPParallelDirective(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitProcBindClause().
|
virtual |
Emit a code for reduction clause.
Next code should be emitted for reduction:
Privates | List of private copies for original reduction arguments. |
LHSExprs | List of LHS in ReductionOps reduction operations. |
RHSExprs | List of RHS in ReductionOps reduction operations. |
ReductionOps | List of reduction operations in form 'LHS binop RHS' or 'operator binop(LHS, RHS)'. |
Options | List of options for reduction codegen: WithNowait true if parent directive has also nowait clause, false otherwise. SimpleReduction Emit reduction operation only. Used for omp simd directive on the host. ReductionKind The kind of reduction to perform. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 5098 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), emitCriticalRegion(), clang::CodeGen::CodeGenFunction::EmitLValue(), EmitOMPAggregateReduction(), emitReductionCombiner(), emitReductionFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitSingleReductionCombiner(), emitUpdateLocation(), clang::CodeGen::PrePostActionTy::Enter(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getContext(), getCriticalRegionLock(), clang::CodeGen::CodeGenModule::getModule(), getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), getThreadID(), clang::Expr::getType(), clang::CodeGen::Address::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::CodeGen::CodeGenFunction::getVLASize(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isVariablyModifiedType(), clang::ArrayType::Normal, clang::CodeGen::CodeGenFunction::VlaSizePair::NumElts, OMPBuilder, clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize(), clang::CodeGen::RegionCodeGenTy::setAction(), clang::CodeGen::CodeGenTypeCache::SizeTy, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and X.
Referenced by clang::CodeGen::CGOpenMPSIMDRuntime::emitReduction(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction().
llvm::Function * CGOpenMPRuntime::emitReductionFunction | ( | StringRef | ReducerName, |
SourceLocation | Loc, | ||
llvm::Type * | ArgsElemType, | ||
ArrayRef< const Expr * > | Privates, | ||
ArrayRef< const Expr * > | LHSExprs, | ||
ArrayRef< const Expr * > | RHSExprs, | ||
ArrayRef< const Expr * > | ReductionOps | ||
) |
Emits reduction function.
ReducerName | Name of the function calling the reduction. |
ArgsElemType | Array type containing pointers to reduction variables. |
Privates | List of private copies for original reduction arguments. |
LHSExprs | List of LHS in ReductionOps reduction operations. |
RHSExprs | List of RHS in ReductionOps reduction operations. |
ReductionOps | List of reduction operations in form 'LHS binop RHS' or 'operator binop(LHS, RHS)'. |
Definition at line 4988 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), emitAddrOfVarFromArray(), EmitOMPAggregateReduction(), emitReductionCombiner(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), getReductionFuncName(), clang::VariableArrayType::getSizeExpr(), clang::CodeGen::CodeGenModule::getTypes(), clang::Type::isVariablyModifiedType(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by emitReduction(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction().
llvm::Function * CGOpenMPRuntime::emitRequiresDirectiveRegFun | ( | ) |
Creates and returns a registration function for when at least one requires directives was used in the current module.
Definition at line 10519 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeNullaryFunction(), clang::C, CGM, clang::CodeGen::CodeGenModule::CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getName(), clang::CodeGen::CodeGenModule::getTypes(), HasEmittedDeclareTargetRegion, HasEmittedTargetRegion, HasRequiresUnifiedSharedMemory, clang::CodeGen::CodeGenTypeCache::Int64Ty, OMPBuilder, clang::LangOptions::OMPTargetTriples, and clang::CodeGen::CodeGenFunction::StartFunction().
void CGOpenMPRuntime::emitSingleReductionCombiner | ( | CodeGenFunction & | CGF, |
const Expr * | ReductionOp, | ||
const Expr * | PrivateRef, | ||
const DeclRefExpr * | LHS, | ||
const DeclRefExpr * | RHS | ||
) |
Emits single reduction combiner.
Definition at line 5078 of file CGOpenMPRuntime.cpp.
References EmitOMPAggregateReduction(), emitReductionCombiner(), clang::DeclRefExpr::getDecl(), clang::Expr::getType(), and clang::Type::isArrayType().
Referenced by emitReduceCombFunction(), emitReduction(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction().
|
virtual |
Emits a single region.
SingleOpGen | Generator for the statement associated with the given single region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2385 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), emitCopyprivateCopyFunction(), emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::Address::invalid(), clang::CodeGen::Address::isValid(), clang::ArrayType::Normal, OMPBuilder, clang::CodeGen::RegionCodeGenTy::setAction(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit the target offloading code associated with D.
The emitted code attempts offloading the execution to the device, an the event of a failure it executes the host version outlined in OutlinedFn.
D | Directive to emit. |
OutlinedFn | Host version of the code to be offloaded. |
OutlinedFnID | ID of host version of the code to be offloaded. |
IfCond | Expression evaluated in if clause associated with the target directive, or null if no if clause is used. |
Device | Expression evaluated in device clause associated with the target directive, or null if no device clause is used and device modifier. |
SizeEmitter | Callback to emit number of iterations for loop-based directives. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 9776 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::BasePointersArray, clang::CodeGen::CodeGenFunction::Builder, clang::CapturedStmt::capture_begin(), clang::CapturedStmt::capture_end(), clang::CapturedStmt::Capture::capturesThis(), clang::CapturedStmt::Capture::capturesVariable(), clang::CapturedStmt::Capture::capturesVariableArrayType(), CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), emitIfClause(), emitInlinedDirective(), emitNumTeamsForTargetDirective(), emitNumThreadsForTargetDirective(), emitOffloadingArrays(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), emitOutlinedFunctionCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitTargetNumIterationsCall(), emitUpdateLocation(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), clang::OMPExecutableDirective::getBeginLoc(), clang::CapturedStmt::getCapturedRecordDecl(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CapturedStmt::Capture::getCapturedVar(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::OMPExecutableDirective::getSingleClause(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::MappersArray, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::NumberOfTargetItems, OMPBuilder, clang::OMPC_DEVICE_unknown, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::PointersArray, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::SizesArray, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitCommonOMPTargetDirective().
|
virtual |
Emit the target data mapping code associated with D.
D | Directive to emit. |
IfCond | Expression evaluated in if clause associated with the target directive, or null if no device clause is used. |
Device | Expression evaluated in device clause associated with the target directive, or null if no device clause is used. |
Info | A record used to store information that needs to be preserved until the region is closed. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 10613 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo::CaptureDeviceAddrMap, CGM, clang::CodeGen::CodeGenFunction::CGM, emitIfClause(), emitOffloadingArrays(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), clang::OMPExecutableDirective::getBeginLoc(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int64Ty, OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
|
virtual |
Emit the data mapping/movement code associated with the directive D that should be of the form 'target [{enter|exit} data | update]'.
D | Directive to emit. |
IfCond | Expression evaluated in if clause associated with the target directive, or null if no if clause is used. |
Device | Expression evaluated in device clause associated with the target directive, or null if no device clause is used. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 10760 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::BasePointersArray, clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::CGM, emitIfClause(), emitInlinedDirective(), emitOffloadingArrays(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), clang::OMPExecutableDirective::getBeginLoc(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::MappersArray, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::NumberOfTargetItems, OMPBuilder, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::PointersArray, clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::SizesArray, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit the target regions enclosed in GD function definition or the function itself in case it is a valid device function.
Returns true if GD was dealt with successfully.
GD | Function to scan. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 10241 of file CGOpenMPRuntime.cpp.
References AlreadyEmittedTargetDecls, CGM, clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), isAssumedToBeNotEmitted(), and scanForTargetRegionsFunctions().
Referenced by emitTargetGlobal().
|
virtual |
Emit the global GD if it is meaningful for the target.
Returns if it was emitted successfully.
GD | Global to scan. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 10393 of file CGOpenMPRuntime.cpp.
References emitTargetFunctions(), emitTargetGlobalVariable(), and clang::GlobalDecl::getDecl().
|
virtual |
Emit the global variable if it is a valid device global variable.
Returns true if GD was dealt with successfully.
GD | Variable declaration to emit. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 10267 of file CGOpenMPRuntime.cpp.
References CGM, clang::Ctor_Complete, clang::CXXRecordDecl::ctors(), DeferredGlobalVariables, clang::Dtor_Complete, clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::GlobalDecl::getDecl(), clang::CXXRecordDecl::getDestructor(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), HasRequiresUnifiedSharedMemory, isAssumedToBeNotEmitted(), and scanForTargetRegionsFunctions().
Referenced by emitTargetGlobal().
|
protected |
Return the trip count of loops associated with constructs / 'target teams distribute' and 'teams distribute parallel for'.
SizeEmitter | Emits the int64 value for the number of iterations of the associated loop. |
Definition at line 9757 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), getNestedDistributeDirective(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::isOpenMPDistributeDirective(), and clang::isOpenMPTeamsDirective().
Referenced by emitTargetCall().
|
virtual |
Emit outilined 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 | Code generation sequence for the D directive. An outlined function may not be an entry if, e.g. the if clause always evaluates to false. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 6002 of file CGOpenMPRuntime.cpp.
References clang::OMPUsesAllocatorsClause::Data::Allocator, clang::OMPUsesAllocatorsClause::Data::AllocatorTraits, clang::C, emitTargetOutlinedFunctionHelper(), clang::OMPExecutableDirective::getClausesOfKind(), HasEmittedTargetRegion, and clang::CodeGen::RegionCodeGenTy::setAction().
Referenced by emitCommonOMPTargetDirective().
|
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 6073 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::OMPExecutableDirective::getBeginLoc(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenModule::getContext(), getNumTeamsExprForTargetDirective(), getNumThreadsExprForTargetDirective(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), getTargetEntryUniqueInfo(), OMPBuilder, and clang::CodeGen::TargetCodeGenInfo::setTargetAttributes().
Referenced by emitTargetOutlinedFunction().
|
virtual |
Emit task region for the task directive.
The task region is emitted in several steps:
D | Current task directive. |
TaskFunction | An LLVM function with type void (*)(i32 /*gtid*/, i32 /*part_id*/, captured_struct /__context*/); |
SharedsTy | A type which contains references the shared variables. |
Shareds | Context with the list of shared variables from the TaskFunction . |
IfCond | Not a nullptr if 'if' clause was specified, nullptr otherwise. |
Data | Additional data for task generation like tiednsee, final state, list of privates etc. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 4678 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, Data, emitDependClause(), emitIfClause(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitTaskInit(), emitUpdateLocation(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), OMPBuilder, clang::Result, clang::CodeGen::RegionCodeGenTy::setAction(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit a taskgroup region.
TaskgroupOpGen | Generator for the statement associated with the given taskgroup region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2294 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
|
protected |
Emit task region for the task directive.
The task region is emitted in several steps:
D | Current task directive. |
TaskFunction | An LLVM function with type void (*)(i32 /*gtid*/, i32 /*part_id*/, captured_struct /__context*/); |
SharedsTy | A type which contains references the shared variables. |
Shareds | Context with the list of shared variables from the TaskFunction . |
Data | Additional data for task generation like tiednsee, final state, list of privates etc. |
Definition at line 3783 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, checkDestructorsRequired(), checkInitIsRequired(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::ImplicitParamDecl::Create(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CGBuilderTy::CreateGEP(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), Data, clang::CodeGen::AggValueSlot::DoesNotOverlap, clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), emitDestructorsFunction(), emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitPrivatesInit(), emitProxyTaskFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), emitUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_empty(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsRecordDecl(), clang::Type::getAsStructureType(), clang::Type::getAsTagDecl(), clang::OMPExecutableDirective::getClausesOfKind(), clang::CodeGen::CodeGenModule::getContext(), clang::RecordType::getDecl(), clang::OMPExecutableDirective::getDirectiveKind(), clang::Expr::getExprLoc(), getKmpAffinityType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), getPointerAndSize(), clang::OMPExecutableDirective::getSingleClause(), clang::CodeGen::CodeGenModule::getSize(), getThreadID(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::Expr::IgnoreParenImpCasts(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::CodeGenTypeCache::IntTy, clang::CodeGen::Address::invalid(), isAllocatableDecl(), clang::QualType::isNull(), clang::isOpenMPTargetDataManagementDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTaskLoopDirective(), KmpRoutineEntryPtrQTy, KmpRoutineEntryPtrTy, KmpTaskAffinityInfoTy, KmpTaskTQTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::ArrayType::Normal, OMPBuilder, clang::ImplicitParamDecl::Other, Priority, clang::Result, SavedKmpTaskloopTQTy, SavedKmpTaskTQTy, clang::CodeGen::CodeGenTypeCache::SizeTy, clang::VK_PRValue, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitTaskCall(), and emitTaskLoopCall().
|
virtual |
Emit task region for the taskloop directive.
The taskloop region is emitted in several steps:
D | Current task directive. |
TaskFunction | An LLVM function with type void (*)(i32 /*gtid*/, i32 /*part_id*/, captured_struct /__context*/); |
SharedsTy | A type which contains references the shared variables. |
Shareds | Context with the list of shared variables from the TaskFunction . |
IfCond | Not a nullptr if 'if' clause was specified, nullptr otherwise. |
Data | Additional data for task generation like tiednsee, final state, list of privates etc. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 4798 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), Data, clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitTaskInit(), emitUpdateLocation(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPLoopDirective::getLowerBoundVariable(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::LValue::getQuals(), clang::OMPLoopDirective::getStrideVariable(), getThreadID(), clang::OMPLoopDirective::getUpperBoundVariable(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::IntTy, OMPBuilder, clang::Result, clang::ASTContext::VoidPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emits outlined function for the OpenMP task directive D.
This outlined function has type void(*)(kmp_int32 ThreadID, struct task_t* TaskT).
D | OpenMP directive. |
ThreadIDVar | Variable for thread id in the current OpenMP region. |
PartIDVar | Variable for partition id in the current OpenMP untied task region. |
TaskTVar | Variable for task_t argument. |
InnermostKind | Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive). |
CodeGen | Code generation sequence for the D directive. |
Tied | true if task is generated for tied task, false otherwise. |
NumberOfParts | Number of parts in untied task. Ignored for tied tasks. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 1293 of file CGOpenMPRuntime.cpp.
References clang::Type::castAs(), CGM, emitUpdateLocation(), clang::OMPExecutableDirective::getBeginLoc(), clang::OMPExecutableDirective::getCapturedStmt(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::ValueDecl::getType(), clang::isOpenMPTaskLoopDirective(), clang::Type::isPointerType(), OMPBuilder, and clang::CodeGen::RegionCodeGenTy::setAction().
|
virtual |
Emits the following code for reduction clause with task modifier:
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5742 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenTypeCache::IntTy, and OMPBuilder.
|
virtual |
Required to resolve existing problems in the runtime.
Emits threadprivate variables to store the size of the VLAs/array sections for initializer/combiner/finalizer functions.
RCG | Allows to reuse an existing data for the reductions. |
N | Reduction item for which fixups must be emitted. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5760 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreateStore(), generateUniqueName(), getAddrOfArtificialThreadPrivate(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), and clang::CodeGen::CodeGenTypeCache::SizeTy.
|
virtual |
Emit a code for initialization of task reduction clause.
Next code should be emitted for reduction:
For reduction clause with task modifier it emits the next call:
LHSExprs | List of LHS in Data.ReductionOps reduction operations. |
RHSExprs | List of RHS in Data.ReductionOps reduction operations. |
Data | Additional data for task generation like tiedness, final state, list of privates, reductions etc. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5613 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), Data, clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::CodeGenFunction::EmitCastToVoidPtr(), clang::CodeGen::CodeGenFunction::EmitCheckedInBoundsGEP(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::ReductionCodeGen::emitSharedOrigLValue(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitUpdateLocation(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::ReductionCodeGen::getOrigLValue(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::ReductionCodeGen::getSharedLValue(), clang::CodeGen::ReductionCodeGen::getSizes(), getThreadID(), clang::CodeGen::LValue::getType(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::IntTy, clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::ArrayType::Normal, OMPBuilder, clang::CodeGen::CodeGenTypeCache::SizeTy, clang::TagDecl::startDefinition(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emit code for 'taskwait' directive.
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5797 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CGM, Data, emitDependClause(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emits code for a taskyield directive.
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2274 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::IntTy, and OMPBuilder.
|
virtual |
Emits code for teams call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.
OutlinedFn | Outlined function to be run by team masters. Type of this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*). |
CapturedVars | A pointer to the record with the references to variables used in OutlinedFn function. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10559 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getKmpc_MicroPointerTy(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and OMPBuilder.
Referenced by emitCommonOMPTeamsDirective().
|
virtual |
Emits outlined function for the specified OpenMP teams directive D.
This outlined function has type void(*)(kmp_int32 ThreadID, kmp_int32 BoundID, struct context_vars).
CGF | Reference to current CodeGenFunction. |
D | OpenMP directive. |
ThreadIDVar | Variable for thread id in the current OpenMP region. |
InnermostKind | Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive). |
CodeGen | Code generation sequence for the D directive. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1283 of file CGOpenMPRuntime.cpp.
References CGM, emitParallelOrTeamsOutlinedFunction(), clang::OMPExecutableDirective::getCapturedStmt(), and getOutlinedHelperName().
Referenced by emitCommonOMPTeamsDirective(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction().
|
protectedvirtual |
Emits address of the word in a memory where current thread id is stored.
Definition at line 2126 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 emitParallelCall(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsCall().
|
virtual |
Emit a code for initialization of threadprivate variable.
It emits a call to runtime library which adds initial value to the newly created threadprivate variable (if it is not constant) and registers destructor for the variable (if any).
VD | Threadprivate variable. |
VDAddr | Address of the global variable VD. |
Loc | Location of threadprivate declaration. |
PerformInit | true if initialization expression is not constant. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 1723 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenTypes::arrangeNullaryFunction(), clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::ApplyDebugLocation::CreateArtificial(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenModule::CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::QualType::DK_none, clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::emitDestroy(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), emitThreadPrivateVarInit(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getAlignment(), clang::VarDecl::getAnyInitializer(), clang::CodeGen::CodeGenModule::getContext(), clang::VarDecl::getDefinition(), clang::CodeGen::CodeGenFunction::getDestroyer(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getMangledName(), getName(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::QualType::isDestructedType(), clang::TargetInfo::isTLSSupported(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenFunction::ReturnValue, clang::CodeGen::CodeGenFunction::StartFunction(), ThreadPrivateWithDefinition, clang::ASTContext::VoidPtrTy, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, clang::ASTContext::VoidTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.
|
protected |
Emits initialization code for the threadprivate variables.
VDAddr | Address of the global variable VD. |
Ctor | Pointer to a global init function for VD. |
CopyCtor | Pointer to a global copy function for VD. |
Dtor | Pointer to a global destructor function for VD. |
Loc | Location of threadprivate declaration. |
Definition at line 1703 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitThreadPrivateVarDefinition().
|
protected |
Emit the array initialization or deletion portion for user-defined mapper code generation.
First, it evaluates whether an array section is mapped and whether the MapType instructs to delete this section. If IsInit is true, and MapType indicates to not delete this array, array initialization code is generated. If IsInit is false, and MapType indicates to not this array, array deletion code is generated.
Definition at line 9678 of file CGOpenMPRuntime.cpp.
References Begin, clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenModule::getModule(), getName(), clang::CharUnits::getQuantity(), and OMPBuilder.
Referenced by emitUserDefinedMapper().
void CGOpenMPRuntime::emitUpdateClause | ( | CodeGenFunction & | CGF, |
LValue | DepobjLVal, | ||
OpenMPDependClauseKind | NewDepKind, | ||
SourceLocation | Loc | ||
) |
Updates the dependency kind in the specified depobj object.
DepobjLVal | LValue for the main depobj object. |
NewDepKind | New dependency kind. |
Definition at line 4629 of file CGOpenMPRuntime.cpp.
References Begin, clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), getDepobjElements(), clang::CodeGen::Address::getPointer(), KmpDependInfoTy, clang::CodeGen::KnownNonNull, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and translateDependencyKind().
|
protected |
Emits object of ident_t type with info for source location.
Flags | Flags for OpenMP location. |
EmitLoc | emit source location with debug-info is off. |
Definition at line 1378 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::CurFuncDecl, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::PresumedLoc::getColumn(), clang::CodeGen::CodeGenFunction::getContext(), getDefaultLocationReserved2Flags(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), and OMPBuilder.
Referenced by emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), emitDistributeStaticInit(), emitDoacrossInit(), emitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForDispatchInit(), emitForNext(), emitForOrderedIterationEnd(), emitForStaticFinish(), emitForStaticInit(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitSingleRegion(), emitTargetCall(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), emitThreadPrivateVarInit(), getAddrOfArtificialThreadPrivate(), getAddrOfThreadPrivate(), and getThreadID().
void CGOpenMPRuntime::emitUserDefinedMapper | ( | const OMPDeclareMapperDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Emit the function for the user defined mapper construct.
Emit the user-defined mapper function.
The code generation follows the pattern in the example below.
Definition at line 9409 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), emitMappingInformation(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUDMapperArrayInitOrDel(), clang::CodeGen::CodeGenFunction::FinishFunction(), FunctionUDMMap, clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::Decl::getLocation(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::OMPDeclareMapperDecl::getMapperVarRef(), clang::CodeGen::CodeGenModule::getModule(), clang::NamedDecl::getName(), getName(), getOrCreateUserDefinedMapperFunc(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::MangleContext::mangleTypeName(), OMPBuilder, clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), UDMMap, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by clang::CodeGen::CodeGenModule::EmitOMPDeclareMapper(), and getOrCreateUserDefinedMapperFunc().
|
virtual |
Emit code for the specified user defined reduction construct.
Definition at line 1142 of file CGOpenMPRuntime.cpp.
References clang::OMPDeclareReductionDecl::CallInit, CGM, clang::CodeGen::CodeGenFunction::CurFn, emitCombinerOrInitializer(), FunctionUDRMap, clang::OMPDeclareReductionDecl::getCombiner(), clang::OMPDeclareReductionDecl::getCombinerIn(), clang::OMPDeclareReductionDecl::getCombinerOut(), clang::OMPDeclareReductionDecl::getInitializer(), clang::OMPDeclareReductionDecl::getInitializerKind(), clang::OMPDeclareReductionDecl::getInitOrig(), clang::OMPDeclareReductionDecl::getInitPriv(), clang::ValueDecl::getType(), clang::Initializer, and UDRMap.
Referenced by clang::CodeGen::CodeGenModule::EmitOMPDeclareReduction(), and getUserDefinedReduction().
void CGOpenMPRuntime::emitUsesAllocatorsFini | ( | CodeGenFunction & | CGF, |
const Expr * | Allocator | ||
) |
Destroys user defined allocators specified in the uses_allocators clause.
Definition at line 6057 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenTypeCache::IntTy, OMPBuilder, and clang::ASTContext::VoidPtrTy.
void CGOpenMPRuntime::emitUsesAllocatorsInit | ( | CodeGenFunction & | CGF, |
const Expr * | Allocator, | ||
const Expr * | AllocatorTraits | ||
) |
Initializes user defined allocators specified in the uses_allocators clauses.
Definition at line 6023 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::LValue::getAddress(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::LValue::getBaseInfo(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getTBAAInfo(), getThreadID(), clang::Expr::getType(), clang::CodeGen::CodeGenTypeCache::IntTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), OMPBuilder, clang::CodeGen::CodeGenTypeCache::VoidPtrPtrTy, clang::ASTContext::VoidPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Cleans up references to the objects in finished function.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1472 of file CGOpenMPRuntime.cpp.
References clearLocThreadIdInsertPt(), clang::CodeGen::CodeGenFunction::CurFn, FunctionToUntiedTaskStackMap, FunctionUDMMap, FunctionUDRMap, LastprivateConditionalToTypes, OpenMPLocThreadIDMap, UDMMap, and UDRMap.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::functionFinished().
|
virtual |
Gets the OpenMP-specific address of the local variable.
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 11722 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignTo(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CharUnits::fromQuantity(), FunctionToUntiedTaskStackMap, getAlignmentValue(), getAllocatorVal(), clang::Decl::getAttr(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getDeclAlign(), clang::SourceLocation::getFromRawEncoding(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::NamedDecl::getName(), getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::ASTContext::getPointerType(), clang::SourceLocation::getRawEncoding(), clang::CodeGen::CodeGenModule::getSize(), getThreadID(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::Decl::hasAttr(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::Address::invalid(), isAllocatableDecl(), clang::CodeGen::Address::isValid(), clang::Type::isVariablyModifiedType(), clang::CodeGen::NormalAndEHCleanup, OMPBuilder, UntiedLocalVarsStack, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Creates artificial threadprivate variable with name Name
and type VarType
.
VarType | Type of the artificial threadprivate variable. |
Name | Name of the artificial threadprivate variable. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 1976 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getName(), clang::CodeGen::CodeGenModule::getTarget(), getThreadID(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::TargetInfo::isTLSSupported(), OMPBuilder, clang::CodeGen::CodeGenTypeCache::SizeTy, clang::CodeGen::CodeGenTypeCache::VoidPtrPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and emitTaskReductionFixups().
Returns the address of the variable marked as declare target with link clause OR as declare target with to clause and unified memory.
Definition at line 1633 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getDeclAlign(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTContext::getPointerType(), getTargetEntryUniqueInfo(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), HasRequiresUnifiedSharedMemory, clang::CodeGen::Address::invalid(), clang::NamedDecl::isExternallyVisible(), OMPBuilder, and registerTargetGlobalVariable().
Referenced by emitDeclTargetVarDeclLValue(), emitDeferredTargetDecls(), clang::CodeGen::CodeGenModule::EmitGlobal(), and registerTargetGlobalVariable().
|
virtual |
Returns address of the threadprivate variable for the current thread.
VD | Threadprivate variable. |
VDAddr | Address of the global variable VD. |
Loc | Location of the reference to threadprivate var. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 1681 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getOrCreateThreadPrivateCache(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenModule::getSize(), clang::ASTContext::getTargetInfo(), clang::CodeGen::CodeGenModule::GetTargetTypeStoreSize(), getThreadID(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::TargetInfo::isTLSSupported(), and OMPBuilder.
Referenced by EmitThreadPrivateVarDeclLValue().
|
protected |
Returns corresponding lock object for the specified critical region name.
If the lock object does not exist it is created, otherwise the reference to the existing copy is returned.
CriticalName | Name of the critical region. |
Definition at line 2143 of file CGOpenMPRuntime.cpp.
References getName(), KmpCriticalNameTy, and OMPBuilder.
Referenced by emitCriticalRegion(), and emitReduction().
|
inlinevirtual |
Choose default schedule type and chunk value for the dist_schedule clause.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1509 of file CGOpenMPRuntime.h.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::getDefaultDistScheduleAndChunk().
|
staticprotected |
Returns default flags for the barriers depending on the directive, for which this barier is going to be emitted.
Definition at line 2496 of file CGOpenMPRuntime.cpp.
Referenced by emitBarrierCall(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall().
|
inlineprotectedvirtual |
Returns additional flags that can be stored in reserved_2 field of the default location.
Definition at line 399 of file CGOpenMPRuntime.h.
Referenced by emitUpdateLocation().
llvm::AtomicOrdering CGOpenMPRuntime::getDefaultMemoryOrdering | ( | ) | const |
Gets default memory ordering as specified in requires directive.
Definition at line 10452 of file CGOpenMPRuntime.cpp.
References RequiresAtomicOrdering.
|
virtual |
Choose default schedule type and chunk value for the schedule clause.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 2511 of file CGOpenMPRuntime.cpp.
References clang::C, clang::IntegerLiteral::Create(), clang::CodeGen::CodeGenFunction::getContext(), and clang::ASTContext::getIntTypeForBitwidth().
|
protected |
Returns the number of the elements and the address of the depobj dependency array.
Definition at line 4217 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::Type::castAs(), CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::RecordDecl::field_begin(), clang::CodeGen::LValue::getAddress(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, KmpDependInfoTy, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by emitDepobjElements(), emitDepobjElementsSizes(), and emitUpdateClause().
|
protected |
Returns pointer to ident_t type.
Definition at line 1493 of file CGOpenMPRuntime.cpp.
References OMPBuilder.
Referenced by createDispatchFiniFunction(), createDispatchInitFunction(), createDispatchNextFunction(), and createForStaticInitFunction().
|
protected |
Returns pointer to kmpc_micro type.
Definition at line 1497 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenTypeCache::Int32Ty, Kmpc_MicroTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by emitParallelCall(), and emitTeamsCall().
|
inlineprotected |
Get the LLVM type for the critical name.
Definition at line 406 of file CGOpenMPRuntime.h.
References KmpCriticalNameTy.
std::string CGOpenMPRuntime::getName | ( | ArrayRef< StringRef > | Parts | ) | const |
Get the platform-specific name separator.
Definition at line 1083 of file CGOpenMPRuntime.cpp.
References OMPBuilder.
Referenced by emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), emitInitWithReductionInitializer(), emitLastprivateConditionalUpdate(), emitOffloadingArrays(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduction(), emitRequiresDirectiveRegFun(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), emitThreadPrivateVarDefinition(), emitUDMapperArrayInitOrDel(), emitUserDefinedMapper(), generateUniqueName(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getCriticalRegionLock(), getOrCreateThreadPrivateCache(), getOutlinedHelperName(), getReductionFuncName(), and registerTargetGlobalVariable().
|
protected |
Emit the number of teams for a target directive.
Inspect the num_teams clause associated with a teams construct combined or closely nested with the target directive.
Emit a team of size one for directives such as 'target parallel' that have no associated teams construct.
Otherwise, return nullptr.
Definition at line 6157 of file CGOpenMPRuntime.cpp.
References clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::Expr::getIntegerConstantExpr(), clang::OMPExecutableDirective::getSingleClause(), getSingleCompoundChild(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::Stmt::IgnoreContainers(), clang::Expr::isIntegerConstantExpr(), clang::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), and clang::isOpenMPTeamsDirective().
Referenced by emitNumTeamsForTargetDirective(), and emitTargetOutlinedFunctionHelper().
|
protected |
Emit the number of threads for a target directive.
Inspect the thread_limit clause associated with a teams construct combined or closely nested with the target directive.
Emit the num_threads clause for directives such as 'target parallel' that have no associated teams construct.
Otherwise, return nullptr.
Definition at line 6416 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getSingleClause(), clang::OMPExecutableDirective::hasClausesOfKind(), and clang::isOpenMPTargetExecutionDirective().
Referenced by emitTargetOutlinedFunctionHelper().
|
inline |
Definition at line 306 of file CGOpenMPRuntime.h.
References OMPBuilder.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), createRuntimeShuffleFunction(), emitOMPAtomicCompareExpr(), emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), and clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate().
|
protected |
If the specified mangled name is not in the module, create and return threadprivate cache object.
This object is a pointer's worth of storage that's reserved for use by the OpenMP runtime.
VD | Threadprivate variable. |
Definition at line 1672 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), getName(), clang::ASTContext::getTargetInfo(), clang::CodeGen::CodeGenTypeCache::Int8PtrPtrTy, clang::TargetInfo::isTLSSupported(), and OMPBuilder.
Referenced by getAddrOfThreadPrivate().
llvm::Function * CGOpenMPRuntime::getOrCreateUserDefinedMapperFunc | ( | const OMPDeclareMapperDecl * | D | ) |
Get the function for the specified user-defined mapper.
If it does not exist, create one.
Definition at line 9748 of file CGOpenMPRuntime.cpp.
References emitUserDefinedMapper(), and UDMMap.
Referenced by emitOffloadingArrays(), and emitUserDefinedMapper().
|
protected |
Definition at line 1264 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn, and getOutlinedHelperName().
|
protected |
Get the function name of an outlined region.
Definition at line 1259 of file CGOpenMPRuntime.cpp.
References getName().
Referenced by emitParallelOutlinedFunction(), emitTeamsOutlinedFunction(), and getOutlinedHelperName().
|
virtual |
Gets the address of the native argument basing on the address of the target-specific parameter.
NativeParam | Parameter itself. |
TargetParam | Corresponding target-specific parameter. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 11686 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar().
Referenced by emitOutlinedFunctionPrologue().
|
protected |
Get the function name of a reduction function.
Definition at line 1268 of file CGOpenMPRuntime.cpp.
References getName().
Referenced by emitReductionFunction().
|
static |
Checks if the Body
is the CompoundStmt and returns its child statement iff there is only one that is not evaluatable at the compile time.
Definition at line 6115 of file CGOpenMPRuntime.cpp.
References clang::C, clang::Stmt::IgnoreContainers(), and isTrivial().
Referenced by emitNumThreadsForTargetDirective(), getDistributeLastprivateVars(), getNestedDistributeDirective(), getNumTeamsExprForTargetDirective(), getNumThreads(), and hasNestedSPMDDirective().
|
virtual |
Get the address of void *
type of the privatue copy of the reduction item specified by the SharedLVal
.
ReductionsPtr | Pointer to the reduction data returned by the emitTaskReductionInit function. |
SharedLVal | Address of the original reduction item. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 5777 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::LValue::getPointer(), getThreadID(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntTy, OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
protected |
Gets thread id value for the current thread.
Definition at line 1403 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), emitUpdateLocation(), getIdentStringFromSourceLocation(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::CodeGenTypeCache::getRuntimeCC(), OMPBuilder, OpenMPLocThreadIDMap, clang::CodeGen::EHScopeStack::requiresLandingPad(), and setLocThreadIdInsertPt().
Referenced by emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), emitDepobjDependClause(), emitDestroyClause(), emitDistributeStaticInit(), emitDoacrossInit(), emitDoacrossOrdered(), emitForDispatchInit(), emitForNext(), emitForOrderedIterationEnd(), emitForStaticFinish(), emitForStaticInit(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitSingleRegion(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitThreadIDAddress(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfThreadPrivate(), and getTaskReductionItem().
|
virtual |
Get combiner/initializer for the specified user-defined reduction, if any.
Definition at line 1169 of file CGOpenMPRuntime.cpp.
References emitUserDefinedReduction(), and UDRMap.
Referenced by emitInitWithReductionInitializer(), and emitReductionCombiner().
Checks if the variable has associated OMPAllocateDeclAttr attribute with the predefined allocator and translates it into the corresponding address space.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10456 of file CGOpenMPRuntime.cpp.
References clang::Default, clang::Decl::getAttr(), and clang::Decl::hasAttr().
bool CGOpenMPRuntime::hasRequiresUnifiedSharedMemory | ( | ) | const |
Return whether the unified_shared_memory has been specified.
Definition at line 10481 of file CGOpenMPRuntime.cpp.
References HasRequiresUnifiedSharedMemory.
Referenced by CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), emitDeclTargetVarDeclLValue(), and clang::CodeGen::CodeGenModule::EmitGlobal().
|
inlineprotectedvirtual |
Check if the default location must be constant.
Default is false to support OMPT/OMPD.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 395 of file CGOpenMPRuntime.h.
|
virtual |
Check if the specified ScheduleKind is dynamic.
This kind of worksharing directive is emitted without outer loop.
ScheduleKind | Schedule Kind specified in the 'schedule' clause. |
Definition at line 2650 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
bool CGOpenMPRuntime::isLocalVarInUntiedTask | ( | CodeGenFunction & | CGF, |
const VarDecl * | VD | ||
) | const |
Returns true if the variable is a local variable in untied task.
Definition at line 11822 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn, FunctionToUntiedTaskStackMap, and UntiedLocalVarsStack.
Checks if the VD
variable is marked as nontemporal declaration in current context.
Definition at line 11880 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and NontemporalDeclsStack.
|
virtual |
Check if the specified ScheduleKind is static non-chunked.
ScheduleKind | Schedule kind specified in the 'dist_schedule' clause. |
Chunked | True if chunk is specified in the clause. |
Definition at line 2644 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
|
virtual |
Check if the specified ScheduleKind is static chunked.
ScheduleKind | Schedule kind specified in the 'schedule' clause. |
Chunked | True if chunk is specified in the clause. |
Definition at line 2637 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
|
virtual |
Check if the specified ScheduleKind is static non-chunked.
This kind of distribute directive is emitted without outer loop.
ScheduleKind | Schedule kind specified in the 'dist_schedule' clause. |
Chunked | True if chunk is specified in the clause. |
Definition at line 2631 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
|
virtual |
Check if the specified ScheduleKind is static non-chunked.
This kind of worksharing directive is emitted without outer loop.
ScheduleKind | Schedule kind specified in the 'schedule' clause. |
Chunked | True if chunk is specified in the clause. |
Definition at line 2624 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
|
inlinevirtual |
Returns true if the current target is a GPU.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 691 of file CGOpenMPRuntime.h.
bool CGOpenMPRuntime::markAsGlobalTarget | ( | GlobalDecl | GD | ) |
Marks the declaration as already emitted for the device code and returns true, if it was marked already, and false, otherwise.
Definition at line 10499 of file CGOpenMPRuntime.cpp.
References AlreadyEmittedTargetDecls, CGM, clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::GetGlobalValue(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), and ShouldMarkAsGlobal.
|
virtual |
Perform check on requires decl to ensure that target architecture supports unified addressing.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10428 of file CGOpenMPRuntime.cpp.
References clang::OMPRequiresDecl::clauselists(), HasRequiresUnifiedSharedMemory, OMPBuilder, clang::OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown, and RequiresAtomicOrdering.
Referenced by clang::CodeGen::CodeGenModule::EmitOMPRequiresDecl(), and clang::CodeGen::CGOpenMPRuntimeGPU::processRequiresDirective().
|
virtual |
Checks if the provided global decl GD is a declare target variable and registers it when emitting code for the host.
Definition at line 10306 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenModule::addCompilerUsedGlobal(), CGM, clang::VarDecl::DeclarationOnly, EmittedNonTargetVariables, getAddrOfDeclareTargetVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::GetGlobalValue(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getLLVMLinkageVarDefinition(), clang::CodeGen::CodeGenModule::getMangledName(), clang::CodeGen::Address::getName(), getName(), clang::CodeGen::CodeGenTypeCache::getPointerSize(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSizeInChars(), clang::VarDecl::hasDefinition(), HasRequiresUnifiedSharedMemory, clang::NamedDecl::isExternallyVisible(), OMPBuilder, and clang::LangOptions::OMPTargetTriples.
Referenced by getAddrOfDeclareTargetVar().
|
protected |
Start scanning from statement S and emit all target regions found along the way.
S | Starting statement. |
ParentName | Name of the function declaration that is being scanned. |
Definition at line 10080 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::EmitOMPTargetDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeSimdDeviceFunction(), clang::Stmt::getBeginLoc(), clang::CodeGen::CodeGenModule::getContext(), getTargetEntryUniqueInfo(), clang::isOpenMPTargetExecutionDirective(), OMPBuilder, and scanForTargetRegionsFunctions().
Referenced by emitTargetFunctions(), emitTargetGlobalVariable(), and scanForTargetRegionsFunctions().
|
protected |
Definition at line 1340 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenTypeCache::Int32Ty, and OpenMPLocThreadIDMap.
Referenced by getThreadID().
|
inlinevirtual |
Translates the native parameter of outlined function if this is required for target.
FD | Field decl from captured record for the parameter. |
NativeParam | Parameter itself. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime, and clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 1494 of file CGOpenMPRuntime.h.
Referenced by emitOutlinedFunctionPrologue().
|
protected |
List of the emitted declarations.
Definition at line 516 of file CGOpenMPRuntime.h.
Referenced by emitTargetFunctions(), and markAsGlobalTarget().
|
protected |
Definition at line 309 of file CGOpenMPRuntime.h.
Referenced by CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), clang::CodeGen::CGOpenMPRuntimeGPU::clear(), createDispatchFiniFunction(), createDispatchInitFunction(), createDispatchNextFunction(), createForStaticInitFunction(), createOffloadEntriesAndInfoMetadata(), emitAArch64DeclareSimdFunction(), emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), emitDeclareSimdFunction(), emitDeclareTargetVarDefinition(), emitDeferredTargetDecls(), emitDependClause(), emitDepobjDependClause(), emitDestroyClause(), emitDistributeStaticInit(), emitDoacrossInit(), emitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForDispatchInit(), emitForStaticFinish(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), emitKmpRoutineEntryT(), emitLastprivateConditionalFinalUpdate(), emitLastprivateConditionalInit(), emitLastprivateConditionalUpdate(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitParallelOutlinedFunction(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitReductionFunction(), emitRequiresDirectiveRegFun(), emitSingleRegion(), emitTargetCall(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTargetFunctions(), emitTargetGlobalVariable(), emitTargetNumIterationsCall(), emitTargetOutlinedFunctionHelper(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionFixups(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), emitTeamsOutlinedFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), emitThreadPrivateVarDefinition(), emitThreadPrivateVarInit(), emitUDMapperArrayInitOrDel(), emitUpdateClause(), emitUpdateLocation(), emitUserDefinedMapper(), emitUserDefinedReduction(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfDeclareTargetVar(), getAddrOfThreadPrivate(), getAlignmentValue(), getDepobjElements(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUWarpSize(), getKmpc_MicroPointerTy(), getOrCreateThreadPrivateCache(), getTaskReductionItem(), getThreadID(), isNontemporalDecl(), markAsGlobalTarget(), clang::CodeGen::CGOpenMPRuntimeGPU::processRequiresDirective(), registerTargetGlobalVariable(), scanForTargetRegionsFunctions(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::~UntiedTaskLocalDeclsRAII().
|
protected |
Set of declare target variables with the generated initializer.
Definition at line 599 of file CGOpenMPRuntime.h.
Referenced by emitDeclareTargetVarDefinition().
|
protected |
List of variables that can become declare target implicitly and, thus, must be emitted.
Definition at line 523 of file CGOpenMPRuntime.h.
Referenced by emitDeferredTargetDecls(), and emitTargetGlobalVariable().
|
protected |
List of the global variables with their addresses that should not be emitted for the target.
Definition at line 519 of file CGOpenMPRuntime.h.
Referenced by clear(), and registerTargetGlobalVariable().
|
protected |
Maps function to the position of the untied task locals stack.
Definition at line 460 of file CGOpenMPRuntime.h.
Referenced by functionFinished(), getAddressOfLocalVariable(), isLocalVarInUntiedTask(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::UntiedTaskLocalDeclsRAII().
|
protected |
Definition at line 451 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedMapper(), and functionFinished().
|
protected |
Definition at line 443 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedReduction(), and functionFinished().
Flag for keeping track of weather a device routine has been emitted.
Device routines are specific to the
Definition at line 552 of file CGOpenMPRuntime.h.
Referenced by emitFunctionProlog(), and emitRequiresDirectiveRegFun().
Flag for keeping track of weather a target region has been emitted.
Definition at line 548 of file CGOpenMPRuntime.h.
Referenced by emitRequiresDirectiveRegFun(), and emitTargetOutlinedFunction().
Flag for keeping track of weather a requires unified_shared_memory directive is present.
Definition at line 542 of file CGOpenMPRuntime.h.
Referenced by emitDeclareTargetVarDefinition(), emitDeferredTargetDecls(), emitRequiresDirectiveRegFun(), emitTargetGlobalVariable(), getAddrOfDeclareTargetVar(), hasRequiresUnifiedSharedMemory(), processRequiresDirective(), and registerTargetGlobalVariable().
|
protected |
An ordered map of auto-generated variables to their unique names.
It stores variables with the following names: 1) ".gomp_critical_user_" + <critical_section_name> + ".var" for "omp critical" directives; 2) <mangled_name_for_global_var> + ".cache." for cache for threadprivate variables.
Definition at line 470 of file CGOpenMPRuntime.h.
Referenced by clear().
|
protected |
The type for a microtask which gets passed to __kmpc_fork_call().
Original representation is: typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);
Definition at line 422 of file CGOpenMPRuntime.h.
Referenced by getKmpc_MicroPointerTy().
|
protected |
Type kmp_critical_name, originally defined as typedef kmp_int32 kmp_critical_name[8];.
Definition at line 463 of file CGOpenMPRuntime.h.
Referenced by CGOpenMPRuntime(), getCriticalRegionLock(), and getKmpCriticalNameTy().
|
protected |
Type typedef struct kmp_depend_info { kmp_intptr_t base_addr; size_t len; struct { bool in:1; bool out:1; } flags; } kmp_depend_info_t;.
Definition at line 496 of file CGOpenMPRuntime.h.
Referenced by emitDependClause(), emitDepobjDependClause(), emitDepobjElements(), emitDestroyClause(), emitUpdateClause(), and getDepobjElements().
|
protected |
struct kmp_dim { // loop bounds info casted to kmp_int64 kmp_int64 lo; // lower kmp_int64 up; // upper kmp_int64 st; // stride };
Definition at line 512 of file CGOpenMPRuntime.h.
Referenced by emitDoacrossInit().
|
protected |
Definition at line 473 of file CGOpenMPRuntime.h.
Referenced by emitKmpRoutineEntryT(), and emitTaskInit().
|
protected |
Type typedef kmp_int32 (* kmp_routine_entry_t)(kmp_int32, void *);.
Definition at line 472 of file CGOpenMPRuntime.h.
Referenced by emitKmpRoutineEntryT(), and emitTaskInit().
|
protected |
Type typedef struct kmp_task_affinity_info { kmp_intptr_t base_addr; size_t len; struct { bool flag1 : 1; bool flag2 : 1; kmp_int32 reserved : 30; } flags; } kmp_task_affinity_info_t;.
Definition at line 506 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Type typedef struct kmp_task { void * shareds; /**< pointer to block of pointers to shared vars / kmp_routine_entry_t routine; /**< pointer to routine to call for executing task */ kmp_int32 part_id; /**< part id for the task */ kmp_routine_entry_t destructors; / pointer to function to invoke deconstructors of firstprivate C++ objects */ } kmp_task_t;.
Definition at line 483 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Stack for list of addresses of declarations in current context marked as lastprivate conditional.
The set is the union of all current stack elements.
Definition at line 538 of file CGOpenMPRuntime.h.
Referenced by checkAndEmitLastprivateConditional(), checkAndEmitSharedLastprivateConditional(), emitLastprivateConditionalFinalUpdate(), and clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII().
|
protected |
Maps local variables marked as lastprivate conditional to their internal types.
Definition at line 458 of file CGOpenMPRuntime.h.
Referenced by checkAndEmitLastprivateConditional(), checkAndEmitSharedLastprivateConditional(), emitLastprivateConditionalInit(), and functionFinished().
|
protected |
Stack for list of declarations in current context marked as nontemporal.
The set is the union of all current stack elements.
Definition at line 528 of file CGOpenMPRuntime.h.
Referenced by isNontemporalDecl(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::NontemporalDeclsRAII(), and clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII().
|
protected |
An OpenMP-IR-Builder instance.
Definition at line 312 of file CGOpenMPRuntime.h.
Referenced by CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), createOffloadEntriesAndInfoMetadata(), emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), emitDeclareTargetVarDefinition(), emitDepobjDependClause(), emitDestroyClause(), emitDoacrossInit(), emitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForStaticFinish(), emitLastprivateConditionalUpdate(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitRequiresDirectiveRegFun(), emitSingleRegion(), emitTargetCall(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTargetOutlinedFunctionHelper(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), emitThreadPrivateVarInit(), emitUDMapperArrayInitOrDel(), emitUpdateLocation(), emitUserDefinedMapper(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfDeclareTargetVar(), getAddrOfThreadPrivate(), getCriticalRegionLock(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUWarpSize(), getIdentTyPointerTy(), getName(), getOMPBuilder(), getOrCreateThreadPrivateCache(), getTaskReductionItem(), getThreadID(), processRequiresDirective(), registerTargetGlobalVariable(), and scanForTargetRegionsFunctions().
|
protected |
Definition at line 418 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 433 of file CGOpenMPRuntime.h.
Referenced by clearLocThreadIdInsertPt(), functionFinished(), getThreadID(), and setLocThreadIdInsertPt().
|
protected |
Atomic ordering from the omp requires directive.
Definition at line 545 of file CGOpenMPRuntime.h.
Referenced by getDefaultMemoryOrdering(), and processRequiresDirective().
|
protected |
Saved kmp_task_t for taskloop-based directive.
Definition at line 487 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Saved kmp_task_t for task directive.
Definition at line 485 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Set of threadprivate variables with the generated initializer.
Definition at line 596 of file CGOpenMPRuntime.h.
Referenced by emitThreadPrivateVarDefinition().
|
protected |
Map from the user-defined mapper declaration to its corresponding functions.
Definition at line 446 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedMapper(), functionFinished(), and getOrCreateUserDefinedMapperFunc().
|
protected |
Definition at line 438 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedReduction(), functionFinished(), and getUserDefinedReduction().
|
protected |