clang  6.0.0svn
Functions
CGStmtOpenMP.cpp File Reference
#include "CGCleanup.h"
#include "CGOpenMPRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/DeclOpenMP.h"
#include "llvm/IR/CallSite.h"
Include dependency graph for CGStmtOpenMP.cpp:

Go to the source code of this file.

Functions

static void emitCommonOMPTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, const RegionCodeGenTy &CodeGen)
 
static Address castValueFromUintptr (CodeGenFunction &CGF, QualType DstType, StringRef Name, LValue AddrLV, bool isReferenceType=false)
 
static QualType getCanonicalParamType (ASTContext &C, QualType T)
 
static llvm::Function * emitOutlinedFunctionPrologue (CodeGenFunction &CGF, FunctionArgList &Args, llvm::MapVector< const Decl *, std::pair< const VarDecl *, Address >> &LocalAddrs, llvm::DenseMap< const Decl *, std::pair< const Expr *, llvm::Value *>> &VLASizes, llvm::Value *&CXXThisValue, const FunctionOptions &FO)
 
static void emitPostUpdateForReductionClause (CodeGenFunction &CGF, const OMPExecutableDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> &CondGen)
 
static void emitCommonOMPParallelDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, const CodeGenBoundParametersTy &CodeGenBoundParameters)
 
static void emitEmptyBoundParameters (CodeGenFunction &, const OMPExecutableDirective &, llvm::SmallVectorImpl< llvm::Value *> &)
 
static void emitAlignedClause (CodeGenFunction &CGF, const OMPExecutableDirective &D)
 
static void emitPreCond (CodeGenFunction &CGF, const OMPLoopDirective &S, const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount)
 
static void emitSimdlenSafelenClause (CodeGenFunction &CGF, const OMPExecutableDirective &D, bool IsMonotonic)
 
static void emitOMPLoopBodyWithStopPoint (CodeGenFunction &CGF, const OMPLoopDirective &S, CodeGenFunction::JumpDest LoopExit)
 
static void emitOMPSimdRegion (CodeGenFunction &CGF, const OMPLoopDirective &S, PrePostActionTy &Action)
 
static void emitEmptyOrdered (CodeGenFunction &, SourceLocation Loc, const unsigned IVSize, const bool IVSigned)
 
static LValue EmitOMPHelperVar (CodeGenFunction &CGF, const DeclRefExpr *Helper)
 Emit a helper variable and return corresponding lvalue. More...
 
static std::pair< LValue, LValueemitDistributeParallelForInnerBounds (CodeGenFunction &CGF, const OMPExecutableDirective &S)
 
static std::pair< llvm::Value *, llvm::Value * > emitDistributeParallelForDispatchBounds (CodeGenFunction &CGF, const OMPExecutableDirective &S, Address LB, Address UB)
 if the 'for' loop has a dispatch schedule (e.g. More...
 
static void emitDistributeParallelForDistributeInnerBoundParams (CodeGenFunction &CGF, const OMPExecutableDirective &S, llvm::SmallVectorImpl< llvm::Value *> &CapturedVars)
 
static void emitInnerParallelForWhenCombined (CodeGenFunction &CGF, const OMPLoopDirective &S, CodeGenFunction::JumpDest LoopExit)
 
static std::pair< LValue, LValueemitForLoopBounds (CodeGenFunction &CGF, const OMPExecutableDirective &S)
 The following two functions generate expressions for the loop lower and upper bounds in case of static and dynamic (dispatch) schedule of the associated 'for' or 'distribute' loop. More...
 
static std::pair< llvm::Value *, llvm::Value * > emitDispatchForLoopBounds (CodeGenFunction &CGF, const OMPExecutableDirective &S, Address LB, Address UB)
 When dealing with dispatch schedules (e.g. More...
 
static LValue createSectionLVal (CodeGenFunction &CGF, QualType Ty, const Twine &Name, llvm::Value *Init=nullptr)
 
static llvm::Function * emitOutlinedOrderedFunction (CodeGenModule &CGM, const CapturedStmt *S)
 
static llvm::ValueconvertToScalarValue (CodeGenFunction &CGF, RValue Val, QualType SrcType, QualType DestType, SourceLocation Loc)
 
static CodeGenFunction::ComplexPairTy convertToComplexValue (CodeGenFunction &CGF, RValue Val, QualType SrcType, QualType DestType, SourceLocation Loc)
 
static void emitSimpleAtomicStore (CodeGenFunction &CGF, bool IsSeqCst, LValue LVal, RValue RVal)
 
static void EmitOMPAtomicReadExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *V, SourceLocation Loc)
 
static void EmitOMPAtomicWriteExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *E, SourceLocation Loc)
 
static std::pair< bool, RValueemitOMPAtomicRMW (CodeGenFunction &CGF, LValue X, RValue Update, BinaryOperatorKind BO, llvm::AtomicOrdering AO, bool IsXLHSInRHSPart)
 
static void EmitOMPAtomicUpdateExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc)
 
static RValue convertToType (CodeGenFunction &CGF, RValue Value, QualType SourceType, QualType ResType, SourceLocation Loc)
 
static void EmitOMPAtomicCaptureExpr (CodeGenFunction &CGF, bool IsSeqCst, bool IsPostfixUpdate, const Expr *V, const Expr *X, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc)
 
static void EmitOMPAtomicExpr (CodeGenFunction &CGF, OpenMPClauseKind Kind, bool IsSeqCst, bool IsPostfixUpdate, const Expr *X, const Expr *V, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc)
 
static void emitTargetRegion (CodeGenFunction &CGF, const OMPTargetDirective &S, PrePostActionTy &Action)
 
static void emitCommonOMPTeamsDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen)
 
static void emitTargetTeamsRegion (CodeGenFunction &CGF, PrePostActionTy &Action, const OMPTargetTeamsDirective &S)
 
static void emitTargetTeamsDistributeRegion (CodeGenFunction &CGF, PrePostActionTy &Action, const OMPTargetTeamsDistributeDirective &S)
 
static void emitTargetTeamsDistributeSimdRegion (CodeGenFunction &CGF, PrePostActionTy &Action, const OMPTargetTeamsDistributeSimdDirective &S)
 
static void emitTargetParallelRegion (CodeGenFunction &CGF, const OMPTargetParallelDirective &S, PrePostActionTy &Action)
 
static void emitTargetParallelForRegion (CodeGenFunction &CGF, const OMPTargetParallelForDirective &S, PrePostActionTy &Action)
 
static void emitTargetParallelForSimdRegion (CodeGenFunction &CGF, const OMPTargetParallelForSimdDirective &S, PrePostActionTy &Action)
 
static void mapParam (CodeGenFunction &CGF, const DeclRefExpr *Helper, const ImplicitParamDecl *PVD, CodeGenFunction::OMPPrivateScope &Privates)
 Emit a helper variable and return corresponding lvalue. More...
 

Function Documentation

◆ castValueFromUintptr()

static Address castValueFromUintptr ( CodeGenFunction CGF,
QualType  DstType,
StringRef  Name,
LValue  AddrLV,
bool  isReferenceType = false 
)
static

Definition at line 236 of file CGStmtOpenMP.cpp.

◆ convertToComplexValue()

static CodeGenFunction::ComplexPairTy convertToComplexValue ( CodeGenFunction CGF,
RValue  Val,
QualType  SrcType,
QualType  DestType,
SourceLocation  Loc 
)
static

◆ convertToScalarValue()

static llvm::Value* convertToScalarValue ( CodeGenFunction CGF,
RValue  Val,
QualType  SrcType,
QualType  DestType,
SourceLocation  Loc 
)
static

◆ convertToType()

static RValue convertToType ( CodeGenFunction CGF,
RValue  Value,
QualType  SourceType,
QualType  ResType,
SourceLocation  Loc 
)
static

◆ createSectionLVal()

static LValue createSectionLVal ( CodeGenFunction CGF,
QualType  Ty,
const Twine &  Name,
llvm::Value Init = nullptr 
)
static

Definition at line 2387 of file CGStmtOpenMP.cpp.

◆ emitAlignedClause()

static void emitAlignedClause ( CodeGenFunction CGF,
const OMPExecutableDirective D 
)
static

◆ emitCommonOMPParallelDirective()

static void emitCommonOMPParallelDirective ( CodeGenFunction CGF,
const OMPExecutableDirective S,
OpenMPDirectiveKind  InnermostKind,
const RegionCodeGenTy CodeGen,
const CodeGenBoundParametersTy &  CodeGenBoundParameters 
)
static

◆ emitCommonOMPTargetDirective()

static void emitCommonOMPTargetDirective ( CodeGenFunction CGF,
const OMPExecutableDirective S,
const RegionCodeGenTy CodeGen 
)
static

◆ emitCommonOMPTeamsDirective()

static void emitCommonOMPTeamsDirective ( CodeGenFunction CGF,
const OMPExecutableDirective S,
OpenMPDirectiveKind  InnermostKind,
const RegionCodeGenTy CodeGen 
)
static

◆ emitDispatchForLoopBounds()

static std::pair<llvm::Value *, llvm::Value *> emitDispatchForLoopBounds ( CodeGenFunction CGF,
const OMPExecutableDirective S,
Address  LB,
Address  UB 
)
static

When dealing with dispatch schedules (e.g.

dynamic, guided) we do not consider the lower and upper bound expressions generated by the worksharing loop support, but we use 0 and the iteration space size as constants

Definition at line 2337 of file CGStmtOpenMP.cpp.

◆ emitDistributeParallelForDispatchBounds()

static std::pair<llvm::Value *, llvm::Value *> emitDistributeParallelForDispatchBounds ( CodeGenFunction CGF,
const OMPExecutableDirective S,
Address  LB,
Address  UB 
)
static

if the 'for' loop has a dispatch schedule (e.g.

dynamic, guided) then we need to use the LB and UB expressions generated by the worksharing code generation support, whereas in non combined situations we would just emit 0 and the LastIteration expression This function is necessary due to the difference of the LB and UB types for the RT emission routines for 'for_static_init' and 'for_dispatch_init'

Definition at line 1984 of file CGStmtOpenMP.cpp.

◆ emitDistributeParallelForDistributeInnerBoundParams()

static void emitDistributeParallelForDistributeInnerBoundParams ( CodeGenFunction CGF,
const OMPExecutableDirective S,
llvm::SmallVectorImpl< llvm::Value *> &  CapturedVars 
)
static

Definition at line 2001 of file CGStmtOpenMP.cpp.

◆ emitDistributeParallelForInnerBounds()

static std::pair<LValue, LValue> emitDistributeParallelForInnerBounds ( CodeGenFunction CGF,
const OMPExecutableDirective S 
)
static

Definition at line 1945 of file CGStmtOpenMP.cpp.

◆ emitEmptyBoundParameters()

static void emitEmptyBoundParameters ( CodeGenFunction ,
const OMPExecutableDirective ,
llvm::SmallVectorImpl< llvm::Value *> &   
)
static

Definition at line 1189 of file CGStmtOpenMP.cpp.

◆ emitEmptyOrdered()

static void emitEmptyOrdered ( CodeGenFunction ,
SourceLocation  Loc,
const unsigned  IVSize,
const bool  IVSigned 
)
static

◆ emitForLoopBounds()

static std::pair<LValue, LValue> emitForLoopBounds ( CodeGenFunction CGF,
const OMPExecutableDirective S 
)
static

The following two functions generate expressions for the loop lower and upper bounds in case of static and dynamic (dispatch) schedule of the associated 'for' or 'distribute' loop.

Definition at line 2323 of file CGStmtOpenMP.cpp.

◆ emitInnerParallelForWhenCombined()

static void emitInnerParallelForWhenCombined ( CodeGenFunction CGF,
const OMPLoopDirective S,
CodeGenFunction::JumpDest  LoopExit 
)
static

Definition at line 2019 of file CGStmtOpenMP.cpp.

◆ EmitOMPAtomicCaptureExpr()

static void EmitOMPAtomicCaptureExpr ( CodeGenFunction CGF,
bool  IsSeqCst,
bool  IsPostfixUpdate,
const Expr V,
const Expr X,
const Expr E,
const Expr UE,
bool  IsXLHSInRHSPart,
SourceLocation  Loc 
)
static

◆ EmitOMPAtomicExpr()

static void EmitOMPAtomicExpr ( CodeGenFunction CGF,
OpenMPClauseKind  Kind,
bool  IsSeqCst,
bool  IsPostfixUpdate,
const Expr X,
const Expr V,
const Expr E,
const Expr UE,
bool  IsXLHSInRHSPart,
SourceLocation  Loc 
)
static

◆ EmitOMPAtomicReadExpr()

static void EmitOMPAtomicReadExpr ( CodeGenFunction CGF,
bool  IsSeqCst,
const Expr X,
const Expr V,
SourceLocation  Loc 
)
static

◆ emitOMPAtomicRMW()

static std::pair<bool, RValue> emitOMPAtomicRMW ( CodeGenFunction CGF,
LValue  X,
RValue  Update,
BinaryOperatorKind  BO,
llvm::AtomicOrdering  AO,
bool  IsXLHSInRHSPart 
)
static

Definition at line 3342 of file CGStmtOpenMP.cpp.

◆ EmitOMPAtomicUpdateExpr()

static void EmitOMPAtomicUpdateExpr ( CodeGenFunction CGF,
bool  IsSeqCst,
const Expr X,
const Expr E,
const Expr UE,
bool  IsXLHSInRHSPart,
SourceLocation  Loc 
)
static

◆ EmitOMPAtomicWriteExpr()

static void EmitOMPAtomicWriteExpr ( CodeGenFunction CGF,
bool  IsSeqCst,
const Expr X,
const Expr E,
SourceLocation  Loc 
)
static

Definition at line 3328 of file CGStmtOpenMP.cpp.

Referenced by EmitOMPAtomicExpr().

◆ EmitOMPHelperVar()

static LValue EmitOMPHelperVar ( CodeGenFunction CGF,
const DeclRefExpr Helper 
)
static

◆ emitOMPLoopBodyWithStopPoint()

static void emitOMPLoopBodyWithStopPoint ( CodeGenFunction CGF,
const OMPLoopDirective S,
CodeGenFunction::JumpDest  LoopExit 
)
static

◆ emitOMPSimdRegion()

static void emitOMPSimdRegion ( CodeGenFunction CGF,
const OMPLoopDirective S,
PrePostActionTy Action 
)
static

Definition at line 1573 of file CGStmtOpenMP.cpp.

◆ emitOutlinedFunctionPrologue()

static llvm::Function* emitOutlinedFunctionPrologue ( CodeGenFunction CGF,
FunctionArgList Args,
llvm::MapVector< const Decl *, std::pair< const VarDecl *, Address >> &  LocalAddrs,
llvm::DenseMap< const Decl *, std::pair< const Expr *, llvm::Value *>> &  VLASizes,
llvm::Value *&  CXXThisValue,
const FunctionOptions &  FO 
)
static

◆ emitOutlinedOrderedFunction()

static llvm::Function* emitOutlinedOrderedFunction ( CodeGenModule CGM,
const CapturedStmt S 
)
static

◆ emitPostUpdateForReductionClause()

static void emitPostUpdateForReductionClause ( CodeGenFunction CGF,
const OMPExecutableDirective D,
const llvm::function_ref< llvm::Value *(CodeGenFunction &)> &  CondGen 
)
static

◆ emitPreCond()

static void emitPreCond ( CodeGenFunction CGF,
const OMPLoopDirective S,
const Expr Cond,
llvm::BasicBlock *  TrueBlock,
llvm::BasicBlock *  FalseBlock,
uint64_t  TrueCount 
)
static

◆ emitSimdlenSafelenClause()

static void emitSimdlenSafelenClause ( CodeGenFunction CGF,
const OMPExecutableDirective D,
bool  IsMonotonic 
)
static

◆ emitSimpleAtomicStore()

static void emitSimpleAtomicStore ( CodeGenFunction CGF,
bool  IsSeqCst,
LValue  LVal,
RValue  RVal 
)
static

◆ emitTargetParallelForRegion()

static void emitTargetParallelForRegion ( CodeGenFunction CGF,
const OMPTargetParallelForDirective S,
PrePostActionTy Action 
)
static

Definition at line 4336 of file CGStmtOpenMP.cpp.

◆ emitTargetParallelForSimdRegion()

static void emitTargetParallelForSimdRegion ( CodeGenFunction CGF,
const OMPTargetParallelForSimdDirective S,
PrePostActionTy Action 
)
static

Definition at line 4376 of file CGStmtOpenMP.cpp.

◆ emitTargetParallelRegion()

static void emitTargetParallelRegion ( CodeGenFunction CGF,
const OMPTargetParallelDirective S,
PrePostActionTy Action 
)
static

Definition at line 4292 of file CGStmtOpenMP.cpp.

◆ emitTargetRegion()

static void emitTargetRegion ( CodeGenFunction CGF,
const OMPTargetDirective S,
PrePostActionTy Action 
)
static

Definition at line 3761 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeRegion()

static void emitTargetTeamsDistributeRegion ( CodeGenFunction CGF,
PrePostActionTy Action,
const OMPTargetTeamsDistributeDirective S 
)
static

Definition at line 3877 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeSimdRegion()

static void emitTargetTeamsDistributeSimdRegion ( CodeGenFunction CGF,
PrePostActionTy Action,
const OMPTargetTeamsDistributeSimdDirective S 
)
static

Definition at line 3921 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsRegion()

static void emitTargetTeamsRegion ( CodeGenFunction CGF,
PrePostActionTy Action,
const OMPTargetTeamsDirective S 
)
static

Definition at line 3834 of file CGStmtOpenMP.cpp.

◆ getCanonicalParamType()

static QualType getCanonicalParamType ( ASTContext C,
QualType  T 
)
static

◆ mapParam()

static void mapParam ( CodeGenFunction CGF,
const DeclRefExpr Helper,
const ImplicitParamDecl PVD,
CodeGenFunction::OMPPrivateScope Privates 
)
static