clang 20.0.0git
|
Class supports emissionof SIMD-only code. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h"
Public Member Functions | |
CGOpenMPSIMDRuntime (CodeGenModule &CGM) | |
~CGOpenMPSIMDRuntime () override | |
llvm::Function * | emitParallelOutlinedFunction (CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override |
Emits outlined function for the specified OpenMP parallel directive D. | |
llvm::Function * | emitTeamsOutlinedFunction (CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override |
Emits outlined function for the specified OpenMP teams directive D. | |
llvm::Function * | emitTaskOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, const VarDecl *PartIDVar, const VarDecl *TaskTVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, bool Tied, unsigned &NumberOfParts) override |
Emits outlined function for the OpenMP task directive D. | |
void | emitParallelCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars, const Expr *IfCond, llvm::Value *NumThreads) override |
Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct. | |
void | emitCriticalRegion (CodeGenFunction &CGF, StringRef CriticalName, const RegionCodeGenTy &CriticalOpGen, SourceLocation Loc, const Expr *Hint=nullptr) override |
Emits a critical region. | |
void | emitMasterRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MasterOpGen, SourceLocation Loc) override |
Emits a master region. | |
void | emitMaskedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MaskedOpGen, SourceLocation Loc, const Expr *Filter=nullptr) override |
Emits a masked region. | |
void | emitTaskyieldCall (CodeGenFunction &CGF, SourceLocation Loc) override |
Emits a masked region. | |
void | emitTaskgroupRegion (CodeGenFunction &CGF, const RegionCodeGenTy &TaskgroupOpGen, SourceLocation Loc) override |
Emit a taskgroup region. | |
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) override |
Emits a single region. | |
void | emitOrderedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &OrderedOpGen, SourceLocation Loc, bool IsThreads) override |
Emit an ordered region. | |
void | emitBarrierCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind Kind, bool EmitChecks=true, bool ForceSimpleCall=false) override |
Emit an implicit/explicit barrier for OpenMP threads. | |
void | emitForDispatchInit (CodeGenFunction &CGF, SourceLocation Loc, const OpenMPScheduleTy &ScheduleKind, unsigned IVSize, bool IVSigned, bool Ordered, const DispatchRTInput &DispatchValues) override |
This is used for non static scheduled types and when the ordered clause is present on the loop construct. | |
void | emitForDispatchDeinit (CodeGenFunction &CGF, SourceLocation Loc) override |
This is used for non static scheduled types and when the ordered clause is present on the loop construct. | |
void | emitForStaticInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind DKind, const OpenMPScheduleTy &ScheduleKind, const StaticRTInput &Values) override |
Call the appropriate runtime routine to initialize it before start of loop. | |
void | emitDistributeStaticInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDistScheduleClauseKind SchedKind, const StaticRTInput &Values) override |
void | emitForOrderedIterationEnd (CodeGenFunction &CGF, SourceLocation Loc, unsigned IVSize, bool IVSigned) override |
Call the appropriate runtime routine to notify that we finished iteration of the ordered loop with the dynamic scheduling. | |
void | emitForStaticFinish (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind DKind) override |
Call the appropriate runtime routine to notify that we finished all the work with current loop. | |
llvm::Value * | emitForNext (CodeGenFunction &CGF, SourceLocation Loc, unsigned IVSize, bool IVSigned, Address IL, Address LB, Address UB, Address ST) override |
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);. | |
void | emitNumThreadsClause (CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc) override |
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. | |
void | emitProcBindClause (CodeGenFunction &CGF, llvm::omp::ProcBindKind ProcBind, SourceLocation Loc) override |
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. | |
Address | getAddrOfThreadPrivate (CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr, SourceLocation Loc) override |
Returns address of the threadprivate variable for the current thread. | |
llvm::Function * | emitThreadPrivateVarDefinition (const VarDecl *VD, Address VDAddr, SourceLocation Loc, bool PerformInit, CodeGenFunction *CGF=nullptr) override |
Emit a code for initialization of threadprivate variable. | |
Address | getAddrOfArtificialThreadPrivate (CodeGenFunction &CGF, QualType VarType, StringRef Name) override |
Creates artificial threadprivate variable with name Name and type VarType . | |
void | emitFlush (CodeGenFunction &CGF, ArrayRef< const Expr * > Vars, SourceLocation Loc, llvm::AtomicOrdering AO) override |
Emit flush of the variables specified in 'omp flush' directive. | |
void | emitTaskCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, llvm::Function *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data) override |
Emit task region for the task directive. | |
void | emitTaskLoopCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPLoopDirective &D, llvm::Function *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data) override |
Emit task region for the taskloop directive. | |
void | emitReduction (CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps, ReductionOptionsTy Options) override |
Emit a code for reduction clause. | |
llvm::Value * | emitTaskReductionInit (CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, const OMPTaskDataTy &Data) override |
Emit a code for initialization of task reduction clause. | |
void | emitTaskReductionFini (CodeGenFunction &CGF, SourceLocation Loc, bool IsWorksharingReduction) override |
Emits the following code for reduction clause with task modifier: | |
void | emitTaskReductionFixups (CodeGenFunction &CGF, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) override |
Required to resolve existing problems in the runtime. | |
Address | getTaskReductionItem (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *ReductionsPtr, LValue SharedLVal) override |
Get the address of void * type of the privatue copy of the reduction item specified by the SharedLVal . | |
void | emitTaskwaitCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPTaskDataTy &Data) override |
Emit code for 'taskwait' directive. | |
void | emitCancellationPointCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind CancelRegion) override |
Emit code for 'cancellation point' construct. | |
void | emitCancelCall (CodeGenFunction &CGF, SourceLocation Loc, const Expr *IfCond, OpenMPDirectiveKind CancelRegion) override |
Emit code for 'cancel' construct. | |
void | emitTargetOutlinedFunction (const OMPExecutableDirective &D, StringRef ParentName, llvm::Function *&OutlinedFn, llvm::Constant *&OutlinedFnID, bool IsOffloadEntry, const RegionCodeGenTy &CodeGen) override |
Emit outilined function for 'target' directive. | |
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) override |
Emit the target offloading code associated with D. | |
bool | emitTargetFunctions (GlobalDecl GD) override |
Emit the target regions enclosed in GD function definition or the function itself in case it is a valid device function. | |
bool | emitTargetGlobalVariable (GlobalDecl GD) override |
Emit the global variable if it is a valid device global variable. | |
bool | emitTargetGlobal (GlobalDecl GD) override |
Emit the global GD if it is meaningful for the target. | |
void | emitTeamsCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars) override |
Emits code for teams call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct. | |
void | emitNumTeamsClause (CodeGenFunction &CGF, const Expr *NumTeams, const Expr *ThreadLimit, SourceLocation Loc) override |
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. | |
void | emitTargetDataCalls (CodeGenFunction &CGF, const OMPExecutableDirective &D, const Expr *IfCond, const Expr *Device, const RegionCodeGenTy &CodeGen, CGOpenMPRuntime::TargetDataInfo &Info) override |
Emit the target data mapping code associated with D. | |
void | emitTargetDataStandAloneCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, const Expr *IfCond, const Expr *Device) override |
Emit the data mapping/movement code associated with the directive D that should be of the form 'target [{enter|exit} data | update]'. | |
void | emitDoacrossInit (CodeGenFunction &CGF, const OMPLoopDirective &D, ArrayRef< Expr * > NumIterations) override |
Emit initialization for doacross loop nesting support. | |
void | emitDoacrossOrdered (CodeGenFunction &CGF, const OMPDependClause *C) override |
Emit code for doacross ordered directive with 'depend' clause. | |
void | emitDoacrossOrdered (CodeGenFunction &CGF, const OMPDoacrossClause *C) override |
Emit code for doacross ordered directive with 'doacross' clause. | |
const VarDecl * | translateParameter (const FieldDecl *FD, const VarDecl *NativeParam) const override |
Translates the native parameter of outlined function if this is required for target. | |
Address | getParameterAddress (CodeGenFunction &CGF, const VarDecl *NativeParam, const VarDecl *TargetParam) const override |
Gets the address of the native argument basing on the address of the target-specific parameter. | |
Address | getAddressOfLocalVariable (CodeGenFunction &CGF, const VarDecl *VD) override |
Gets the OpenMP-specific address of the local variable. | |
Public Member Functions inherited from clang::CodeGen::CGOpenMPRuntime | |
llvm::OpenMPIRBuilder & | getOMPBuilder () |
CGOpenMPRuntime (CodeGenModule &CGM) | |
virtual | ~CGOpenMPRuntime () |
virtual void | clear () |
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 &MinTeamsVal, int32_t &MaxTeamsVal) |
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 &UpperBound, bool UpperBoundOnly, llvm::Value **CondExpr=nullptr, const Expr **ThreadLimitExpr=nullptr) |
Check for a number of threads upper bound constant value (stored in UpperBound ), or expression (returned). | |
llvm::Value * | emitNumThreadsForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
Emit an expression that denotes the number of threads a target region shall use. | |
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'. | |
virtual bool | isGPU () const |
Returns true if the current target is a GPU. | |
virtual bool | isDelayedVariableLengthDecl (CodeGenFunction &CGF, const VarDecl *VD) const |
Check if the variable length declaration is delayed: | |
virtual std::pair< llvm::Value *, llvm::Value * > | getKmpcAllocShared (CodeGenFunction &CGF, const VarDecl *VD) |
Get call to __kmpc_alloc_shared. | |
virtual void | getKmpcFreeShared (CodeGenFunction &CGF, const std::pair< llvm::Value *, llvm::Value * > &AddrSizePair) |
Get call to __kmpc_free_shared. | |
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 | emitForDispatchDeinit (CodeGenFunction &CGF, SourceLocation Loc) |
This is used for non static scheduled types and when the ordered clause is present on the loop construct. | |
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 ConstantAddress | 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 void | emitDeclareTargetFunction (const FunctionDecl *FD, llvm::GlobalValue *GV) |
Emit code for handling declare target functions in the runtime. | |
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. | |
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 | emitThreadLimitClause (CodeGenFunction &CGF, const Expr *ThreadLimit, SourceLocation Loc) |
Emits call to void __kmpc_set_thread_limit(ident_t *loc, kmp_int32
global_tid, kmp_int32 thread_limit) to generate code for thread_limit clause on target directive. | |
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 void | emitDoacrossOrdered (CodeGenFunction &CGF, const OMPDoacrossClause *C) |
Emit code for doacross ordered directive with 'doacross' 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. | |
Additional Inherited Members | |
Static Public Member Functions inherited from clang::CodeGen::CGOpenMPRuntime | |
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 inherited from clang::CodeGen::CGOpenMPRuntime | |
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 inherited from clang::CodeGen::CGOpenMPRuntime | |
void | computeMinAndMaxThreadsAndTeams (const OMPExecutableDirective &D, CodeGenFunction &CGF, int32_t &MinThreadsVal, int32_t &MaxThreadsVal, int32_t &MinTeamsVal, int32_t &MaxTeamsVal) |
Helper to determine the min/max number of threads/teams for D . | |
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::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::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. | |
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 inherited from clang::CodeGen::CGOpenMPRuntime | |
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 inherited from clang::CodeGen::CGOpenMPRuntime | |
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. | |
Class supports emissionof SIMD-only code.
Definition at line 1681 of file CGOpenMPRuntime.h.
|
inlineexplicit |
Definition at line 1683 of file CGOpenMPRuntime.h.
|
inlineoverride |
Definition at line 1684 of file CGOpenMPRuntime.h.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12066 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12219 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit code for 'cancellation point' construct.
CancelRegion | Region kind for which the cancellation point must be emitted. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12213 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12020 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12092 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit initialization for doacross loop nesting support.
D | Loop-based construct used in doacross nesting construct. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12282 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit code for doacross ordered directive with 'depend' clause.
C | 'depend' clause with 'sink|source' dependency kind. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12288 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit code for doacross ordered directive with 'doacross' clause.
C | 'doacross' clause with 'sink|source' dependence type. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12293 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit flush of the variables specified in 'omp flush' directive.
Vars | List of variables to flush. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12149 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
This is used for non static scheduled types and when the ordered clause is present on the loop construct.
CGF | Reference to current CodeGenFunction. |
Loc | Clang source location. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12081 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12074 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12111 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12098 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12105 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12086 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emits a masked region.
MaskedOpGen | Generator for the statement associated with the given masked region. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12033 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emits a master region.
MasterOpGen | Generator for the statement associated with the given master region. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12027 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12262 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12119 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit an ordered region.
OrderedOpGen | Generator for the statement associated with the given ordered region. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12059 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12011 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 11989 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12125 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12172 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::emitReduction(), and Loc.
|
overridevirtual |
Emits a single region.
SingleOpGen | Generator for the statement associated with the given single region. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12051 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12232 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12269 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12276 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12242 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit the global GD if it is meaningful for the target.
Returns if it was emitted successfully.
GD | Global to scan. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12250 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12246 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12225 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12156 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit a taskgroup region.
TaskgroupOpGen | Generator for the statement associated with the given taskgroup region. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12045 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12165 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12003 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emits the following code for reduction clause with task modifier:
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12187 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 + emits threadprivate variable to store the pointer to the original reduction item for the custom initializer defined by declare reduction construct.
RCG | Allows to reuse an existing data for the reductions. |
N | Reduction item for which fixups must be emitted. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12193 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12181 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emit code for 'taskwait' directive.
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12207 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
Emits a masked region.
MaskedOpGen | Generator for the statement associated with the given masked region. Emits code for a taskyield directive. |
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12040 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12254 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 11996 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12138 of file CGOpenMPRuntime.cpp.
|
inlineoverridevirtual |
Gets the OpenMP-specific address of the local variable.
Reimplemented from clang::CodeGen::CGOpenMPRuntime.
Definition at line 2293 of file CGOpenMPRuntime.h.
References clang::CodeGen::Address::invalid().
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12144 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12131 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12305 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12200 of file CGOpenMPRuntime.cpp.
|
overridevirtual |
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 from clang::CodeGen::CGOpenMPRuntime.
Definition at line 12299 of file CGOpenMPRuntime.cpp.