clang  3.7.0
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
CGOpenMPRuntime.h File Reference
#include "clang/AST/Type.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/StringMap.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::CGOpenMPRuntime
 
struct  clang::CodeGen::DebugLocThreadIdTy
 Stores debug location and ThreadID for the function. More...
 

Namespaces

 llvm
 
 clang
 
 clang::CodeGen
 

Typedefs

typedef llvm::function_ref
< void(CodeGenFunction &)> 
clang::CodeGen::RegionCodeGenTy
 
typedef llvm::DenseMap
< unsigned, llvm::Value * > 
clang::CodeGen::OpenMPDebugLocMapTy
 Map for SourceLocation and OpenMP runtime library debug locations. More...
 
typedef llvm::DenseMap
< llvm::Function
*, DebugLocThreadIdTy > 
clang::CodeGen::OpenMPLocThreadIDMapTy
 Map of local debug location, ThreadId and functions. More...
 

Enumerations

enum  clang::CodeGen::IdentFieldIndex {
  clang::CodeGen::IdentField_Reserved_1, clang::CodeGen::IdentField_Flags, clang::CodeGen::IdentField_Reserved_2, clang::CodeGen::IdentField_Reserved_3,
  clang::CodeGen::IdentField_PSource
}
 

Functions

void clang::emitKmpRoutineEntryT (QualType KmpInt32Ty)
 Build type kmp_routine_entry_t (if not built yet). More...
 
llvm::Valueclang::emitUpdateLocation (CodeGenFunction &CGF, SourceLocation Loc, OpenMPLocationFlags Flags=OMP_IDENT_KMPC)
 Emits object of ident_t type with info for source location. More...
 
llvm::Type * clang::getIdentTyPointerTy ()
 Returns pointer to ident_t type. More...
 
llvm::Type * clang::getKmpc_MicroPointerTy ()
 Returns pointer to kmpc_micro type. More...
 
llvm::Constant * clang::createRuntimeFunction (OpenMPRTLFunction Function)
 Returns specified OpenMP runtime function. More...
 
llvm::Constant * clang::createForStaticInitFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_for_static_init_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::createDispatchInitFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_init_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::createDispatchNextFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_next_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::createDispatchFiniFunction (unsigned IVSize, bool IVSigned)
 Returns __kmpc_dispatch_fini_* runtime function for the specified size IVSize and sign IVSigned. More...
 
llvm::Constant * clang::getOrCreateThreadPrivateCache (const VarDecl *VD)
 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. More...
 
virtual llvm::Valueclang::emitThreadIDAddress (CodeGenFunction &CGF, SourceLocation Loc)
 Emits address of the word in a memory where current thread id is stored. More...
 
llvm::Valueclang::getThreadID (CodeGenFunction &CGF, SourceLocation Loc)
 Gets thread id value for the current thread. More...
 
llvm::Constant * clang::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. The created variable has linkage CommonLinkage by default and is initialized by null value. More...
 
void clang::emitThreadPrivateVarInit (CodeGenFunction &CGF, llvm::Value *VDAddr, llvm::Value *Ctor, llvm::Value *CopyCtor, llvm::Value *Dtor, SourceLocation Loc)
 Emits initialization code for the threadprivate variables. More...
 
llvm::Valueclang::getCriticalRegionLock (StringRef CriticalName)
 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. More...
 
 clang::CGOpenMPRuntime (CodeGenModule &CGM)
 
virtual clang::~CGOpenMPRuntime ()
 
virtual void clang::clear ()
 
virtual llvm::Valueclang::emitParallelOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 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). More...
 
virtual llvm::Valueclang::emitTaskOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 Emits outlined function for the OpenMP task directive D. This outlined function has type void(*)(kmp_int32 ThreadID, kmp_int32 PartID, struct context_vars*). More...
 
void clang::functionFinished (CodeGenFunction &CGF)
 Cleans up references to the objects in finished function. More...
 
virtual void clang::emitParallelCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, llvm::Value *CapturedStruct, 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::emitCriticalRegion (CodeGenFunction &CGF, StringRef CriticalName, const RegionCodeGenTy &CriticalOpGen, SourceLocation Loc)
 Emits a critical region. More...
 
virtual void clang::emitMasterRegion (CodeGenFunction &CGF, const RegionCodeGenTy &MasterOpGen, SourceLocation Loc)
 Emits a master region. More...
 
virtual void clang::emitTaskyieldCall (CodeGenFunction &CGF, SourceLocation Loc)
 Emits code for a taskyield directive. More...
 
virtual void clang::emitTaskgroupRegion (CodeGenFunction &CGF, const RegionCodeGenTy &TaskgroupOpGen, SourceLocation Loc)
 Emit a taskgroup region. More...
 
virtual void clang::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::emitOrderedRegion (CodeGenFunction &CGF, const RegionCodeGenTy &OrderedOpGen, SourceLocation Loc)
 Emit an ordered region. More...
 
virtual void clang::emitBarrierCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind Kind, bool CheckForCancel=true)
 Emit an implicit/explicit barrier for OpenMP threads. More...
 
virtual bool clang::isStaticNonchunked (OpenMPScheduleClauseKind ScheduleKind, bool Chunked) const
 Check if the specified ScheduleKind is static non-chunked. This kind of worksharing directive is emitted without outer loop. More...
 
virtual bool clang::isDynamic (OpenMPScheduleClauseKind ScheduleKind) const
 Check if the specified ScheduleKind is dynamic. This kind of worksharing directive is emitted without outer loop. More...
 
virtual void clang::emitForInit (CodeGenFunction &CGF, SourceLocation Loc, OpenMPScheduleClauseKind SchedKind, unsigned IVSize, bool IVSigned, bool Ordered, llvm::Value *IL, llvm::Value *LB, llvm::Value *UB, llvm::Value *ST, llvm::Value *Chunk=nullptr)
 Call the appropriate runtime routine to initialize it before start of loop. More...
 
virtual void clang::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::emitForStaticFinish (CodeGenFunction &CGF, SourceLocation Loc)
 Call the appropriate runtime routine to notify that we finished all the work with current loop. More...
 
virtual llvm::Valueclang::emitForNext (CodeGenFunction &CGF, SourceLocation Loc, unsigned IVSize, bool IVSigned, llvm::Value *IL, llvm::Value *LB, llvm::Value *UB, llvm::Value *ST)
 
virtual void clang::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::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 llvm::Valueclang::getAddrOfThreadPrivate (CodeGenFunction &CGF, const VarDecl *VD, llvm::Value *VDAddr, SourceLocation Loc)
 Returns address of the threadprivate variable for the current thread. More...
 
virtual llvm::Function * clang::emitThreadPrivateVarDefinition (const VarDecl *VD, llvm::Value *VDAddr, SourceLocation Loc, bool PerformInit, CodeGenFunction *CGF=nullptr)
 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). More...
 
virtual void clang::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
PrivateVars List of references
to private variables for the
task *directive *param
PrivateCopies List of private
copies for each private
variable in *p PrivateVars
*param FirstprivateVars List
of references to private
variables for the *task
directive *param
FirstprivateCopies List of
private copies for each
private variable *in p
FirstprivateVars *param
FirstprivateInits List of
references to auto generated
variables *used for
initialization of a single
array element Used if
firstprivate *variable is of
array type *param Dependences
List of dependences for the
task including *original
expression and dependency type
*virtual void 
clang::emitTaskCall (CodeGenFunction &CGF, SourceLocation Loc, const OMPExecutableDirective &D, bool Tied, llvm::PointerIntPair< llvm::Value *, 1, bool > Final, llvm::Value *TaskFunction, QualType SharedsTy, llvm::Value *Shareds, const Expr *IfCond, ArrayRef< const Expr * > PrivateVars, ArrayRef< const Expr * > PrivateCopies, ArrayRef< const Expr * > FirstprivateVars, ArrayRef< const Expr * > FirstprivateCopies, ArrayRef< const Expr * > FirstprivateInits, ArrayRef< std::pair< OpenMPDependClauseKind, const Expr * >> Dependences)
 
virtual void clang::emitInlinedDirective (CodeGenFunction &CGF, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 Emit code for the directive that does not require outlining. More...
 
virtual void clang::emitReduction (CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps, bool WithNowait, bool SimpleReduction)
 Emit a code for reduction clause. Next code should be emitted for reduction: More...
 
virtual void clang::emitTaskwaitCall (CodeGenFunction &CGF, SourceLocation Loc)
 Emit code for 'taskwait' directive. More...
 
virtual void clang::emitCancellationPointCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind CancelRegion)
 Emit code for 'cancellation point' construct. More...
 
virtual void clang::emitCancelCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind CancelRegion)
 Emit code for 'cancel' construct. More...
 

Variables

class
clang::CodeGen::CGOpenMPRuntime 
clang::CodeGen::ident_t
 
llvm::StructType * clang::CodeGen::IdentTy
 
OpenMPDebugLocMapTy clang::CodeGen::OpenMPDebugLocMap
 
llvm::FunctionType * clang::CodeGen::Kmpc_MicroTy
 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,...);. More...
 
OpenMPLocThreadIDMapTy clang::CodeGen::OpenMPLocThreadIDMap
 
llvm::ArrayType * clang::CodeGen::KmpCriticalNameTy
 Type kmp_critical_name, originally defined as typedef kmp_int32 kmp_critical_name[8];. More...
 
llvm::StringMap
< llvm::AssertingVH
< llvm::Constant >
, llvm::BumpPtrAllocator > 
clang::CodeGen::InternalVars
 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. More...
 
llvm::Type * clang::CodeGen::KmpRoutineEntryPtrTy
 Type typedef kmp_int32 (* kmp_routine_entry_t)(kmp_int32, void *);. More...
 
QualType clang::CodeGen::KmpRoutineEntryPtrQTy
 
*kmp_routine_entry_t clang::CodeGen::routine
 Type typedef struct kmp_task { void * shareds; /**< pointer to block of pointers to shared vars. More...
 
*kmp_int32 clang::CodeGen::part_id
 
*kmp_routine_entry_t clang::CodeGen::destructors
 
 clang::kmp_task_t
 
*QualType clang::KmpTaskTQTy
 
QualType clang::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...
 
llvm::DenseSet< const VarDecl * > clang::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 IfCond
Not a nullptr if if clause was 
clang::specified
 
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
PrivateVars List of references
to private variables for the
task *directive *param
PrivateCopies List of private
copies for each private
variable in *p PrivateVars
*param FirstprivateVars List
of references to private
variables for the *task
directive *param
FirstprivateCopies List of
private copies for each
private variable *in p
FirstprivateVars *param
FirstprivateInits List of
references to auto generated
variables *used for
initialization of a single
array element Used if
firstprivate *variable is of
array type *param Dependences
List of dependences for the
task 
clang::construct