clang  6.0.0svn
Classes | Namespaces | Functions | Variables
CGOpenMPRuntime.h File Reference
#include "CGValue.h"
#include "clang/AST/Type.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/ValueHandle.h"
Include dependency graph for CGOpenMPRuntime.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::CodeGen::PrePostActionTy
 A basic class for pre|post-action for advanced codegen sequence for OpenMP region. More...
 
class  clang::CodeGen::RegionCodeGenTy
 Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possible pre|post-actions in codegen. More...
 
struct  clang::CodeGen::OMPTaskDataTy
 
class  clang::CodeGen::ReductionCodeGen
 Class intended to support codegen of all kind of the reduction clauses. More...
 
class  clang::CodeGen::CGOpenMPRuntime
 
class  clang::CodeGen::OffloadEntriesInfoManagerTy
 Entity that registers the offloading constants that were emitted so far. More...
 
class  clang::CodeGen::OffloadEntriesInfoManagerTy::OffloadEntryInfo
 Base class of the entries info. More...
 
class  clang::CodeGen::OffloadEntriesInfoManagerTy::OffloadEntryInfoTargetRegion
 Target region entries related. More...
 
struct  clang::CodeGen::TaskResultTy
 
struct  clang::CodeGen::DispatchRTInput
 struct with the values to be passed to the dispatch runtime function More...
 
struct  clang::CodeGen::StaticRTInput
 Struct with the values to be passed to the static runtime function. More...
 
struct  clang::CodeGen::ReductionOptionsTy
 
class  clang::CodeGen::TargetDataInfo
 Struct that keeps all the relevant information that should be kept throughout a 'target data' region. More...
 

Namespaces

 llvm
 DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterators.
 
 clang
 Dataflow Directional Tag Classes.
 
 clang::CodeGen
 

Functions

llvm::Function * clang::CodeGen::createOffloadingBinaryDescriptorRegistration ()
 Creates and registers offloading binary descriptor for the current compilation unit. More...
 
void clang::CodeGen::createOffloadEntriesAndInfoMetadata ()
 Creates all the offload entries in the current compilation unit along with the associated metadata. More...
 
void clang::CodeGen::loadOffloadInfoMetadata ()
 Loads all the offload entries information from the host IR metadata. More...
 
QualType clang::CodeGen::getTgtOffloadEntryQTy ()
 Returns __tgt_offload_entry type. More...
 
QualType clang::CodeGen::getTgtDeviceImageQTy ()
 Returns __tgt_device_image type. More...
 
QualType clang::CodeGen::getTgtBinaryDescriptorQTy ()
 Returns __tgt_bin_desc type. More...
 
void clang::CodeGen::scanForTargetRegionsFunctions (const Stmt *S, StringRef ParentName)
 Start scanning from statement S and and emit all target regions found along the way. More...
 
void clang::CodeGen::emitKmpRoutineEntryT (QualType KmpInt32Ty)
 Build type kmp_routine_entry_t (if not built yet). More...
 
llvm::Type * clang::CodeGen::getKmpc_MicroPointerTy ()
 Returns pointer to kmpc_micro type. More...
 
llvm::Constant * clang::CodeGen::createRuntimeFunction (unsigned Function)
 Returns specified OpenMP runtime function. More...
 
llvm::Constant * clang::CodeGen::createForStaticInitFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_for_static_init_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::CodeGen::createDispatchInitFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_init_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::CodeGen::createDispatchNextFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_next_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::CodeGen::createDispatchFiniFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_fini_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::CodeGen::getOrCreateThreadPrivateCache (const VarDecl *VD)
 If the specified mangled name is not in the module, create and return threadprivate cache object. More...
 
virtual Address clang::CodeGen::emitThreadIDAddress (CodeGenFunction &CGF, SourceLocation Loc)
 Emits address of the word in a memory where current thread id is stored. More...
 
llvm::Constant * clang::CodeGen::getOrCreateInternalVariable (llvm::Type *Ty, const llvm::Twine &Name)
 Gets (if variable with the given name already exist) or creates internal global variable with the specified Name. More...
 
void clang::CodeGen::emitThreadPrivateVarInit (CodeGenFunction &CGF, Address VDAddr, llvm::Value *Ctor, llvm::Value *CopyCtor, llvm::Value *Dtor, SourceLocation Loc)
 Emits initialization code for the threadprivate variables. More...
 
llvm::Valueclang::CodeGen::getCriticalRegionLock (StringRef CriticalName)
 Returns corresponding lock object for the specified critical region name. More...
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final list of privates etc *TaskResultTy clang::CodeGen::emitTaskInit (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, llvm::Value *TaskFunction, QualType SharedsTy, Address Shareds, const OMPTaskDataTy &Data)
 
 clang::CodeGen::CGOpenMPRuntime (CodeGenModule &CGM)
 
virtual clang::CodeGen::~CGOpenMPRuntime ()
 
virtual void clang::CodeGen::clear ()
 
virtual void clang::CodeGen::emitUserDefinedReduction (CodeGenFunction *CGF, const OMPDeclareReductionDecl *D)
 Emit code for the specified user defined reduction construct. More...
 
virtual std::pair< llvm::Function *, llvm::Function * > clang::CodeGen::getUserDefinedReduction (const OMPDeclareReductionDecl *D)
 Get combiner/initializer for the specified user-defined reduction, if any. More...
 
virtual llvm::Valueclang::CodeGen::emitParallelOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 Emits outlined function for the specified OpenMP parallel directive D. More...
 
virtual llvm::Valueclang::CodeGen::emitTeamsOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 Emits outlined function for the specified OpenMP teams directive D. More...
 
virtual llvm::Valueclang::CodeGen::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. More...
 
void clang::CodeGen::functionFinished (CodeGenFunction &CGF)
 Cleans up references to the objects in finished function. More...
 
virtual void clang::CodeGen::emitParallelCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, ArrayRef< llvm::Value *> CapturedVars, const Expr *IfCond)
 Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct. More...
 
virtual void clang::CodeGen::emitCriticalRegion (CodeGenFunction &CGF, StringRef CriticalName, const RegionCodeGenTy &CriticalOpGen, SourceLocation Loc, const Expr *Hint=nullptr)
 Emits a critical region. More...
 
virtual void clang::CodeGen::emitMasterRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MasterOpGen, SourceLocation Loc)
 Emits a master region. More...
 
virtual void clang::CodeGen::emitTaskyieldCall (CodeGenFunction &CGF, SourceLocation Loc)
 Emits code for a taskyield directive. More...
 
virtual void clang::CodeGen::emitTaskgroupRegion (CodeGenFunction &CGF, const RegionCodeGenTy &TaskgroupOpGen, SourceLocation Loc)
 Emit a taskgroup region. More...
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitOrderedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &OrderedOpGen, SourceLocation Loc, bool IsThreads)
 Emit an ordered region. More...
 
virtual void clang::CodeGen::emitBarrierCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind Kind, bool EmitChecks=true, bool ForceSimpleCall=false)
 Emit an implicit/explicit barrier for OpenMP threads. More...
 
virtual bool clang::CodeGen::isStaticNonchunked (OpenMPScheduleClauseKind ScheduleKind, bool Chunked) const
 Check if the specified ScheduleKind is static non-chunked. More...
 
virtual bool clang::CodeGen::isStaticNonchunked (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) const
 Check if the specified ScheduleKind is static non-chunked. More...
 
virtual bool clang::CodeGen::isDynamic (OpenMPScheduleClauseKind ScheduleKind) const
 Check if the specified ScheduleKind is dynamic. More...
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitDistributeStaticInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDistScheduleClauseKind SchedKind, const StaticRTInput &Values)
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitForStaticFinish (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind DKind)
 Call the appropriate runtime routine to notify that we finished all the work with current loop. More...
 
virtual llvm::Valueclang::CodeGen::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);. More...
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitProcBindClause (CodeGenFunction &CGF, OpenMPProcBindClauseKind 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. More...
 
virtual Address clang::CodeGen::getAddrOfThreadPrivate (CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr, SourceLocation Loc)
 Returns address of the threadprivate variable for the current thread. More...
 
virtual llvm::Function * clang::CodeGen::emitThreadPrivateVarDefinition (const VarDecl *VD, Address VDAddr, SourceLocation Loc, bool PerformInit, CodeGenFunction *CGF=nullptr)
 Emit a code for initialization of threadprivate variable. More...
 
virtual Address clang::CodeGen::getAddrOfArtificialThreadPrivate (CodeGenFunction &CGF, QualType VarType, StringRef Name)
 Creates artificial threadprivate variable with name Name and type VarType. More...
 
virtual void clang::CodeGen::emitFlush (CodeGenFunction &CGF, ArrayRef< const Expr *> Vars, SourceLocation Loc)
 Emit flush of the variables specified in 'omp flush' directive. More...
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param IfCond Not a nullptr if if clause was nullptr *otherwise *param Data Additional data for task generation like final list of privates etc *virtual void clang::CodeGen::emitTaskCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, llvm::Value *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data)
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param IfCond Not a nullptr if if clause was nullptr *otherwise *param Data Additional data for task generation like final list of privates etc *virtual void clang::CodeGen::emitTaskLoopCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPLoopDirective &D, llvm::Value *TaskFunction, QualType SharedsTy, Address Shareds, const Expr *IfCond, const OMPTaskDataTy &Data)
 
virtual void clang::CodeGen::emitInlinedDirective (CodeGenFunction &CGF, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, bool HasCancel=false)
 Emit code for the directive that does not require outlining. More...
 
llvm::Valueclang::CodeGen::emitReductionFunction (CodeGenModule &CGM, llvm::Type *ArgsType, ArrayRef< const Expr *> Privates, ArrayRef< const Expr *> LHSExprs, ArrayRef< const Expr *> RHSExprs, ArrayRef< const Expr *> ReductionOps)
 Emits reduction function. More...
 
void clang::CodeGen::emitSingleReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp, const Expr *PrivateRef, const DeclRefExpr *LHS, const DeclRefExpr *RHS)
 Emits single reduction combiner. More...
 
virtual void clang::CodeGen::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. More...
 
virtual llvm::Valueclang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitTaskReductionFixups (CodeGenFunction &CGF, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N)
 Required to resolve existing problems in the runtime. More...
 
virtual Address clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitTaskwaitCall (CodeGenFunction &CGF, SourceLocation Loc)
 Emit code for 'taskwait' directive. More...
 
virtual void clang::CodeGen::emitCancellationPointCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind CancelRegion)
 Emit code for 'cancellation point' construct. More...
 
virtual void clang::CodeGen::emitCancelCall (CodeGenFunction &CGF, SourceLocation Loc, const Expr *IfCond, OpenMPDirectiveKind CancelRegion)
 Emit code for 'cancel' construct. More...
 
virtual void clang::CodeGen::emitTargetOutlinedFunction (const OMPExecutableDirective &D, StringRef ParentName, llvm::Function *&OutlinedFn, llvm::Constant *&OutlinedFnID, bool IsOffloadEntry, const RegionCodeGenTy &CodeGen)
 Emit outilined function for 'target' directive. More...
 
virtual void clang::CodeGen::emitTargetCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, llvm::Value *OutlinedFn, llvm::Value *OutlinedFnID, const Expr *IfCond, const Expr *Device, ArrayRef< llvm::Value *> CapturedVars)
 Emit the target offloading code associated with D. More...
 
virtual bool clang::CodeGen::emitTargetFunctions (GlobalDecl GD)
 Emit the target regions enclosed in GD function definition or the function itself in case it is a valid device function. More...
 
virtual bool clang::CodeGen::emitTargetGlobalVariable (GlobalDecl GD)
 Emit the global variable if it is a valid device global variable. More...
 
virtual bool clang::CodeGen::emitTargetGlobal (GlobalDecl GD)
 Emit the global GD if it is meaningful for the target. More...
 
virtual llvm::Function * clang::CodeGen::emitRegistrationFunction ()
 Creates the offloading descriptor in the event any target region was emitted in the current module and return the function that registers it. More...
 
virtual void clang::CodeGen::emitTeamsCall (CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, llvm::Value *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. More...
 
virtual void clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitTargetDataCalls (CodeGenFunction &CGF, const OMPExecutableDirective &D, const Expr *IfCond, const Expr *Device, const RegionCodeGenTy &CodeGen, TargetDataInfo &Info)
 Emit the target data mapping code associated with D. More...
 
virtual void clang::CodeGen::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]'. More...
 
virtual void clang::CodeGen::emitDeclareSimdFunction (const FunctionDecl *FD, llvm::Function *Fn)
 Marks function Fn with properly mangled versions of vector functions. More...
 
virtual void clang::CodeGen::emitDoacrossInit (CodeGenFunction &CGF, const OMPLoopDirective &D)
 Emit initialization for doacross loop nesting support. More...
 
virtual void clang::CodeGen::emitDoacrossOrdered (CodeGenFunction &CGF, const OMPDependClause *C)
 Emit code for doacross ordered directive with 'depend' clause. More...
 
virtual const VarDecl * clang::CodeGen::translateParameter (const FieldDecl *FD, const VarDecl *NativeParam) const
 Translates the native parameter of outlined function if this is required for target. More...
 
virtual Address clang::CodeGen::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. More...
 
virtual void clang::CodeGen::emitOutlinedFunctionCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, ArrayRef< llvm::Value *> Args=llvm::None) const
 Emits call of the outlined function with the provided arguments, translating these arguments to correct target-specific arguments. More...
 

Variables

class clang::CodeGen::CGOpenMPRuntime clang::CodeGen::kmp_task_t
 
*QualType clang::CodeGen::KmpTaskTQTy
 
QualType clang::CodeGen::SavedKmpTaskTQTy
 Saved kmp_task_t for task directive. More...
 
QualType clang::CodeGen::SavedKmpTaskloopTQTy
 Saved kmp_task_t for taskloop-based directive. More...
 
QualType clang::CodeGen::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;. More...
 
QualType clang::CodeGen::KmpDimTy
 struct kmp_dim { // loop bounds info casted to kmp_int64 kmp_int64 lo; // lower kmp_int64 up; // upper kmp_int64 st; // stride }; More...
 
QualType clang::CodeGen::TgtOffloadEntryQTy
 Type struct __tgt_offload_entry{ void *addr; // Pointer to the offload entry info. More...
 
QualType clang::CodeGen::TgtDeviceImageQTy
 struct __tgt_device_image{ void *ImageStart; // Pointer to the target code start. More...
 
QualType clang::CodeGen::TgtBinaryDescriptorQTy
 struct __tgt_bin_desc{ int32_t NumDevices; // Number of devices supported. More...
 
OffloadEntriesInfoManagerTy clang::CodeGen::OffloadEntriesInfoManager
 
llvm::SmallPtrSet< const VarDecl *, 4 > clang::CodeGen::ThreadPrivateWithDefinition
 Set of threadprivate variables with the generated initializer. More...
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like clang::CodeGen::tiednsee
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * clang::CodeGen::state
 
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param IfCond Not a nullptr if if clause was clang::CodeGen::specified