class CGOpenMPSIMDRuntime
Declaration
class CGOpenMPSIMDRuntime : public CGOpenMPRuntime { /* full declaration omitted */ };
Description
Class supports emissionof SIMD-only code.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1930
Inherits from: CGOpenMPRuntime
Member Variables
Inherited from CGOpenMPRuntime:
Method Overview
- public CGOpenMPSIMDRuntime(clang::CodeGen::CodeGenModule & CGM)
- public void emitBarrierCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::OpenMPDirectiveKind Kind, bool EmitChecks = true, bool ForceSimpleCall = false)
- public void emitCancelCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, const clang::Expr * IfCond, clang::OpenMPDirectiveKind CancelRegion)
- public void emitCancellationPointCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::OpenMPDirectiveKind CancelRegion)
- public void emitCriticalRegion(clang::CodeGen::CodeGenFunction & CGF, llvm::StringRef CriticalName, const clang::CodeGen::RegionCodeGenTy & CriticalOpGen, clang::SourceLocation Loc, const clang::Expr * Hint = nullptr)
- public void emitDistributeStaticInit(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::OpenMPDistScheduleClauseKind SchedKind, const clang::CodeGen::CGOpenMPRuntime::StaticRTInput & Values)
- public void emitDoacrossInit(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPLoopDirective & D, ArrayRef<clang::Expr *> NumIterations)
- public void emitDoacrossOrdered(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPDependClause * C)
- public void emitFlush(clang::CodeGen::CodeGenFunction & CGF, ArrayRef<const clang::Expr *> Vars, clang::SourceLocation Loc, llvm::AtomicOrdering AO)
- public void emitForDispatchInit(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, const clang::OpenMPScheduleTy & ScheduleKind, unsigned int IVSize, bool IVSigned, bool Ordered, const clang::CodeGen::CGOpenMPRuntime::DispatchRTInput & DispatchValues)
- public llvm::Value * emitForNext(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, unsigned int IVSize, bool IVSigned, clang::CodeGen::Address IL, clang::CodeGen::Address LB, clang::CodeGen::Address UB, clang::CodeGen::Address ST)
- public void emitForOrderedIterationEnd(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, unsigned int IVSize, bool IVSigned)
- public void emitForStaticFinish(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::OpenMPDirectiveKind DKind)
- public void emitForStaticInit(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::OpenMPDirectiveKind DKind, const clang::OpenMPScheduleTy & ScheduleKind, const clang::CodeGen::CGOpenMPRuntime::StaticRTInput & Values)
- public void emitMaskedRegion(clang::CodeGen::CodeGenFunction & CGF, const clang::CodeGen::RegionCodeGenTy & MaskedOpGen, clang::SourceLocation Loc, const clang::Expr * Filter = nullptr)
- public void emitMasterRegion(clang::CodeGen::CodeGenFunction & CGF, const clang::CodeGen::RegionCodeGenTy & MasterOpGen, clang::SourceLocation Loc)
- public void emitNumTeamsClause(clang::CodeGen::CodeGenFunction & CGF, const clang::Expr * NumTeams, const clang::Expr * ThreadLimit, clang::SourceLocation Loc)
- public void emitNumThreadsClause(clang::CodeGen::CodeGenFunction & CGF, llvm::Value * NumThreads, clang::SourceLocation Loc)
- public void emitOrderedRegion(clang::CodeGen::CodeGenFunction & CGF, const clang::CodeGen::RegionCodeGenTy & OrderedOpGen, clang::SourceLocation Loc, bool IsThreads)
- public void emitParallelCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, llvm::Function * OutlinedFn, ArrayRef<llvm::Value *> CapturedVars, const clang::Expr * IfCond, llvm::Value * NumThreads)
- public llvm::Function * emitParallelOutlinedFunction(const clang::OMPExecutableDirective & D, const clang::VarDecl * ThreadIDVar, clang::OpenMPDirectiveKind InnermostKind, const clang::CodeGen::RegionCodeGenTy & CodeGen)
- public void emitProcBindClause(clang::CodeGen::CodeGenFunction & CGF, llvm::omp::ProcBindKind ProcBind, clang::SourceLocation Loc)
- public void emitReduction(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, ArrayRef<const clang::Expr *> Privates, ArrayRef<const clang::Expr *> LHSExprs, ArrayRef<const clang::Expr *> RHSExprs, ArrayRef<const clang::Expr *> ReductionOps, clang::CodeGen::CGOpenMPRuntime::ReductionOptionsTy Options)
- public void emitSingleRegion(clang::CodeGen::CodeGenFunction & CGF, const clang::CodeGen::RegionCodeGenTy & SingleOpGen, clang::SourceLocation Loc, ArrayRef<const clang::Expr *> CopyprivateVars, ArrayRef<const clang::Expr *> DestExprs, ArrayRef<const clang::Expr *> SrcExprs, ArrayRef<const clang::Expr *> AssignmentOps)
- public void emitTargetCall(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPExecutableDirective & D, llvm::Function * OutlinedFn, llvm::Value * OutlinedFnID, const clang::Expr * IfCond, llvm::PointerIntPair<const Expr *, 2, OpenMPDeviceClauseModifier> Device, llvm::function_ref<llvm::Value *(CodeGenFunction &, const OMPLoopDirective &)> SizeEmitter)
- public void emitTargetDataCalls(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPExecutableDirective & D, const clang::Expr * IfCond, const clang::Expr * Device, const clang::CodeGen::RegionCodeGenTy & CodeGen, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo & Info)
- public void emitTargetDataStandAloneCall(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPExecutableDirective & D, const clang::Expr * IfCond, const clang::Expr * Device)
- public bool emitTargetFunctions(clang::GlobalDecl GD)
- public bool emitTargetGlobal(clang::GlobalDecl GD)
- public bool emitTargetGlobalVariable(clang::GlobalDecl GD)
- public void emitTargetOutlinedFunction(const clang::OMPExecutableDirective & D, llvm::StringRef ParentName, llvm::Function *& OutlinedFn, llvm::Constant *& OutlinedFnID, bool IsOffloadEntry, const clang::CodeGen::RegionCodeGenTy & CodeGen)
- public void emitTaskCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, const clang::OMPExecutableDirective & D, llvm::Function * TaskFunction, clang::QualType SharedsTy, clang::CodeGen::Address Shareds, const clang::Expr * IfCond, const clang::CodeGen::OMPTaskDataTy & Data)
- public void emitTaskLoopCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, const clang::OMPLoopDirective & D, llvm::Function * TaskFunction, clang::QualType SharedsTy, clang::CodeGen::Address Shareds, const clang::Expr * IfCond, const clang::CodeGen::OMPTaskDataTy & Data)
- public llvm::Function * emitTaskOutlinedFunction(const clang::OMPExecutableDirective & D, const clang::VarDecl * ThreadIDVar, const clang::VarDecl * PartIDVar, const clang::VarDecl * TaskTVar, clang::OpenMPDirectiveKind InnermostKind, const clang::CodeGen::RegionCodeGenTy & CodeGen, bool Tied, unsigned int & NumberOfParts)
- public void emitTaskReductionFini(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, bool IsWorksharingReduction)
- public void emitTaskReductionFixups(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, clang::CodeGen::ReductionCodeGen & RCG, unsigned int N)
- public llvm::Value * emitTaskReductionInit(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, ArrayRef<const clang::Expr *> LHSExprs, ArrayRef<const clang::Expr *> RHSExprs, const clang::CodeGen::OMPTaskDataTy & Data)
- public void emitTaskgroupRegion(clang::CodeGen::CodeGenFunction & CGF, const clang::CodeGen::RegionCodeGenTy & TaskgroupOpGen, clang::SourceLocation Loc)
- public void emitTaskwaitCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, const clang::CodeGen::OMPTaskDataTy & Data)
- public void emitTaskyieldCall(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc)
- public void emitTeamsCall(clang::CodeGen::CodeGenFunction & CGF, const clang::OMPExecutableDirective & D, clang::SourceLocation Loc, llvm::Function * OutlinedFn, ArrayRef<llvm::Value *> CapturedVars)
- public llvm::Function * emitTeamsOutlinedFunction(const clang::OMPExecutableDirective & D, const clang::VarDecl * ThreadIDVar, clang::OpenMPDirectiveKind InnermostKind, const clang::CodeGen::RegionCodeGenTy & CodeGen)
- public llvm::Function * emitThreadPrivateVarDefinition(const clang::VarDecl * VD, clang::CodeGen::Address VDAddr, clang::SourceLocation Loc, bool PerformInit, clang::CodeGen::CodeGenFunction * CGF = nullptr)
- public clang::CodeGen::Address getAddrOfArtificialThreadPrivate(clang::CodeGen::CodeGenFunction & CGF, clang::QualType VarType, llvm::StringRef Name)
- public clang::CodeGen::Address getAddrOfThreadPrivate(clang::CodeGen::CodeGenFunction & CGF, const clang::VarDecl * VD, clang::CodeGen::Address VDAddr, clang::SourceLocation Loc)
- public clang::CodeGen::Address getAddressOfLocalVariable(clang::CodeGen::CodeGenFunction & CGF, const clang::VarDecl * VD)
- public clang::CodeGen::Address getParameterAddress(clang::CodeGen::CodeGenFunction & CGF, const clang::VarDecl * NativeParam, const clang::VarDecl * TargetParam) const
- public clang::CodeGen::Address getTaskReductionItem(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation Loc, llvm::Value * ReductionsPtr, clang::CodeGen::LValue SharedLVal)
- public const clang::VarDecl * translateParameter(const clang::FieldDecl * FD, const clang::VarDecl * NativeParam) const
- public ~CGOpenMPSIMDRuntime()
Inherited from CGOpenMPRuntime:
- public adjustTargetSpecificDataForLambdas
- public checkAndEmitLastprivateConditional
- public checkAndEmitSharedLastprivateConditional
- public clear
- protected clearLocThreadIdInsertPt
- public createOffloadEntriesAndInfoMetadata
- protected createOffloadEntry
- public emitBarrierCall
- protected emitCall
- public emitCancelCall
- public emitCancellationPointCall
- public emitCriticalRegion
- public emitDeclareSimdFunction
- public emitDeclareTargetVarDefinition
- public emitDeferredTargetDecls
- public emitDependClause
- public emitDepobjDependClause
- public emitDestroyClause
- public emitDistributeStaticInit
- public emitDoacrossInit
- public emitDoacrossOrdered
- public emitFlush
- public emitForDispatchInit
- public emitForNext
- public emitForOrderedIterationEnd
- public emitForStaticFinish
- public emitForStaticInit
- public emitFunctionProlog
- public emitIfClause
- public emitInlinedDirective
- public emitLastprivateConditionalFinalUpdate
- public emitLastprivateConditionalInit
- public emitMaskedRegion
- public emitMasterRegion
- public emitNumTeamsClause
- protected emitNumTeamsForTargetDirective
- public emitNumThreadsClause
- protected emitNumThreadsForTargetDirective
- public emitOrderedRegion
- public emitOutlinedFunctionCall
- public emitParallelCall
- public emitParallelOutlinedFunction
- public emitProcBindClause
- public emitReduction
- public emitReductionFunction
- public emitRequiresDirectiveRegFun
- public emitSingleReductionCombiner
- public emitSingleRegion
- public emitTargetCall
- public emitTargetDataCalls
- public emitTargetDataStandAloneCall
- public emitTargetFunctions
- public emitTargetGlobal
- public emitTargetGlobalVariable
- public emitTargetOutlinedFunction
- protected emitTargetOutlinedFunctionHelper
- public emitTaskCall
- public emitTaskLoopCall
- public emitTaskOutlinedFunction
- public emitTaskReductionFini
- public emitTaskReductionFixups
- public emitTaskReductionInit
- public emitTaskgroupRegion
- public emitTaskwaitCall
- public emitTaskyieldCall
- public emitTeamsCall
- public emitTeamsOutlinedFunction
- protected emitThreadIDAddress
- public emitThreadPrivateVarDefinition
- public emitUpdateClause
- protected emitUpdateLocation
- public emitUserDefinedMapper
- public emitUserDefinedReduction
- public emitUsesAllocatorsFini
- public emitUsesAllocatorsInit
- public functionFinished
- public getAddrOfArtificialThreadPrivate
- public getAddrOfDeclareTargetVar
- public getAddrOfThreadPrivate
- public getAddressOfLocalVariable
- protected getCriticalRegionLock
- public getDefaultDistScheduleAndChunk
- protected getDefaultFlagsForBarriers
- protected getDefaultLocationReserved2Flags
- public getDefaultMemoryOrdering
- public getDefaultScheduleAndChunk
- protected getIdentTyPointerTy
- protected getKmpCriticalNameTy
- public getName
- protected getNumTeamsExprForTargetDirective
- protected getNumThreadsExprForTargetDirective
- public getOMPBuilder
- public getOrCreateUserDefinedMapperFunc
- protected getOutlinedHelperName
- public getParameterAddress
- public getSingleCompoundChild
- public getTaskReductionItem
- protected getThreadID
- public getUserDefinedReduction
- public hasAllocateAttributeForGlobalVar
- public hasRequiresUnifiedSharedMemory
- protected isDefaultLocationConstant
- public isDynamic
- public isLocalVarInUntiedTask
- public isNontemporalDecl
- public isStaticChunked
- public isStaticChunked
- public isStaticNonchunked
- public isStaticNonchunked
- public markAsGlobalTarget
- public processRequiresDirective
- public registerTargetGlobalVariable
- protected setLocThreadIdInsertPt
- public translateParameter
Methods
¶CGOpenMPSIMDRuntime(
clang::CodeGen::CodeGenModule& CGM)
CGOpenMPSIMDRuntime(
clang::CodeGen::CodeGenModule& CGM)
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1932
Parameters
¶void emitBarrierCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind Kind,
bool EmitChecks = true,
bool ForceSimpleCall = false)
void emitBarrierCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind Kind,
bool EmitChecks = true,
bool ForceSimpleCall = false)
Description
Emit an implicit/explicit barrier for OpenMP threads.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2064
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- clang::OpenMPDirectiveKind Kind
- Directive for which this implicit barrier call must be generated. Must be OMPD_barrier for explicit barrier generation.
- bool EmitChecks = true
- true if need to emit checks for cancellation barriers.
- bool ForceSimpleCall = false
- true simple barrier call must be emitted, false if runtime class decides which one to emit (simple or with cancellation checks).
¶void emitCancelCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::Expr* IfCond,
clang::OpenMPDirectiveKind CancelRegion)
void emitCancelCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::Expr* IfCond,
clang::OpenMPDirectiveKind CancelRegion)
Description
Emit code for 'cancel' construct.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2405
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- const clang::Expr* IfCond
- Condition in the associated 'if' clause, if it was specified, nullptr otherwise.
- clang::OpenMPDirectiveKind CancelRegion
- Region kind for which the cancel must be emitted.
¶void emitCancellationPointCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind CancelRegion)
void emitCancellationPointCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind CancelRegion)
Description
Emit code for 'cancellation point' construct.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2397
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- clang::OpenMPDirectiveKind CancelRegion
- Region kind for which the cancellation point must be emitted.
¶void emitCriticalRegion(
clang::CodeGen::CodeGenFunction& CGF,
llvm::StringRef CriticalName,
const clang::CodeGen::RegionCodeGenTy&
CriticalOpGen,
clang::SourceLocation Loc,
const clang::Expr* Hint = nullptr)
void emitCriticalRegion(
clang::CodeGen::CodeGenFunction& CGF,
llvm::StringRef CriticalName,
const clang::CodeGen::RegionCodeGenTy&
CriticalOpGen,
clang::SourceLocation Loc,
const clang::Expr* Hint = nullptr)
Description
Emits a critical region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2006
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- llvm::StringRef CriticalName
- Name of the critical region.
- const clang::CodeGen::RegionCodeGenTy& CriticalOpGen
- Generator for the statement associated with the given critical region.
- clang::SourceLocation Loc
- const clang::Expr* Hint = nullptr
- Value of the 'hint' clause (optional).
¶void emitDistributeStaticInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDistScheduleClauseKind SchedKind,
const clang::CodeGen::CGOpenMPRuntime::
StaticRTInput& Values)
void emitDistributeStaticInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDistScheduleClauseKind SchedKind,
const clang::CodeGen::CGOpenMPRuntime::
StaticRTInput& Values)
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2115
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- Reference to current CodeGenFunction.
- clang::SourceLocation Loc
- Clang source location.
- clang::OpenMPDistScheduleClauseKind SchedKind
- Schedule kind, specified by the 'dist_schedule' clause.
- const clang::CodeGen::CGOpenMPRuntime:: StaticRTInput& Values
- Input arguments for the construct.
¶void emitDoacrossInit(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPLoopDirective& D,
ArrayRef<clang::Expr*> NumIterations)
void emitDoacrossInit(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPLoopDirective& D,
ArrayRef<clang::Expr*> NumIterations)
Description
Emit initialization for doacross loop nesting support.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2506
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPLoopDirective& D
- Loop-based construct used in doacross nesting construct.
- ArrayRef<clang::Expr*> NumIterations
¶void emitDoacrossOrdered(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPDependClause* C)
void emitDoacrossOrdered(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPDependClause* C)
Description
Emit code for doacross ordered directive with 'depend' clause.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2511
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPDependClause* C
- 'depend' clause with 'sink|source' dependency kind.
¶void emitFlush(
clang::CodeGen::CodeGenFunction& CGF,
ArrayRef<const clang::Expr*> Vars,
clang::SourceLocation Loc,
llvm::AtomicOrdering AO)
void emitFlush(
clang::CodeGen::CodeGenFunction& CGF,
ArrayRef<const clang::Expr*> Vars,
clang::SourceLocation Loc,
llvm::AtomicOrdering AO)
Description
Emit flush of the variables specified in 'omp flush' directive.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2203
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- ArrayRef<const clang::Expr*> Vars
- List of variables to flush.
- clang::SourceLocation Loc
- llvm::AtomicOrdering AO
¶void emitForDispatchInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OpenMPScheduleTy& ScheduleKind,
unsigned int IVSize,
bool IVSigned,
bool Ordered,
const clang::CodeGen::CGOpenMPRuntime::
DispatchRTInput& DispatchValues)
void emitForDispatchInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OpenMPScheduleTy& ScheduleKind,
unsigned int IVSize,
bool IVSigned,
bool Ordered,
const clang::CodeGen::CGOpenMPRuntime::
DispatchRTInput& DispatchValues)
Description
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 \a LB and \a UB and stride \a ST.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2084
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- Reference to current CodeGenFunction.
- clang::SourceLocation Loc
- Clang source location.
- const clang::OpenMPScheduleTy& ScheduleKind
- Schedule kind, specified by the 'schedule' clause.
- unsigned int IVSize
- Size of the iteration variable in bits.
- bool IVSigned
- Sign of the iteration variable.
- bool Ordered
- true if loop is ordered, false otherwise.
- const clang::CodeGen::CGOpenMPRuntime:: DispatchRTInput& DispatchValues
- struct containing llvm values for lower bound, upper bound, and chunk expression. For the default (nullptr) value, the chunk 1 will be used.
¶llvm::Value* emitForNext(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
unsigned int IVSize,
bool IVSigned,
clang::CodeGen::Address IL,
clang::CodeGen::Address LB,
clang::CodeGen::Address UB,
clang::CodeGen::Address ST)
llvm::Value* emitForNext(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
unsigned int IVSize,
bool IVSigned,
clang::CodeGen::Address IL,
clang::CodeGen::Address LB,
clang::CodeGen::Address UB,
clang::CodeGen::Address ST)
Description
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);
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2154
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- unsigned int IVSize
- Size of the iteration variable in bits.
- bool IVSigned
- Sign of the iteration variable.
- clang::CodeGen::Address IL
- Address of the output variable in which the flag of the last iteration is returned.
- clang::CodeGen::Address LB
- Address of the output variable in which the lower iteration number is returned.
- clang::CodeGen::Address UB
- Address of the output variable in which the upper iteration number is returned.
- clang::CodeGen::Address ST
- Address of the output variable in which the stride value is returned.
¶void emitForOrderedIterationEnd(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
unsigned int IVSize,
bool IVSigned)
void emitForOrderedIterationEnd(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
unsigned int IVSize,
bool IVSigned)
Description
Call the appropriate runtime routine to notify that we finished iteration of the ordered loop with the dynamic scheduling.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2127
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- Reference to current CodeGenFunction.
- clang::SourceLocation Loc
- Clang source location.
- unsigned int IVSize
- Size of the iteration variable in bits.
- bool IVSigned
- Sign of the iteration variable.
¶void emitForStaticFinish(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind DKind)
void emitForStaticFinish(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind DKind)
Description
Call the appropriate runtime routine to notify that we finished all the work with current loop.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2137
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- Reference to current CodeGenFunction.
- clang::SourceLocation Loc
- Clang source location.
- clang::OpenMPDirectiveKind DKind
- Kind of the directive for which the static finish is emitted.
¶void emitForStaticInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind DKind,
const clang::OpenMPScheduleTy& ScheduleKind,
const clang::CodeGen::CGOpenMPRuntime::
StaticRTInput& Values)
void emitForStaticInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::OpenMPDirectiveKind DKind,
const clang::OpenMPScheduleTy& ScheduleKind,
const clang::CodeGen::CGOpenMPRuntime::
StaticRTInput& Values)
Description
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.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2104
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- Reference to current CodeGenFunction.
- clang::SourceLocation Loc
- Clang source location.
- clang::OpenMPDirectiveKind DKind
- Kind of the directive.
- const clang::OpenMPScheduleTy& ScheduleKind
- Schedule kind, specified by the 'schedule' clause.
- const clang::CodeGen::CGOpenMPRuntime:: StaticRTInput& Values
- Input arguments for the construct.
¶void emitMaskedRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
MaskedOpGen,
clang::SourceLocation Loc,
const clang::Expr* Filter = nullptr)
void emitMaskedRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
MaskedOpGen,
clang::SourceLocation Loc,
const clang::Expr* Filter = nullptr)
Description
Emits a masked region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2021
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::CodeGen::RegionCodeGenTy& MaskedOpGen
- Generator for the statement associated with the given masked region.
- clang::SourceLocation Loc
- const clang::Expr* Filter = nullptr
¶void emitMasterRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
MasterOpGen,
clang::SourceLocation Loc)
void emitMasterRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
MasterOpGen,
clang::SourceLocation Loc)
Description
Emits a master region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2014
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::CodeGen::RegionCodeGenTy& MasterOpGen
- Generator for the statement associated with the given master region.
- clang::SourceLocation Loc
¶void emitNumTeamsClause(
clang::CodeGen::CodeGenFunction& CGF,
const clang::Expr* NumTeams,
const clang::Expr* ThreadLimit,
clang::SourceLocation Loc)
void emitNumTeamsClause(
clang::CodeGen::CodeGenFunction& CGF,
const clang::Expr* NumTeams,
const clang::Expr* ThreadLimit,
clang::SourceLocation Loc)
Description
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.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2476
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::Expr* NumTeams
- An integer expression of teams.
- const clang::Expr* ThreadLimit
- An integer expression of threads.
- clang::SourceLocation Loc
¶void emitNumThreadsClause(
clang::CodeGen::CodeGenFunction& CGF,
llvm::Value* NumThreads,
clang::SourceLocation Loc)
void emitNumThreadsClause(
clang::CodeGen::CodeGenFunction& CGF,
llvm::Value* NumThreads,
clang::SourceLocation Loc)
Description
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.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2162
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- llvm::Value* NumThreads
- An integer value of threads.
- clang::SourceLocation Loc
¶void emitOrderedRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
OrderedOpGen,
clang::SourceLocation Loc,
bool IsThreads)
void emitOrderedRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
OrderedOpGen,
clang::SourceLocation Loc,
bool IsThreads)
Description
Emit an ordered region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2052
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::CodeGen::RegionCodeGenTy& OrderedOpGen
- Generator for the statement associated with the given ordered region.
- clang::SourceLocation Loc
- bool IsThreads
¶void emitParallelCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
llvm::Function* OutlinedFn,
ArrayRef<llvm::Value*> CapturedVars,
const clang::Expr* IfCond,
llvm::Value* NumThreads)
void emitParallelCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
llvm::Function* OutlinedFn,
ArrayRef<llvm::Value*> CapturedVars,
const clang::Expr* IfCond,
llvm::Value* NumThreads)
Description
Emits code for parallel or serial call of the \a OutlinedFn with variables captured in a record which address is stored in \a CapturedStruct.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1996
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- llvm::Function* OutlinedFn
- Outlined function to be run in parallel threads. Type of this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*).
- ArrayRef<llvm::Value*> CapturedVars
- A pointer to the record with the references to variables used in \a OutlinedFn function.
- const clang::Expr* IfCond
- Condition in the associated 'if' clause, if it was specified, nullptr otherwise.
- llvm::Value* NumThreads
- The value corresponding to the num_threads clause, if any, or nullptr.
¶llvm::Function* emitParallelOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
llvm::Function* emitParallelOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
Description
Emits outlined function for the specified OpenMP parallel directive\a D. This outlined function has type void(*)(kmp_int32 *ThreadID, kmp_int32 BoundID, struct context_vars*).
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1944
Parameters
- const clang::OMPExecutableDirective& D
- OpenMP directive.
- const clang::VarDecl* ThreadIDVar
- Variable for thread id in the current OpenMP region.
- clang::OpenMPDirectiveKind InnermostKind
- Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive).
- const clang::CodeGen::RegionCodeGenTy& CodeGen
- Code generation sequence for the \a D directive.
¶void emitProcBindClause(
clang::CodeGen::CodeGenFunction& CGF,
llvm::omp::ProcBindKind ProcBind,
clang::SourceLocation Loc)
void emitProcBindClause(
clang::CodeGen::CodeGenFunction& CGF,
llvm::omp::ProcBindKind ProcBind,
clang::SourceLocation Loc)
Description
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.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2167
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- llvm::omp::ProcBindKind ProcBind
- clang::SourceLocation Loc
¶void emitReduction(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> Privates,
ArrayRef<const clang::Expr*> LHSExprs,
ArrayRef<const clang::Expr*> RHSExprs,
ArrayRef<const clang::Expr*> ReductionOps,
clang::CodeGen::CGOpenMPRuntime::
ReductionOptionsTy Options)
void emitReduction(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> Privates,
ArrayRef<const clang::Expr*> LHSExprs,
ArrayRef<const clang::Expr*> RHSExprs,
ArrayRef<const clang::Expr*> ReductionOps,
clang::CodeGen::CGOpenMPRuntime::
ReductionOptionsTy Options)
Description
Emit a code for reduction clause. Next code should be emitted for reduction:
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2315
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- ArrayRef<const clang::Expr*> Privates
- List of private copies for original reduction arguments.
- ArrayRef<const clang::Expr*> LHSExprs
- List of LHS in \a ReductionOps reduction operations.
- ArrayRef<const clang::Expr*> RHSExprs
- List of RHS in \a ReductionOps reduction operations.
- ArrayRef<const clang::Expr*> ReductionOps
- List of reduction operations in form 'LHS binop RHS' or 'operator binop(LHS, RHS)'.
- clang::CodeGen::CGOpenMPRuntime:: ReductionOptionsTy 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.
¶void emitSingleRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
SingleOpGen,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> CopyprivateVars,
ArrayRef<const clang::Expr*> DestExprs,
ArrayRef<const clang::Expr*> SrcExprs,
ArrayRef<const clang::Expr*> AssignmentOps)
void emitSingleRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
SingleOpGen,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> CopyprivateVars,
ArrayRef<const clang::Expr*> DestExprs,
ArrayRef<const clang::Expr*> SrcExprs,
ArrayRef<const clang::Expr*> AssignmentOps)
Description
Emits a single region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2042
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::CodeGen::RegionCodeGenTy& SingleOpGen
- Generator for the statement associated with the given single region.
- clang::SourceLocation Loc
- ArrayRef<const clang::Expr*> CopyprivateVars
- ArrayRef<const clang::Expr*> DestExprs
- ArrayRef<const clang::Expr*> SrcExprs
- ArrayRef<const clang::Expr*> AssignmentOps
¶void emitTargetCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
llvm::Function* OutlinedFn,
llvm::Value* OutlinedFnID,
const clang::Expr* IfCond,
llvm::PointerIntPair<
const Expr*,
2,
OpenMPDeviceClauseModifier> Device,
llvm::function_ref<llvm::Value*(
CodeGenFunction&,
const OMPLoopDirective&)> SizeEmitter)
void emitTargetCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
llvm::Function* OutlinedFn,
llvm::Value* OutlinedFnID,
const clang::Expr* IfCond,
llvm::PointerIntPair<
const Expr*,
2,
OpenMPDeviceClauseModifier> Device,
llvm::function_ref<llvm::Value*(
CodeGenFunction&,
const OMPLoopDirective&)> SizeEmitter)
Description
Emit the target offloading code associated with \a D. The emitted code attempts offloading the execution to the device, an the event of a failure it executes the host version outlined in \a OutlinedFn.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2435
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPExecutableDirective& D
- Directive to emit.
- llvm::Function* OutlinedFn
- Host version of the code to be offloaded.
- llvm::Value* OutlinedFnID
- ID of host version of the code to be offloaded.
- const clang::Expr* IfCond
- Expression evaluated in if clause associated with the target directive, or null if no if clause is used.
- llvm::PointerIntPair<const Expr*, 2, OpenMPDeviceClauseModifier> Device
- Expression evaluated in device clause associated with the target directive, or null if no device clause is used and device modifier.
- llvm::function_ref<llvm::Value*( CodeGenFunction&, const OMPLoopDirective&)> SizeEmitter
¶void emitTargetDataCalls(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
const clang::Expr* IfCond,
const clang::Expr* Device,
const clang::CodeGen::RegionCodeGenTy&
CodeGen,
clang::CodeGen::CGOpenMPRuntime::
TargetDataInfo& Info)
void emitTargetDataCalls(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
const clang::Expr* IfCond,
const clang::Expr* Device,
const clang::CodeGen::RegionCodeGenTy&
CodeGen,
clang::CodeGen::CGOpenMPRuntime::
TargetDataInfo& Info)
Description
Emit the target data mapping code associated with \a D.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2487
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPExecutableDirective& D
- Directive to emit.
- const clang::Expr* IfCond
- Expression evaluated in if clause associated with the target directive, or null if no device clause is used.
- const clang::Expr* Device
- Expression evaluated in device clause associated with the target directive, or null if no device clause is used.
- const clang::CodeGen::RegionCodeGenTy& CodeGen
- clang::CodeGen::CGOpenMPRuntime::TargetDataInfo& Info
- A record used to store information that needs to be preserved until the region is closed.
¶void emitTargetDataStandAloneCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
const clang::Expr* IfCond,
const clang::Expr* Device)
void emitTargetDataStandAloneCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
const clang::Expr* IfCond,
const clang::Expr* Device)
Description
Emit the data mapping/movement code associated with the directive\a D that should be of the form 'target [{enter|exit} data | update]'.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2499
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPExecutableDirective& D
- Directive to emit.
- const clang::Expr* IfCond
- Expression evaluated in if clause associated with the target directive, or null if no if clause is used.
- const clang::Expr* Device
- Expression evaluated in device clause associated with the target directive, or null if no device clause is used.
¶bool emitTargetFunctions(clang::GlobalDecl GD)
bool emitTargetFunctions(clang::GlobalDecl GD)
Description
Emit the target regions enclosed in \a GD function definition or the function itself in case it is a valid device function. Returns true if\a GD was dealt with successfully.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2447
Parameters
- clang::GlobalDecl GD
- Function to scan.
¶bool emitTargetGlobal(clang::GlobalDecl GD)
bool emitTargetGlobal(clang::GlobalDecl GD)
Description
Emit the global \a GD if it is meaningful for the target. Returns if it was emitted successfully.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2457
Parameters
- clang::GlobalDecl GD
- Global to scan.
¶bool emitTargetGlobalVariable(
clang::GlobalDecl GD)
bool emitTargetGlobalVariable(
clang::GlobalDecl GD)
Description
Emit the global variable if it is a valid device global variable. Returns true if \a GD was dealt with successfully.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2452
Parameters
- clang::GlobalDecl GD
- Variable declaration to emit.
¶void emitTargetOutlinedFunction(
const clang::OMPExecutableDirective& D,
llvm::StringRef ParentName,
llvm::Function*& OutlinedFn,
llvm::Constant*& OutlinedFnID,
bool IsOffloadEntry,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
void emitTargetOutlinedFunction(
const clang::OMPExecutableDirective& D,
llvm::StringRef ParentName,
llvm::Function*& OutlinedFn,
llvm::Constant*& OutlinedFnID,
bool IsOffloadEntry,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
Description
Emit outilined function for 'target' directive.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2418
Parameters
- const clang::OMPExecutableDirective& D
- Directive to emit.
- llvm::StringRef ParentName
- Name of the function that encloses the target region.
- llvm::Function*& OutlinedFn
- Outlined function value to be defined by this call.
- llvm::Constant*& OutlinedFnID
- Outlined function ID value to be defined by this call.
- bool IsOffloadEntry
- True if the outlined function is an offload entry.
- const clang::CodeGen::RegionCodeGenTy& CodeGen
- Code generation sequence for the \a D directive. An outlined function may not be an entry if, e.g. the if clause always evaluates to false.
¶void emitTaskCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OMPExecutableDirective& D,
llvm::Function* TaskFunction,
clang::QualType SharedsTy,
clang::CodeGen::Address Shareds,
const clang::Expr* IfCond,
const clang::CodeGen::OMPTaskDataTy& Data)
void emitTaskCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OMPExecutableDirective& D,
llvm::Function* TaskFunction,
clang::QualType SharedsTy,
clang::CodeGen::Address Shareds,
const clang::Expr* IfCond,
const clang::CodeGen::OMPTaskDataTy& Data)
Description
Emit task region for the task directive. The task region is emitted in several steps: 1. Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry). Here task_entry is a pointer to the function: kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) { TaskFunction(gtid, tt->part_id, tt->shareds); return 0; } 2. Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any). 3. Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t. 4. Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2233
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- const clang::OMPExecutableDirective& D
- Current task directive.
- llvm::Function* TaskFunction
- An LLVM function with type void (*)(i32 /*gtid*/, i32 /*part_id*/, captured_struct */*__context*/);
- clang::QualType SharedsTy
- A type which contains references the shared variables.
- clang::CodeGen::Address Shareds
- Context with the list of shared variables from the \p TaskFunction.
- const clang::Expr* IfCond
- Not a nullptr if 'if' clause was specified, nullptr otherwise.
- const clang::CodeGen::OMPTaskDataTy& Data
- Additional data for task generation like tiednsee, final state, list of privates etc.
¶void emitTaskLoopCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OMPLoopDirective& D,
llvm::Function* TaskFunction,
clang::QualType SharedsTy,
clang::CodeGen::Address Shareds,
const clang::Expr* IfCond,
const clang::CodeGen::OMPTaskDataTy& Data)
void emitTaskLoopCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::OMPLoopDirective& D,
llvm::Function* TaskFunction,
clang::QualType SharedsTy,
clang::CodeGen::Address Shareds,
const clang::Expr* IfCond,
const clang::CodeGen::OMPTaskDataTy& Data)
Description
Emit task region for the taskloop directive. The taskloop region is emitted in several steps: 1. Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry). Here task_entry is a pointer to the function: kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) { TaskFunction(gtid, tt->part_id, tt->shareds); return 0; } 2. Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any). 3. Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t. 4. Emit a call to void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup, int sched, kmp_uint64 grainsize, void *task_dup ), where new_task is a resulting structure from previous items.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2268
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- const clang::OMPLoopDirective& D
- Current task directive.
- llvm::Function* TaskFunction
- An LLVM function with type void (*)(i32 /*gtid*/, i32 /*part_id*/, captured_struct */*__context*/);
- clang::QualType SharedsTy
- A type which contains references the shared variables.
- clang::CodeGen::Address Shareds
- Context with the list of shared variables from the \p TaskFunction.
- const clang::Expr* IfCond
- Not a nullptr if 'if' clause was specified, nullptr otherwise.
- const clang::CodeGen::OMPTaskDataTy& Data
- Additional data for task generation like tiednsee, final state, list of privates etc.
¶llvm::Function* emitTaskOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
const clang::VarDecl* PartIDVar,
const clang::VarDecl* TaskTVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen,
bool Tied,
unsigned int& NumberOfParts)
llvm::Function* emitTaskOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
const clang::VarDecl* PartIDVar,
const clang::VarDecl* TaskTVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen,
bool Tied,
unsigned int& NumberOfParts)
Description
Emits outlined function for the OpenMP task directive \a D. This outlined function has type void(*)(kmp_int32 ThreadID, struct task_t* TaskT).
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1978
Parameters
- const clang::OMPExecutableDirective& D
- OpenMP directive.
- const clang::VarDecl* ThreadIDVar
- Variable for thread id in the current OpenMP region.
- const clang::VarDecl* PartIDVar
- Variable for partition id in the current OpenMP untied task region.
- const clang::VarDecl* TaskTVar
- Variable for task_t argument.
- clang::OpenMPDirectiveKind InnermostKind
- Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive).
- const clang::CodeGen::RegionCodeGenTy& CodeGen
- Code generation sequence for the \a D directive.
- bool Tied
- true if task is generated for tied task, false otherwise.
- unsigned int& NumberOfParts
- Number of parts in untied task. Ignored for tied tasks.
¶void emitTaskReductionFini(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
bool IsWorksharingReduction)
void emitTaskReductionFini(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
bool IsWorksharingReduction)
Description
Emits the following code for reduction clause with task modifier:
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2367
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- bool IsWorksharingReduction
¶void emitTaskReductionFixups(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::CodeGen::ReductionCodeGen& RCG,
unsigned int N)
void emitTaskReductionFixups(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
clang::CodeGen::ReductionCodeGen& RCG,
unsigned int N)
Description
Required to resolve existing problems in the runtime. Emits threadprivate variables to store the size of the VLAs/array sections for initializer/combiner/finalizer functions + emits threadprivate variable to store the pointer to the original reduction item for the custom initializer defined by declare reduction construct.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2377
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- clang::CodeGen::ReductionCodeGen& RCG
- Allows to reuse an existing data for the reductions.
- unsigned int N
- Reduction item for which fixups must be emitted.
¶llvm::Value* emitTaskReductionInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> LHSExprs,
ArrayRef<const clang::Expr*> RHSExprs,
const clang::CodeGen::OMPTaskDataTy& Data)
llvm::Value* emitTaskReductionInit(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
ArrayRef<const clang::Expr*> LHSExprs,
ArrayRef<const clang::Expr*> RHSExprs,
const clang::CodeGen::OMPTaskDataTy& Data)
Description
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:
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2358
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- ArrayRef<const clang::Expr*> LHSExprs
- List of LHS in \a Data.ReductionOps reduction operations.
- ArrayRef<const clang::Expr*> RHSExprs
- List of RHS in \a Data.ReductionOps reduction operations.
- const clang::CodeGen::OMPTaskDataTy& Data
- Additional data for task generation like tiedness, final state, list of privates, reductions etc.
¶void emitTaskgroupRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
TaskgroupOpGen,
clang::SourceLocation Loc)
void emitTaskgroupRegion(
clang::CodeGen::CodeGenFunction& CGF,
const clang::CodeGen::RegionCodeGenTy&
TaskgroupOpGen,
clang::SourceLocation Loc)
Description
Emit a taskgroup region.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2035
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::CodeGen::RegionCodeGenTy& TaskgroupOpGen
- Generator for the statement associated with the given taskgroup region.
- clang::SourceLocation Loc
¶void emitTaskwaitCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::CodeGen::OMPTaskDataTy& Data)
void emitTaskwaitCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
const clang::CodeGen::OMPTaskDataTy& Data)
Description
Emit code for 'taskwait' directive.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2390
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- const clang::CodeGen::OMPTaskDataTy& Data
¶void emitTaskyieldCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc)
void emitTaskyieldCall(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc)
Description
Emits code for a taskyield directive.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2030
Parameters
¶void emitTeamsCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
clang::SourceLocation Loc,
llvm::Function* OutlinedFn,
ArrayRef<llvm::Value*> CapturedVars)
void emitTeamsCall(
clang::CodeGen::CodeGenFunction& CGF,
const clang::OMPExecutableDirective& D,
clang::SourceLocation Loc,
llvm::Function* OutlinedFn,
ArrayRef<llvm::Value*> CapturedVars)
Description
Emits code for teams call of the \a OutlinedFn with variables captured in a record which address is stored in \a CapturedStruct.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2467
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::OMPExecutableDirective& D
- clang::SourceLocation Loc
- llvm::Function* OutlinedFn
- Outlined function to be run by team masters. Type of this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*).
- ArrayRef<llvm::Value*> CapturedVars
- A pointer to the record with the references to variables used in \a OutlinedFn function.
¶llvm::Function* emitTeamsOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
llvm::Function* emitTeamsOutlinedFunction(
const clang::OMPExecutableDirective& D,
const clang::VarDecl* ThreadIDVar,
clang::OpenMPDirectiveKind InnermostKind,
const clang::CodeGen::RegionCodeGenTy&
CodeGen)
Description
Emits outlined function for the specified OpenMP teams directive\a D. This outlined function has type void(*)(kmp_int32 *ThreadID, kmp_int32 BoundID, struct context_vars*).
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1958
Parameters
- const clang::OMPExecutableDirective& D
- OpenMP directive.
- const clang::VarDecl* ThreadIDVar
- Variable for thread id in the current OpenMP region.
- clang::OpenMPDirectiveKind InnermostKind
- Kind of innermost directive (for simple directives it is a directive itself, for combined - its innermost directive).
- const clang::CodeGen::RegionCodeGenTy& CodeGen
- Code generation sequence for the \a D directive.
¶llvm::Function* emitThreadPrivateVarDefinition(
const clang::VarDecl* VD,
clang::CodeGen::Address VDAddr,
clang::SourceLocation Loc,
bool PerformInit,
clang::CodeGen::CodeGenFunction* CGF =
nullptr)
llvm::Function* emitThreadPrivateVarDefinition(
const clang::VarDecl* VD,
clang::CodeGen::Address VDAddr,
clang::SourceLocation Loc,
bool PerformInit,
clang::CodeGen::CodeGenFunction* CGF =
nullptr)
Description
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).
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2189
Parameters
- const clang::VarDecl* VD
- Threadprivate variable.
- clang::CodeGen::Address VDAddr
- Address of the global variable \a VD.
- clang::SourceLocation Loc
- Location of threadprivate declaration.
- bool PerformInit
- true if initialization expression is not constant.
- clang::CodeGen::CodeGenFunction* CGF = nullptr
¶clang::CodeGen::Address
getAddrOfArtificialThreadPrivate(
clang::CodeGen::CodeGenFunction& CGF,
clang::QualType VarType,
llvm::StringRef Name)
clang::CodeGen::Address
getAddrOfArtificialThreadPrivate(
clang::CodeGen::CodeGenFunction& CGF,
clang::QualType VarType,
llvm::StringRef Name)
Description
Creates artificial threadprivate variable with name \p Name and type \p VarType.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2197
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::QualType VarType
- Type of the artificial threadprivate variable.
- llvm::StringRef Name
- Name of the artificial threadprivate variable.
¶clang::CodeGen::Address getAddrOfThreadPrivate(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* VD,
clang::CodeGen::Address VDAddr,
clang::SourceLocation Loc)
clang::CodeGen::Address getAddrOfThreadPrivate(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* VD,
clang::CodeGen::Address VDAddr,
clang::SourceLocation Loc)
Description
Returns address of the threadprivate variable for the current thread.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2177
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::VarDecl* VD
- Threadprivate variable.
- clang::CodeGen::Address VDAddr
- Address of the global variable \a VD.
- clang::SourceLocation Loc
- Location of the reference to threadprivate var.
Returns
Address of the threadprivate variable for the current thread.
¶clang::CodeGen::Address getAddressOfLocalVariable(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* VD)
clang::CodeGen::Address getAddressOfLocalVariable(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* VD)
Description
Gets the OpenMP-specific address of the local variable.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2529
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::VarDecl* VD
¶clang::CodeGen::Address getParameterAddress(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* NativeParam,
const clang::VarDecl* TargetParam) const
clang::CodeGen::Address getParameterAddress(
clang::CodeGen::CodeGenFunction& CGF,
const clang::VarDecl* NativeParam,
const clang::VarDecl* TargetParam) const
Description
Gets the address of the native argument basing on the address of the target-specific parameter.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2525
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- const clang::VarDecl* NativeParam
- Parameter itself.
- const clang::VarDecl* TargetParam
- Corresponding target-specific parameter.
¶clang::CodeGen::Address getTaskReductionItem(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
llvm::Value* ReductionsPtr,
clang::CodeGen::LValue SharedLVal)
clang::CodeGen::Address getTaskReductionItem(
clang::CodeGen::CodeGenFunction& CGF,
clang::SourceLocation Loc,
llvm::Value* ReductionsPtr,
clang::CodeGen::LValue SharedLVal)
Description
Get the address of `void *` type of the privatue copy of the reduction item specified by the \p SharedLVal.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2385
Parameters
- clang::CodeGen::CodeGenFunction& CGF
- clang::SourceLocation Loc
- llvm::Value* ReductionsPtr
- Pointer to the reduction data returned by the emitTaskReductionInit function.
- clang::CodeGen::LValue SharedLVal
- Address of the original reduction item.
¶const clang::VarDecl* translateParameter(
const clang::FieldDecl* FD,
const clang::VarDecl* NativeParam) const
const clang::VarDecl* translateParameter(
const clang::FieldDecl* FD,
const clang::VarDecl* NativeParam) const
Description
Translates the native parameter of outlined function if this is required for target.
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:2518
Parameters
- const clang::FieldDecl* FD
- Field decl from captured record for the parameter.
- const clang::VarDecl* NativeParam
- Parameter itself.
¶~CGOpenMPSIMDRuntime()
~CGOpenMPSIMDRuntime()
Declared at: clang/lib/CodeGen/CGOpenMPRuntime.h:1933