clang 20.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 () |
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. | |
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 | |
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 | |
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 420 of file CGOpenMPRuntime.h.
|
protected |
Map of functions and locally defined UDRs.
Definition at line 414 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 497 of file CGOpenMPRuntime.h.
|
protected |
Map for SourceLocation and OpenMP runtime library debug locations.
Definition at line 389 of file CGOpenMPRuntime.h.
|
protected |
Map of local debug location, ThreadId and functions.
Definition at line 404 of file CGOpenMPRuntime.h.
|
protected |
Map of UDRs and corresponding combiner/initializer.
Definition at line 409 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 502 of file CGOpenMPRuntime.h.
|
explicit |
Definition at line 1036 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getLangOpts(), HasRequiresUnifiedSharedMemory, hasRequiresUnifiedSharedMemory(), clang::CodeGen::CodeGenTypeCache::Int32Ty, isGPU(), KmpCriticalNameTy, OMPBuilder, and clang::LangOptions::OMPHostIRFile.
|
inlinevirtual |
Definition at line 628 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 10119 of file CGOpenMPRuntime.cpp.
References D, 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 11876 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 11920 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CapturedStmt::capturesVariable(), clang::CodeGen::ApplyDebugLocation::CreateArtificial(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::CurFn, D, 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::Decl::getBeginLoc(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::QualType::getNonReferenceType(), clang::getOpenMPCaptureRegions(), clang::ValueDecl::getType(), clang::Type::isReferenceType(), LastprivateConditionalStack, LastprivateConditionalToTypes, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and Range.
Referenced by checkForLastprivateConditionalUpdate().
|
virtual |
Definition at line 1058 of file CGOpenMPRuntime.cpp.
References clang::Data, EmittedNonTargetVariables, and InternalVars.
|
protected |
Definition at line 1346 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn, and OpenMPLocThreadIDMap.
Referenced by functionFinished().
|
protected |
Helper to determine the min/max number of threads/teams for D
.
Definition at line 5899 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, D, getNumTeamsExprForTargetDirective(), getNumThreadsExprForTargetDirective(), clang::CodeGen::CodeGenModule::handleAMDGPUFlatWorkGroupSizeAttr(), and clang::CodeGen::CodeGenModule::handleCUDALaunchBoundsAttr().
void CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata | ( | ) |
Creates all the offload entries in the current compilation unit along with the associated metadata.
Definition at line 2795 of file CGOpenMPRuntime.cpp.
References CGM, E, 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(), Loc, 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 2345 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(), Loc, OMPBuilder, and clang::Result.
Referenced by emitCancelCall(), emitCancellationPointCall(), emitOMPCopyinClause(), emitOMPForDirective(), and emitWorksharingDirective().
|
protected |
Emits Callee
function call with arguments Args
with location Loc
.
Definition at line 11301 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::SourceLocation::isValid(), and Loc.
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 5754 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(), Loc, 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 5714 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(), Loc, 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 2008 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, Loc, 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 11002 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, E, 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 code for handling declare target functions in the runtime.
FD | Declare target function. |
Addr | Address of the global FD. |
PerformInit | true if initialization expression is not constant. |
Definition at line 1761 of file CGOpenMPRuntime.cpp.
References CGM, clang::DeclaratorDecl::getBeginLoc(), clang::FunctionDecl::getCanonicalDecl(), getEntryInfoFromPresumedLoc(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::GetTargetTypeStoreSize(), OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
void CGOpenMPRuntime::emitDeferredTargetDecls | ( | ) | const |
Emit deferred declare target variables marked for deferred emission.
Definition at line 10098 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 4221 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(), D, E, 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(), KmpDependInfoTy, Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::Normal, clang::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 4350 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, E, 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, Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::Normal, OMPBuilder, clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
protected |
Definition at line 4184 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::Data, E, 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 4146 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::Data, E, 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 4437 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::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::CodeGen::Address::getElementType(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, KmpDependInfoTy, Loc, 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 2638 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, emitForStaticInitCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), getRuntimeSchedule(), getThreadID(), clang::CodeGen::CodeGenModule::getTriple(), clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSigned, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSize, Loc, OMPBuilder, 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 11180 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(), D, E, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::Address::emitRawPointer(), 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::Decl::getBeginLoc(), clang::CodeGen::CodeGenModule::getContext(), clang::Decl::getEndLoc(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::QualType::isNull(), KmpDimTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::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 11287 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, emitUpdateLocation(), and getThreadID().
|
virtual |
Emit code for doacross ordered directive with 'doacross' clause.
C | 'doacross' clause with 'sink|source' dependence type. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 11294 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, emitUpdateLocation(), and getThreadID().
|
virtual |
Emit __kmpc_error call for error directive extern void __kmpc_error(ident_t *loc, int severity, const char *message);.
Definition at line 2395 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, Loc, 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 2755 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(), Loc, and OMPBuilder.
Referenced by emitOMPAtomicCaptureExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), and emitOMPAtomicWriteExpr().
|
virtual |
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 in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2558 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), Loc, and OMPBuilder.
|
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 2524 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGOpenMPRuntime::DispatchRTInput::Chunk, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getRuntimeSchedule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CGOpenMPRuntime::DispatchRTInput::LB, Loc, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, OMPBuilder, 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 2703 of file CGOpenMPRuntime.cpp.
References clang::ASTContext::BoolTy, clang::Call, clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), emitUpdateLocation(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), getThreadID(), Loc, and OMPBuilder.
|
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 2691 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), Loc, and OMPBuilder.
|
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 2659 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(), Loc, 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 2616 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), emitForStaticInitCall(), emitUpdateLocation(), getRuntimeSchedule(), getThreadID(), clang::isOpenMPLoopDirective(), clang::isOpenMPWorksharingDirective(), clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSigned, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSize, Loc, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, OMPBuilder, 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 11322 of file CGOpenMPRuntime.cpp.
References D, and 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 1829 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(), 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 5676 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(), emitOMPDistributeDirective(), emitOMPForDirective(), emitOMPSimdDirective(), emitOrderedRegion(), emitSingleRegion(), emitTargetCall(), emitTargetCallElse(), emitTargetCallKernelLaunch(), emitTargetDataStandAloneCall(), emitTargetTeamsDistributeParallelForRegion(), emitTargetTeamsDistributeParallelForSimdRegion(), emitTargetTeamsDistributeRegion(), emitTargetTeamsDistributeSimdRegion(), emitTargetTeamsGenericLoopRegionAsDistribute(), emitTargetTeamsGenericLoopRegionAsParallel(), and emitTaskgroupRegion().
|
protected |
Build type kmp_routine_entry_t (if not built yet).
Definition at line 2845 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 11970 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, Loc, and clang::CodeGen::CodeGenFunction::MakeRawAddrLValue().
Address CGOpenMPRuntime::emitLastprivateConditionalInit | ( | CodeGenFunction & | CGF, |
const VarDecl * | VD | ||
) |
Create specialized alloca to handle lastprivate conditionals.
Definition at line 11682 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 11788 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, Loc, clang::CodeGen::CodeGenFunction::MakeNaturalAlignRawAddrLValue(), clang::CodeGen::CodeGenFunction::MakeRawAddrLValue(), 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 2061 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, Loc, 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 2038 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), Loc, 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 10241 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, Loc, and OMPBuilder.
Referenced by emitCommonOMPTeamsDirective().
llvm::Value * CGOpenMPRuntime::emitNumTeamsForTargetDirective | ( | CodeGenFunction & | CGF, |
const OMPExecutableDirective & | D | ||
) |
Definition at line 6149 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, D, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::getLangOpts(), getNumTeamsExprForTargetDirective(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by emitTargetCallKernelLaunch().
|
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 2726 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, Loc, and OMPBuilder.
Referenced by emitCommonOMPParallelDirective().
llvm::Value * CGOpenMPRuntime::emitNumThreadsForTargetDirective | ( | CodeGenFunction & | CGF, |
const OMPExecutableDirective & | D | ||
) |
Emit an expression that denotes the number of threads a target region shall use.
Will generate "i32 0" to allow the runtime to choose.
Definition at line 6451 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, D, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), getNumThreadsExprForTargetDirective(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by emitTargetCallKernelLaunch().
|
virtual |
Emit an ordered region.
OrderedOpGen | Generator for the statement associated with the given ordered region. |
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2288 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), Loc, 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 11316 of file CGOpenMPRuntime.cpp.
References emitCall(), and Loc.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::emitOutlinedFunctionCall(), emitParallelCall(), emitProxyTaskFunction(), and emitTargetCallFallback().
|
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 1868 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::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitThreadIDAddress(), emitUpdateLocation(), getKmpc_MicroPointerTy(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::RawAddress::getPointer(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, Loc, 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 1263 of file CGOpenMPRuntime.cpp.
References CGM, D, emitParallelOrTeamsOutlinedFunction(), 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 2740 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::IntTy, Loc, and OMPBuilder.
Referenced by emitCommonOMPParallelDirective().
|
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 4930 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, E, 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::RawAddress::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(), Loc, clang::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 4820 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(), E, 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(), Loc, clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by emitReduction().
void CGOpenMPRuntime::emitSingleReductionCombiner | ( | CodeGenFunction & | CGF, |
const Expr * | ReductionOp, | ||
const Expr * | PrivateRef, | ||
const DeclRefExpr * | LHS, | ||
const DeclRefExpr * | RHS | ||
) |
Emits single reduction combiner.
Definition at line 4910 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 2201 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(), E, emitCopyprivateCopyFunction(), emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getModule(), 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(), Loc, clang::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 9739 of file CGOpenMPRuntime.cpp.
References CGM, D, clang::Device, emitIfClause(), emitInlinedDirective(), emitTargetCallElse(), emitTargetCallKernelLaunch(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and clang::needsTaskBasedThreadLimit().
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 10288 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo::CaptureDeviceAddrMap, CGM, clang::CodeGen::CodeGenFunction::CGM, D, clang::Device, emitMappingInformation(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::Decl::getBeginLoc(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), getOrCreateUserDefinedMapperFunc(), 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 10389 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPTargetDataInfo::BasePointersArray, clang::CodeGen::CodeGenFunction::Builder, CGM, D, clang::Device, emitIfClause(), emitInlinedDirective(), emitOffloadingArraysAndArgs(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), emitUpdateLocation(), genMapInfo(), clang::Decl::getBeginLoc(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, 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 9978 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 10090 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 10004 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().
llvm::Value * CGOpenMPRuntime::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'.
SizeEmitter | Emits the int64 value for the number of iterations of the associated loop. |
Definition at line 9410 of file CGOpenMPRuntime.cpp.
References CGM, D, clang::CodeGen::CodeGenModule::getContext(), getNestedDistributeDirective(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::isOpenMPDistributeDirective(), and clang::isOpenMPTeamsDirective().
Referenced by emitTargetCallKernelLaunch().
|
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 5828 of file CGOpenMPRuntime.cpp.
References clang::C, D, E, emitTargetOutlinedFunctionHelper(), 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 5935 of file CGOpenMPRuntime.cpp.
References clang::C, CGM, D, clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::Decl::getBeginLoc(), getEntryInfoFromPresumedLoc(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::CodeGen::CodeGenModule::handleAMDGPUWavesPerEUAttr(), 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 4513 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, D, clang::Data, emitDependClause(), emitIfClause(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), emitTaskInit(), emitUpdateLocation(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), Loc, 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 2110 of file CGOpenMPRuntime.cpp.
References CGM, emitInlinedDirective(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), Loc, 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 3614 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(), D, clang::Data, clang::Device, clang::CodeGen::AggValueSlot::DoesNotOverlap, E, clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), emitDestructorsFunction(), emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitPrivatesInit(), emitProxyTaskFunction(), clang::CodeGen::Address::emitRawPointer(), 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::CodeGen::CodeGenModule::getContext(), clang::RecordType::getDecl(), clang::Expr::getExprLoc(), getKmpAffinityType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), getPointerAndSize(), clang::CodeGen::CodeGenModule::getSize(), getThreadID(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), 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, Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignRawAddrLValue(), clang::Normal, OMPBuilder, clang::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 4633 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), D, clang::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::CodeGen::CodeGenModule::getModule(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::LValue::getQuals(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::IntTy, Loc, 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 1283 of file CGOpenMPRuntime.cpp.
References clang::Type::castAs(), CGM, D, emitUpdateLocation(), clang::Decl::getBeginLoc(), 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 5568 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenTypeCache::IntTy, Loc, 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 5586 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 5443 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::CodeGen::CodeGenFunction::Builder, clang::C, CGM, clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::Data, clang::CodeGen::ReductionCodeGen::emitAggregateType(), 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::RawAddress::getElementType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::ReductionCodeGen::getOrigLValue(), clang::CodeGen::RawAddress::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, Loc, clang::CodeGen::CodeGenFunction::MakeNaturalAlignRawAddrLValue(), clang::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 5623 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::CodeGenFunction::CGM, clang::Data, emitDependClause(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), Loc, OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
virtual |
Emits code for a taskyield directive.
Reimplemented in clang::CodeGen::CGOpenMPSIMDRuntime.
Definition at line 2090 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, Loc, 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 10216 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(), Loc, 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 1273 of file CGOpenMPRuntime.cpp.
References CGM, D, emitParallelOrTeamsOutlinedFunction(), 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 1946 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(), Loc, and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by emitParallelCall(), and clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsCall().
|
virtual |
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.
ThreadLimit | An integer expression of threads. |
Definition at line 10270 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::CodeGenTypeCache::Int32Ty, Loc, and OMPBuilder.
|
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 1641 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::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::Init, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::QualType::isDestructedType(), clang::TargetInfo::isTLSSupported(), Loc, clang::CodeGen::CodeGenFunction::needsEHCleanup(), clang::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 1620 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), emitUpdateLocation(), clang::CodeGen::CodeGenModule::getModule(), Loc, 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 9331 of file CGOpenMPRuntime.cpp.
References Begin, clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateIsNull(), 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 4464 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::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), getDepobjElements(), KmpDependInfoTy, clang::CodeGen::KnownNonNull, Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and translateDependencyKind().
llvm::Value * CGOpenMPRuntime::emitUpdateLocation | ( | CodeGenFunction & | CGF, |
SourceLocation | Loc, | ||
unsigned | Flags = 0 , |
||
bool | EmitLoc = false |
||
) |
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 1368 of file CGOpenMPRuntime.cpp.
References CGM, clang::Column, clang::CodeGen::CodeGenFunction::CurFuncDecl, clang::FileName, 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(), clang::Line, Loc, and OMPBuilder.
Referenced by emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), emitDistributeStaticInit(), emitDoacrossInit(), emitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForDispatchDeinit(), emitForDispatchInit(), emitForNext(), emitForOrderedIterationEnd(), emitForStaticFinish(), emitForStaticInit(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitSingleRegion(), emitTargetCallKernelLaunch(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), emitThreadLimitClause(), 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 9062 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::CGBuilderTy::CreateIsNull(), clang::CodeGen::CodeGenFunction::CurFn, D, 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::CodeGen::CodeGenModule::getModule(), getName(), getOrCreateUserDefinedMapperFunc(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int64Ty, Loc, clang::MangleContext::mangleCanonicalTypeName(), OMPBuilder, clang::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 1132 of file CGOpenMPRuntime.cpp.
References clang::Call, CGM, clang::CodeGen::CodeGenFunction::CurFn, D, emitCombinerOrInitializer(), FunctionUDRMap, clang::Init, 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 5883 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 5849 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::Address::emitRawPointer(), 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::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 1463 of file CGOpenMPRuntime.cpp.
References clearLocThreadIdInsertPt(), clang::CodeGen::CodeGenFunction::CurFn, D, 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 11364 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::Address::emitRawPointer(), 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::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 1796 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().
|
virtual |
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 1562 of file CGOpenMPRuntime.cpp.
References CGM, convertCaptureClause(), convertDeviceClause(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::VarDecl::DeclarationOnly, clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getDeclAlign(), getEntryInfoFromPresumedLoc(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getLLVMLinkageVarDefinition(), clang::CodeGen::CodeGenModule::getMangledName(), clang::ASTContext::getPointerType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::VarDecl::hasDefinition(), clang::CodeGen::ConstantAddress::invalid(), clang::NamedDecl::isExternallyVisible(), OMPBuilder, and clang::LangOptions::OMPTargetTriples.
Referenced by emitDeclTargetVarDeclLValue(), emitDeferredTargetDecls(), and clang::CodeGen::CodeGenModule::EmitGlobal().
|
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 1598 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CGM, clang::CodeGen::Address::emitRawPointer(), 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::CodeGenModule::getSize(), clang::ASTContext::getTargetInfo(), clang::CodeGen::CodeGenModule::GetTargetTypeStoreSize(), getThreadID(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::TargetInfo::isTLSSupported(), Loc, 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 1963 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 1531 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 2312 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 371 of file CGOpenMPRuntime.h.
Referenced by emitUpdateLocation().
llvm::AtomicOrdering CGOpenMPRuntime::getDefaultMemoryOrdering | ( | ) | const |
Gets default memory ordering as specified in requires directive.
Definition at line 10149 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 2327 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 4049 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::Type::castAs(), CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), 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, Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::Address::withElementType().
Referenced by emitDepobjElements(), emitDepobjElementsSizes(), and emitUpdateClause().
|
protected |
Returns pointer to ident_t type.
Definition at line 1484 of file CGOpenMPRuntime.cpp.
References OMPBuilder.
|
protected |
Returns pointer to kmpc_micro type.
Definition at line 1488 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenTypeCache::Int32Ty, Kmpc_MicroTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by emitParallelCall(), and emitTeamsCall().
|
inlinevirtual |
Get call to __kmpc_alloc_shared.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 689 of file CGOpenMPRuntime.h.
|
inlinevirtual |
Get call to __kmpc_free_shared.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 694 of file CGOpenMPRuntime.h.
|
inlineprotected |
Get the LLVM type for the critical name.
Definition at line 378 of file CGOpenMPRuntime.h.
References KmpCriticalNameTy.
std::string CGOpenMPRuntime::getName | ( | ArrayRef< StringRef > | Parts | ) | const |
Get the platform-specific name separator.
Definition at line 1073 of file CGOpenMPRuntime.cpp.
References OMPBuilder.
Referenced by emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), emitInitWithReductionInitializer(), emitLastprivateConditionalUpdate(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), emitThreadPrivateVarDefinition(), emitUDMapperArrayInitOrDel(), emitUserDefinedMapper(), generateUniqueName(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getCriticalRegionLock(), getOrCreateThreadPrivateCache(), getOutlinedHelperName(), and getReductionFuncName().
const Expr * CGOpenMPRuntime::getNumTeamsExprForTargetDirective | ( | CodeGenFunction & | CGF, |
const OMPExecutableDirective & | D, | ||
int32_t & | MinTeamsVal, | ||
int32_t & | MaxTeamsVal | ||
) |
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 6021 of file CGOpenMPRuntime.cpp.
References D, clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getIntegerConstantExpr(), getSingleCompoundChild(), clang::Stmt::IgnoreContainers(), clang::Expr::isIntegerConstantExpr(), clang::isOpenMPTargetExecutionDirective(), and clang::isOpenMPTeamsDirective().
Referenced by computeMinAndMaxThreadsAndTeams(), and emitNumTeamsForTargetDirective().
const Expr * CGOpenMPRuntime::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).
If the value is conditional (via an if-clause), store the condition in CondExpr
. Similarly, a potential thread limit expression is stored in ThreadLimitExpr
. If UpperBoundOnly
is true, no expression evaluation is perfomed.
Definition at line 6286 of file CGOpenMPRuntime.cpp.
References clang::C, D, E, clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Expr::EvaluateAsBooleanCondition(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CapturedStmt::getCapturedStmt(), clang::OMPIfClause::getCondition(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getIntegerConstantExpr(), clang::CodeGen::CodeGenFunction::getLangOpts(), getNumThreads(), getSingleCompoundChild(), clang::Expr::isIntegerConstantExpr(), clang::isOpenMPDistributeDirective(), clang::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTeamsDirective(), and clang::Result.
Referenced by computeMinAndMaxThreadsAndTeams(), and emitNumThreadsForTargetDirective().
|
inline |
Definition at line 306 of file CGOpenMPRuntime.h.
References OMPBuilder.
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), EmitDoacrossOrdered(), emitOMPAtomicCompareExpr(), emitOMPForDirective(), emitOMPSimdDirective(), emitParallelOrTeamsOutlinedFunction(), emitTargetCallKernelLaunch(), 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 1589 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 9401 of file CGOpenMPRuntime.cpp.
References D, emitUserDefinedMapper(), and UDMMap.
Referenced by emitOffloadingArraysAndArgs(), emitTargetDataCalls(), and emitUserDefinedMapper().
|
protected |
Definition at line 1254 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFn, and getOutlinedHelperName().
|
protected |
Get the function name of an outlined region.
Definition at line 1249 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 11328 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar().
Referenced by emitOutlinedFunctionPrologue().
|
protected |
Get the function name of a reduction function.
Definition at line 1258 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 5979 of file CGOpenMPRuntime.cpp.
References clang::C, D, E, clang::Stmt::IgnoreContainers(), and isTrivial().
Referenced by getDistributeLastprivateVars(), getNestedDistributeDirective(), getNumTeamsExprForTargetDirective(), getNumThreads(), getNumThreadsExprForTargetDirective(), 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 5603 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, Loc, OMPBuilder, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
protected |
Gets thread id value for the current thread.
Definition at line 1393 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::Call, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, CGM, clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial(), 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(), Loc, OMPBuilder, OpenMPLocThreadIDMap, clang::CodeGen::EHScopeStack::requiresLandingPad(), and setLocThreadIdInsertPt().
Referenced by emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), emitDepobjDependClause(), emitDestroyClause(), emitDistributeStaticInit(), emitDoacrossInit(), emitDoacrossOrdered(), emitForDispatchDeinit(), emitForDispatchInit(), emitForNext(), emitForOrderedIterationEnd(), emitForStaticFinish(), emitForStaticInit(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), emitSingleRegion(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitThreadIDAddress(), emitThreadLimitClause(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfThreadPrivate(), and getTaskReductionItem().
|
virtual |
Get combiner/initializer for the specified user-defined reduction, if any.
Definition at line 1159 of file CGOpenMPRuntime.cpp.
References D, 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 10153 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 10178 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 367 of file CGOpenMPRuntime.h.
|
inlinevirtual |
Check if the variable length declaration is delayed:
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 682 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 2466 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
|
inlinevirtual |
Returns true if the current target is a GPU.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 679 of file CGOpenMPRuntime.h.
Referenced by CGOpenMPRuntime().
bool CGOpenMPRuntime::isLocalVarInUntiedTask | ( | CodeGenFunction & | CGF, |
const VarDecl * | VD | ||
) | const |
Returns true if the variable is a local variable in untied task.
Definition at line 11464 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 11522 of file CGOpenMPRuntime.cpp.
References CGM, clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), NontemporalDeclsStack, and clang::Set.
|
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 2460 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 2453 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 2447 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 2440 of file CGOpenMPRuntime.cpp.
References getRuntimeSchedule().
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 10196 of file CGOpenMPRuntime.cpp.
References AlreadyEmittedTargetDecls, CGM, D, clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::GetGlobalValue(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getMangledName(), clang::Decl::hasBody(), and ShouldMarkAsGlobal.
|
virtual |
Perform check on requires decl to ensure that target architecture supports unified addressing.
Reimplemented in clang::CodeGen::CGOpenMPRuntimeGPU.
Definition at line 10125 of file CGOpenMPRuntime.cpp.
References D, 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 10043 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenModule::addCompilerUsedGlobal(), CGM, convertCaptureClause(), convertDeviceClause(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::VarDecl::DeclarationOnly, EmittedNonTargetVariables, clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getContext(), getEntryInfoFromPresumedLoc(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getLLVMLinkageVarDefinition(), clang::CodeGen::CodeGenModule::getMangledName(), clang::ASTContext::getPointerType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::NamedDecl::isExternallyVisible(), OMPBuilder, and clang::LangOptions::OMPTargetTriples.
Referenced by clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal().
|
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 9808 of file CGOpenMPRuntime.cpp.
References CGM, E, clang::CodeGen::CodeGenFunction::EmitOMPTargetDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelGenericLoopDeviceFunction(), 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::CodeGen::CodeGenFunction::EmitOMPTargetTeamsGenericLoopDeviceFunction(), clang::Stmt::getBeginLoc(), getEntryInfoFromPresumedLoc(), clang::isOpenMPTargetExecutionDirective(), OMPBuilder, and scanForTargetRegionsFunctions().
Referenced by emitTargetFunctions(), emitTargetGlobalVariable(), and scanForTargetRegionsFunctions().
|
protected |
Definition at line 1330 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 1516 of file CGOpenMPRuntime.h.
Referenced by emitOutlinedFunctionPrologue().
|
protected |
List of the emitted declarations.
Definition at line 488 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(), computeMinAndMaxThreadsAndTeams(), createOffloadEntriesAndInfoMetadata(), emitAArch64DeclareSimdFunction(), emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), emitCancelCall(), emitCancellationPointCall(), emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), emitDeclareSimdFunction(), emitDeclareTargetFunction(), emitDeferredTargetDecls(), emitDependClause(), emitDepobjDependClause(), emitDestroyClause(), emitDistributeStaticInit(), emitDoacrossInit(), EmitDoacrossOrdered(), emitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForDispatchInit(), emitForStaticFinish(), emitKmpRoutineEntryT(), emitLastprivateConditionalFinalUpdate(), emitLastprivateConditionalInit(), emitLastprivateConditionalUpdate(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitParallelOutlinedFunction(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitReductionFunction(), emitSingleRegion(), emitTargetCall(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTargetFunctions(), emitTargetGlobalVariable(), emitTargetNumIterationsCall(), emitTargetOutlinedFunctionHelper(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionFixups(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsCall(), emitTeamsOutlinedFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), emitThreadLimitClause(), emitThreadPrivateVarDefinition(), emitThreadPrivateVarInit(), emitUDMapperArrayInitOrDel(), emitUpdateClause(), emitUpdateLocation(), emitUserDefinedMapper(), emitUserDefinedReduction(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfDeclareTargetVar(), getAddrOfThreadPrivate(), getAlignmentValue(), getDepobjElements(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), getKmpc_MicroPointerTy(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcFreeShared(), 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 549 of file CGOpenMPRuntime.h.
|
protected |
List of variables that can become declare target implicitly and, thus, must be emitted.
Definition at line 495 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 491 of file CGOpenMPRuntime.h.
Referenced by clear(), and registerTargetGlobalVariable().
|
protected |
Maps function to the position of the untied task locals stack.
Definition at line 432 of file CGOpenMPRuntime.h.
Referenced by functionFinished(), getAddressOfLocalVariable(), isLocalVarInUntiedTask(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::UntiedTaskLocalDeclsRAII().
|
protected |
Definition at line 423 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedMapper(), and functionFinished().
|
protected |
Definition at line 415 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 524 of file CGOpenMPRuntime.h.
Referenced by emitFunctionProlog().
Flag for keeping track of weather a target region has been emitted.
Definition at line 520 of file CGOpenMPRuntime.h.
Referenced by emitTargetOutlinedFunction().
Flag for keeping track of weather a requires unified_shared_memory directive is present.
Definition at line 514 of file CGOpenMPRuntime.h.
Referenced by CGOpenMPRuntime(), emitDeferredTargetDecls(), emitTargetGlobalVariable(), hasRequiresUnifiedSharedMemory(), and processRequiresDirective().
|
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 442 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 394 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 435 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 468 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 484 of file CGOpenMPRuntime.h.
Referenced by emitDoacrossInit().
|
protected |
Definition at line 445 of file CGOpenMPRuntime.h.
Referenced by emitKmpRoutineEntryT(), and emitTaskInit().
|
protected |
Type typedef kmp_int32 (* kmp_routine_entry_t)(kmp_int32, void *);.
Definition at line 444 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 478 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 455 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 510 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 430 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 500 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(), emitDeclareTargetFunction(), emitDepobjDependClause(), emitDestroyClause(), emitDistributeStaticInit(), emitDoacrossInit(), EmitDoacrossOrdered(), emitErrorCall(), emitFlush(), emitForDispatchDeinit(), emitForDispatchInit(), emitForNext(), emitForOrderedIterationEnd(), emitForStaticFinish(), emitForStaticInit(), emitLastprivateConditionalUpdate(), emitMaskedRegion(), emitMasterRegion(), emitNumTeamsClause(), emitNumThreadsClause(), emitOrderedRegion(), emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProcBindClause(), emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitSingleRegion(), emitTargetDataCalls(), emitTargetDataStandAloneCall(), emitTargetOutlinedFunctionHelper(), emitTaskCall(), emitTaskgroupRegion(), emitTaskInit(), emitTaskLoopCall(), emitTaskOutlinedFunction(), emitTaskReductionFini(), emitTaskReductionInit(), emitTaskwaitCall(), emitTaskyieldCall(), emitTeamsCall(), emitThreadLimitClause(), emitThreadPrivateVarInit(), emitUDMapperArrayInitOrDel(), emitUpdateLocation(), emitUserDefinedMapper(), emitUsesAllocatorsFini(), emitUsesAllocatorsInit(), getAddressOfLocalVariable(), getAddrOfArtificialThreadPrivate(), getAddrOfDeclareTargetVar(), getAddrOfThreadPrivate(), getCriticalRegionLock(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), getIdentTyPointerTy(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcFreeShared(), getName(), getOMPBuilder(), getOrCreateThreadPrivateCache(), getTaskReductionItem(), getThreadID(), processRequiresDirective(), registerTargetGlobalVariable(), and scanForTargetRegionsFunctions().
|
protected |
Definition at line 390 of file CGOpenMPRuntime.h.
|
protected |
Definition at line 405 of file CGOpenMPRuntime.h.
Referenced by clearLocThreadIdInsertPt(), functionFinished(), getThreadID(), and setLocThreadIdInsertPt().
|
protected |
Atomic ordering from the omp requires directive.
Definition at line 517 of file CGOpenMPRuntime.h.
Referenced by getDefaultMemoryOrdering(), and processRequiresDirective().
|
protected |
Saved kmp_task_t for taskloop-based directive.
Definition at line 459 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Saved kmp_task_t for task directive.
Definition at line 457 of file CGOpenMPRuntime.h.
Referenced by emitTaskInit().
|
protected |
Set of threadprivate variables with the generated initializer.
Definition at line 546 of file CGOpenMPRuntime.h.
Referenced by emitThreadPrivateVarDefinition().
|
protected |
Map from the user-defined mapper declaration to its corresponding functions.
Definition at line 418 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedMapper(), functionFinished(), and getOrCreateUserDefinedMapperFunc().
|
protected |
Definition at line 410 of file CGOpenMPRuntime.h.
Referenced by emitUserDefinedReduction(), functionFinished(), and getUserDefinedReduction().
|
protected |