clang  14.0.0git
Typedefs | Functions
CGStmtOpenMP.cpp File Reference
#include "CGCleanup.h"
#include "CGOpenMPRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/PrettyStackTrace.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/AtomicOrdering.h"
Include dependency graph for CGStmtOpenMP.cpp:

Go to the source code of this file.

Typedefs

using EmittedClosureTy = std::pair< llvm::Function *, llvm::Value * >
 

Functions

static const VarDeclgetBaseDecl (const Expr *Ref)
 
static void emitCommonOMPTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, const RegionCodeGenTy &CodeGen)
 
static Address castValueFromUintptr (CodeGenFunction &CGF, SourceLocation Loc, QualType DstType, StringRef Name, LValue AddrLV)
 
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 checkForLastprivateConditionalUpdate (CodeGenFunction &CGF, const OMPExecutableDirective &S)
 
static void emitCommonOMPParallelDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen, const CodeGenBoundParametersTy &CodeGenBoundParameters)
 
static bool isAllocatableDecl (const VarDecl *VD)
 
static void emitEmptyBoundParameters (CodeGenFunction &, const OMPExecutableDirective &, llvm::SmallVectorImpl< llvm::Value * > &)
 
static void emitBody (CodeGenFunction &CGF, const Stmt *S, const Stmt *NextLoop, int MaxLevel, int Level=0)
 
static EmittedClosureTy emitCapturedStmtFunc (CodeGenFunction &ParentCGF, const CapturedStmt *S)
 Emit a captured statement and return the function as well as its captured closure context. More...
 
static llvm::CallInst * emitCapturedStmtCall (CodeGenFunction &ParentCGF, EmittedClosureTy Cap, llvm::ArrayRef< llvm::Value * > Args)
 Emit a call to a previously captured closure. More...
 
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)
 
static void emitOMPLoopBodyWithStopPoint (CodeGenFunction &CGF, const OMPLoopDirective &S, CodeGenFunction::JumpDest LoopExit)
 
static LValue EmitOMPHelperVar (CodeGenFunction &CGF, const DeclRefExpr *Helper)
 Emit a helper variable and return corresponding lvalue. More...
 
static void emitCommonSimdLoop (CodeGenFunction &CGF, const OMPLoopDirective &S, const RegionCodeGenTy &SimdInitGen, const RegionCodeGenTy &BodyCodeGen)
 
static void emitOMPSimdRegion (CodeGenFunction &CGF, const OMPLoopDirective &S, PrePostActionTy &Action)
 
static void emitEmptyOrdered (CodeGenFunction &, SourceLocation Loc, const unsigned IVSize, const bool IVSigned)
 
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 void emitScanBasedDirectiveDecls (CodeGenFunction &CGF, const OMPLoopDirective &S, llvm::function_ref< llvm::Value *(CodeGenFunction &)> NumIteratorsGen)
 Emits internal temp array declarations for the directive with inscan reductions. More...
 
static void emitScanBasedDirective (CodeGenFunction &CGF, const OMPLoopDirective &S, llvm::function_ref< llvm::Value *(CodeGenFunction &)> NumIteratorsGen, llvm::function_ref< void(CodeGenFunction &)> FirstGen, llvm::function_ref< void(CodeGenFunction &)> SecondGen)
 Emits the code for the directive with inscan reductions. More...
 
static bool emitWorksharingDirective (CodeGenFunction &CGF, const OMPLoopDirective &S, bool HasCancel)
 
static bool isSupportedByOpenMPIRBuilder (const OMPForDirective &S)
 
static LValue createSectionLVal (CodeGenFunction &CGF, QualType Ty, const Twine &Name, llvm::Value *Init=nullptr)
 
static void emitMaster (CodeGenFunction &CGF, const OMPExecutableDirective &S)
 
static void emitMasked (CodeGenFunction &CGF, const OMPExecutableDirective &S)
 
static ImplicitParamDeclcreateImplicitFirstprivateForType (ASTContext &C, OMPTaskDataTy &Data, QualType Ty, CapturedDecl *CD, SourceLocation Loc)
 
static llvm::Function * emitOutlinedOrderedFunction (CodeGenModule &CGM, const CapturedStmt *S, SourceLocation Loc)
 
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, llvm::AtomicOrdering AO, LValue LVal, RValue RVal)
 
static RValue emitSimpleAtomicLoad (CodeGenFunction &CGF, llvm::AtomicOrdering AO, LValue LVal, SourceLocation Loc)
 
static void emitOMPAtomicReadExpr (CodeGenFunction &CGF, llvm::AtomicOrdering AO, const Expr *X, const Expr *V, SourceLocation Loc)
 
static void emitOMPAtomicWriteExpr (CodeGenFunction &CGF, llvm::AtomicOrdering AO, 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, llvm::AtomicOrdering AO, 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, llvm::AtomicOrdering AO, 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, llvm::AtomicOrdering AO, 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 emitTargetTeamsDistributeParallelForRegion (CodeGenFunction &CGF, const OMPTargetTeamsDistributeParallelForDirective &S, PrePostActionTy &Action)
 
static void emitTargetTeamsDistributeParallelForSimdRegion (CodeGenFunction &CGF, const OMPTargetTeamsDistributeParallelForSimdDirective &S, PrePostActionTy &Action)
 
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...
 

Typedef Documentation

◆ EmittedClosureTy

using EmittedClosureTy = std::pair<llvm::Function *, llvm::Value *>

Definition at line 1923 of file CGStmtOpenMP.cpp.

Function Documentation

◆ castValueFromUintptr()

static Address castValueFromUintptr ( CodeGenFunction CGF,
SourceLocation  Loc,
QualType  DstType,
StringRef  Name,
LValue  AddrLV 
)
static

Definition at line 369 of file CGStmtOpenMP.cpp.

Referenced by emitOutlinedFunctionPrologue().

◆ checkForLastprivateConditionalUpdate()

static void checkForLastprivateConditionalUpdate ( CodeGenFunction CGF,
const OMPExecutableDirective S 
)
static

◆ 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

◆ createImplicitFirstprivateForType()

static ImplicitParamDecl* createImplicitFirstprivateForType ( ASTContext C,
OMPTaskDataTy Data,
QualType  Ty,
CapturedDecl CD,
SourceLocation  Loc 
)
static

◆ createSectionLVal()

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

Definition at line 3723 of file CGStmtOpenMP.cpp.

◆ emitAlignedClause()

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

◆ emitBody()

static void emitBody ( CodeGenFunction CGF,
const Stmt S,
const Stmt NextLoop,
int  MaxLevel,
int  Level = 0 
)
static

Definition at line 1816 of file CGStmtOpenMP.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPLoopBody().

◆ emitCapturedStmtCall()

static llvm::CallInst* emitCapturedStmtCall ( CodeGenFunction ParentCGF,
EmittedClosureTy  Cap,
llvm::ArrayRef< llvm::Value * >  Args 
)
static

Emit a call to a previously captured closure.

Definition at line 1941 of file CGStmtOpenMP.cpp.

References clang::CodeGen::CodeGenFunction::Builder.

◆ emitCapturedStmtFunc()

static EmittedClosureTy emitCapturedStmtFunc ( CodeGenFunction ParentCGF,
const CapturedStmt S 
)
static

Emit a captured statement and return the function as well as its captured closure context.

Definition at line 1927 of file CGStmtOpenMP.cpp.

◆ emitCommonOMPParallelDirective()

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

Definition at line 1553 of file CGStmtOpenMP.cpp.

◆ emitCommonOMPTargetDirective()

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

Definition at line 6054 of file CGStmtOpenMP.cpp.

◆ emitCommonOMPTeamsDirective()

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

Definition at line 6170 of file CGStmtOpenMP.cpp.

◆ emitCommonSimdLoop()

static void emitCommonSimdLoop ( CodeGenFunction CGF,
const OMPLoopDirective S,
const RegionCodeGenTy SimdInitGen,
const RegionCodeGenTy BodyCodeGen 
)
static

Definition at line 2452 of file CGStmtOpenMP.cpp.

◆ 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 3383 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 2995 of file CGStmtOpenMP.cpp.

◆ emitDistributeParallelForDistributeInnerBoundParams()

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

Definition at line 3012 of file CGStmtOpenMP.cpp.

◆ emitDistributeParallelForInnerBounds()

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

Definition at line 2952 of file CGStmtOpenMP.cpp.

◆ emitEmptyBoundParameters()

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

Definition at line 1606 of file CGStmtOpenMP.cpp.

◆ emitEmptyOrdered()

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

Definition at line 2888 of file CGStmtOpenMP.cpp.

◆ 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 3369 of file CGStmtOpenMP.cpp.

◆ emitInnerParallelForWhenCombined()

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

Definition at line 3032 of file CGStmtOpenMP.cpp.

◆ emitMasked()

static void emitMasked ( CodeGenFunction CGF,
const OMPExecutableDirective S 
)
static

Definition at line 4064 of file CGStmtOpenMP.cpp.

◆ emitMaster()

static void emitMaster ( CodeGenFunction CGF,
const OMPExecutableDirective S 
)
static

Definition at line 4026 of file CGStmtOpenMP.cpp.

◆ emitOMPAtomicCaptureExpr()

static void emitOMPAtomicCaptureExpr ( CodeGenFunction CGF,
llvm::AtomicOrdering  AO,
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,
llvm::AtomicOrdering  AO,
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,
llvm::AtomicOrdering  AO,
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

◆ emitOMPAtomicUpdateExpr()

static void emitOMPAtomicUpdateExpr ( CodeGenFunction CGF,
llvm::AtomicOrdering  AO,
const Expr X,
const Expr E,
const Expr UE,
bool  IsXLHSInRHSPart,
SourceLocation  Loc 
)
static

◆ emitOMPAtomicWriteExpr()

static void emitOMPAtomicWriteExpr ( CodeGenFunction CGF,
llvm::AtomicOrdering  AO,
const Expr X,
const Expr E,
SourceLocation  Loc 
)
static

◆ EmitOMPHelperVar()

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

Emit a helper variable and return corresponding lvalue.

Definition at line 2445 of file CGStmtOpenMP.cpp.

References clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), and clang::DeclRefExpr::getDecl().

◆ emitOMPLoopBodyWithStopPoint()

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

Definition at line 2437 of file CGStmtOpenMP.cpp.

◆ emitOMPSimdRegion()

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

◆ 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

Definition at line 423 of file CGStmtOpenMP.cpp.

References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), castValueFromUintptr(), clang::CodeGen::CodeGenFunction::CGM, clang::ImplicitParamDecl::Create(), clang::ParmVarDecl::Create(), clang::FunctionDecl::Create(), clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::RecordDecl::fields(), clang::IdentifierTable::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::DeclaratorDecl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CapturedDecl::getBody(), getCanonicalParamType(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CapturedDecl::getContextParamPosition(), clang::ASTContext::getDeclAlign(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::ASTContext::getFunctionType(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntime::getParameterAddress(), clang::CodeGen::Address::getPointer(), clang::VariableArrayType::getSizeExpr(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::CodeGen::Address::getType(), clang::CodeGen::LValue::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::ASTContext::getUIntPtrType(), clang::Decl::hasBody(), clang::ASTContext::Idents, clang::InternalLinkage, clang::CodeGen::Address::invalid(), clang::Type::isAnyPointerType(), clang::Type::isLValueReferenceType(), clang::CapturedDecl::isNothrow(), clang::Type::isPointerType(), clang::Type::isVariablyModifiedType(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ImplicitParamDecl::Other, clang::CapturedDecl::param_begin(), clang::CapturedDecl::param_end(), clang::SC_None, clang::SC_Static, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CGOpenMPRuntime::translateParameter(), and clang::ASTContext::VoidTy.

◆ emitOutlinedOrderedFunction()

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

Definition at line 5359 of file CGStmtOpenMP.cpp.

◆ 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

Definition at line 2274 of file CGStmtOpenMP.cpp.

◆ emitScanBasedDirective()

static void emitScanBasedDirective ( CodeGenFunction CGF,
const OMPLoopDirective S,
llvm::function_ref< llvm::Value *(CodeGenFunction &)>  NumIteratorsGen,
llvm::function_ref< void(CodeGenFunction &)>  FirstGen,
llvm::function_ref< void(CodeGenFunction &)>  SecondGen 
)
static

Emits the code for the directive with inscan reductions.

The code is the following:

#pragma omp ...
for (i: 0..<num_iters>) {
<input phase>;
buffer[i] = red;
}
#pragma omp master // in parallel region
for (int k = 0; k != ceil(log2(num_iters)); ++k)
for (size cnt = last_iter; cnt >= pow(2, k); --k)
buffer[i] op= buffer[i-pow(2,k)];
#pragma omp barrier // in parallel region
#pragma omp ...
for (0..<num_iters>) {
red = InclusiveScan ? buffer[i] : buffer[i-1];
<scan phase>;
}

Definition at line 3466 of file CGStmtOpenMP.cpp.

◆ emitScanBasedDirectiveDecls()

static void emitScanBasedDirectiveDecls ( CodeGenFunction CGF,
const OMPLoopDirective S,
llvm::function_ref< llvm::Value *(CodeGenFunction &)>  NumIteratorsGen 
)
static

Emits internal temp array declarations for the directive with inscan reductions.

The code is the following:

size num_iters = <num_iters>;
<type> buffer[num_iters];

Definition at line 3400 of file CGStmtOpenMP.cpp.

◆ emitSimdlenSafelenClause()

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

◆ emitSimpleAtomicLoad()

static RValue emitSimpleAtomicLoad ( CodeGenFunction CGF,
llvm::AtomicOrdering  AO,
LValue  LVal,
SourceLocation  Loc 
)
static

◆ emitSimpleAtomicStore()

static void emitSimpleAtomicStore ( CodeGenFunction CGF,
llvm::AtomicOrdering  AO,
LValue  LVal,
RValue  RVal 
)
static

◆ emitTargetParallelForRegion()

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

Definition at line 6895 of file CGStmtOpenMP.cpp.

◆ emitTargetParallelForSimdRegion()

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

Definition at line 6936 of file CGStmtOpenMP.cpp.

◆ emitTargetParallelRegion()

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

Definition at line 6848 of file CGStmtOpenMP.cpp.

◆ emitTargetRegion()

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

Definition at line 6135 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeParallelForRegion()

static void emitTargetTeamsDistributeParallelForRegion ( CodeGenFunction CGF,
const OMPTargetTeamsDistributeParallelForDirective S,
PrePostActionTy Action 
)
static

Definition at line 6441 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeParallelForSimdRegion()

static void emitTargetTeamsDistributeParallelForSimdRegion ( CodeGenFunction CGF,
const OMPTargetTeamsDistributeParallelForSimdDirective S,
PrePostActionTy Action 
)
static

Definition at line 6492 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeRegion()

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

Definition at line 6258 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsDistributeSimdRegion()

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

Definition at line 6303 of file CGStmtOpenMP.cpp.

◆ emitTargetTeamsRegion()

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

Definition at line 6213 of file CGStmtOpenMP.cpp.

◆ emitWorksharingDirective()

static bool emitWorksharingDirective ( CodeGenFunction CGF,
const OMPLoopDirective S,
bool  HasCancel 
)
static

Definition at line 3607 of file CGStmtOpenMP.cpp.

◆ getBaseDecl()

static const VarDecl * getBaseDecl ( const Expr Ref)
static

◆ getCanonicalParamType()

static QualType getCanonicalParamType ( ASTContext C,
QualType  T 
)
static

◆ isAllocatableDecl()

static bool isAllocatableDecl ( const VarDecl VD)
static

◆ isSupportedByOpenMPIRBuilder()

static bool isSupportedByOpenMPIRBuilder ( const OMPForDirective S)
static

Definition at line 3651 of file CGStmtOpenMP.cpp.

◆ mapParam()

static void mapParam ( CodeGenFunction CGF,
const DeclRefExpr Helper,
const ImplicitParamDecl PVD,
CodeGenFunction::OMPPrivateScope Privates 
)
static
type
pow
#define pow(__x, __y)
Definition: tgmath.h:490
ceil
#define ceil(__x)
Definition: tgmath.h:601
log2
#define log2(__x)
Definition: tgmath.h:970