clang
10.0.0git
|
#include "CGOpenMPRuntime.h"
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/BitmaskEnum.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
Go to the source code of this file.
Classes | |
class | CleanupTy |
A basic class for pre|post-action for advanced codegen sequence for OpenMP region. More... | |
Functions | |
static const OMPDeclareReductionDecl * | getReductionInit (const Expr *ReductionOp) |
Check if the combiner is a call to UDR combiner and if it is so return the UDR decl used for reduction. More... | |
static void | emitInitWithReductionInitializer (CodeGenFunction &CGF, const OMPDeclareReductionDecl *DRD, const Expr *InitOp, Address Private, Address Original, QualType Ty) |
static void | EmitOMPAggregateInit (CodeGenFunction &CGF, Address DestAddr, QualType Type, bool EmitDeclareReductionInit, const Expr *Init, const OMPDeclareReductionDecl *DRD, Address SrcAddr=Address::invalid()) |
Emit initialization of arrays of complex types. More... | |
static LValue | loadToBegin (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, LValue BaseLV) |
static Address | castToBase (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, llvm::Type *BaseLVType, CharUnits BaseLVAlignment, llvm::Value *Addr) |
static const VarDecl * | getBaseDecl (const Expr *Ref, const DeclRefExpr *&DE) |
static FieldDecl * | addFieldToRecordDecl (ASTContext &C, DeclContext *DC, QualType FieldTy) |
static llvm::Function * | emitCombinerOrInitializer (CodeGenModule &CGM, QualType Ty, const Expr *CombinerInitializer, const VarDecl *In, const VarDecl *Out, bool IsCombiner) |
static llvm::Function * | emitParallelOrTeamsOutlinedFunction (CodeGenModule &CGM, const OMPExecutableDirective &D, const CapturedStmt *CS, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const StringRef OutlinedHelperName, const RegionCodeGenTy &CodeGen) |
static void | buildStructValue (ConstantStructBuilder &Fields, CodeGenModule &CGM, const RecordDecl *RD, const CGRecordLayout &RL, ArrayRef< llvm::Constant *> Data) |
template<class... As> | |
static llvm::GlobalVariable * | createGlobalStruct (CodeGenModule &CGM, QualType Ty, bool IsConstant, ArrayRef< llvm::Constant *> Data, const Twine &Name, As &&... Args) |
template<typename T > | |
static void | createConstantGlobalStructAndAddToParent (CodeGenModule &CGM, QualType Ty, ArrayRef< llvm::Constant *> Data, T &Parent) |
static void | getTargetEntryUniqueInfo (ASTContext &C, SourceLocation Loc, unsigned &DeviceID, unsigned &FileID, unsigned &LineNum) |
Obtain information that uniquely identifies a target entry. More... | |
static Address | emitAddrOfVarFromArray (CodeGenFunction &CGF, Address Array, unsigned Index, const VarDecl *Var) |
Given an array of pointers to variables, project the address of a given variable. More... | |
static llvm::Value * | emitCopyprivateCopyFunction (CodeGenModule &CGM, llvm::Type *ArgsType, ArrayRef< const Expr *> CopyprivateVars, ArrayRef< const Expr *> DestExprs, ArrayRef< const Expr *> SrcExprs, ArrayRef< const Expr *> AssignmentOps, SourceLocation Loc) |
static OpenMPSchedType | getRuntimeSchedule (OpenMPScheduleClauseKind ScheduleKind, bool Chunked, bool Ordered) |
Map the OpenMP loop schedule to the runtime enumeration. More... | |
static OpenMPSchedType | getRuntimeSchedule (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) |
Map the OpenMP distribute schedule to the runtime enumeration. More... | |
static int | addMonoNonMonoModifier (CodeGenModule &CGM, OpenMPSchedType Schedule, OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2) |
static void | emitForStaticInitCall (CodeGenFunction &CGF, llvm::Value *UpdateLocation, llvm::Value *ThreadId, llvm::FunctionCallee ForStaticInitFunction, OpenMPSchedType Schedule, OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, const CGOpenMPRuntime::StaticRTInput &Values) |
static RecordDecl * | createPrivatesRecordDecl (CodeGenModule &CGM, ArrayRef< PrivateDataTy > Privates) |
static RecordDecl * | createKmpTaskTRecordDecl (CodeGenModule &CGM, OpenMPDirectiveKind Kind, QualType KmpInt32Ty, QualType KmpRoutineEntryPointerQTy) |
static RecordDecl * | createKmpTaskTWithPrivatesRecordDecl (CodeGenModule &CGM, QualType KmpTaskTQTy, ArrayRef< PrivateDataTy > Privates) |
static llvm::Function * | emitProxyTaskFunction (CodeGenModule &CGM, SourceLocation Loc, OpenMPDirectiveKind Kind, QualType KmpInt32Ty, QualType KmpTaskTWithPrivatesPtrQTy, QualType KmpTaskTWithPrivatesQTy, QualType KmpTaskTQTy, QualType SharedsPtrTy, llvm::Function *TaskFunction, llvm::Value *TaskPrivatesMap) |
Emit a proxy function which accepts kmp_task_t as the second argument. More... | |
static llvm::Value * | emitDestructorsFunction (CodeGenModule &CGM, SourceLocation Loc, QualType KmpInt32Ty, QualType KmpTaskTWithPrivatesPtrQTy, QualType KmpTaskTWithPrivatesQTy) |
static llvm::Value * | emitTaskPrivateMappingFunction (CodeGenModule &CGM, SourceLocation Loc, ArrayRef< const Expr *> PrivateVars, ArrayRef< const Expr *> FirstprivateVars, ArrayRef< const Expr *> LastprivateVars, QualType PrivatesQTy, ArrayRef< PrivateDataTy > Privates) |
Emit a privates mapping function for correct handling of private and firstprivate variables. More... | |
static void | emitPrivatesInit (CodeGenFunction &CGF, const OMPExecutableDirective &D, Address KmpTaskSharedsPtr, LValue TDBase, const RecordDecl *KmpTaskTWithPrivatesQTyRD, QualType SharedsTy, QualType SharedsPtrTy, const OMPTaskDataTy &Data, ArrayRef< PrivateDataTy > Privates, bool ForDup) |
Emit initialization for private variables in task-based directives. More... | |
static bool | checkInitIsRequired (CodeGenFunction &CGF, ArrayRef< PrivateDataTy > Privates) |
Check if duplication function is required for taskloops. More... | |
static llvm::Value * | emitTaskDupFunction (CodeGenModule &CGM, SourceLocation Loc, const OMPExecutableDirective &D, QualType KmpTaskTWithPrivatesPtrQTy, const RecordDecl *KmpTaskTWithPrivatesQTyRD, const RecordDecl *KmpTaskTQTyRD, QualType SharedsTy, QualType SharedsPtrTy, const OMPTaskDataTy &Data, ArrayRef< PrivateDataTy > Privates, bool WithLastIter) |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag) More... | |
static bool | checkDestructorsRequired (const RecordDecl *KmpTaskTWithPrivatesQTyRD) |
Checks if destructor function is required to be generated. More... | |
static void | EmitOMPAggregateReduction (CodeGenFunction &CGF, QualType Type, const VarDecl *LHSVar, const VarDecl *RHSVar, const llvm::function_ref< void(CodeGenFunction &CGF, const Expr *, const Expr *, const Expr *)> &RedOpGen, const Expr *XExpr=nullptr, const Expr *EExpr=nullptr, const Expr *UpExpr=nullptr) |
Emit reduction operation for each element of array (required for array sections) LHS op = RHS. More... | |
static void | emitReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp) |
Emit reduction combiner. More... | |
static std::string | generateUniqueName (CodeGenModule &CGM, StringRef Prefix, const Expr *Ref) |
Generates unique name for artificial threadprivate variables. More... | |
static llvm::Value * | emitReduceInitFunction (CodeGenModule &CGM, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) |
Emits reduction initializer function: More... | |
static llvm::Value * | emitReduceCombFunction (CodeGenModule &CGM, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N, const Expr *ReductionOp, const Expr *LHS, const Expr *RHS, const Expr *PrivateRef) |
Emits reduction combiner function: More... | |
static llvm::Value * | emitReduceFiniFunction (CodeGenModule &CGM, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) |
Emits reduction finalizer function: More... | |
static RTCancelKind | getCancellationKind (OpenMPDirectiveKind CancelRegion) |
static bool | isTrivial (ASTContext &Ctx, const Expr *E) |
Checks if the expression is constant or does not have non-trivial function calls. More... | |
static llvm::Value * | emitNumTeamsForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
Emit the number of teams for a target directive. More... | |
static llvm::Value * | getNumThreads (CodeGenFunction &CGF, const CapturedStmt *CS, llvm::Value *DefaultThreadLimitVal) |
static llvm::Value * | emitNumThreadsForTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
Emit the number of threads for a target directive. More... | |
static void | emitOffloadingArrays (CodeGenFunction &CGF, MappableExprsHandler::MapBaseValuesArrayTy &BasePointers, MappableExprsHandler::MapValuesArrayTy &Pointers, MappableExprsHandler::MapValuesArrayTy &Sizes, MappableExprsHandler::MapFlagsArrayTy &MapTypes, CGOpenMPRuntime::TargetDataInfo &Info) |
Emit the arrays used to pass the captures and map information to the offloading runtime library. More... | |
static void | emitOffloadingArraysArgument (CodeGenFunction &CGF, llvm::Value *&BasePointersArrayArg, llvm::Value *&PointersArrayArg, llvm::Value *&SizesArrayArg, llvm::Value *&MapTypesArrayArg, CGOpenMPRuntime::TargetDataInfo &Info) |
Emit the arguments to be passed to the runtime library based on the arrays of pointers, sizes and map types. More... | |
static const OMPExecutableDirective * | getNestedDistributeDirective (ASTContext &Ctx, const OMPExecutableDirective &D) |
Check for inner distribute directive. More... | |
static unsigned | evaluateCDTSize (const FunctionDecl *FD, ArrayRef< ParamAttrTy > ParamAttrs) |
static void | emitX86DeclareSimdFunction (const FunctionDecl *FD, llvm::Function *Fn, const llvm::APSInt &VLENVal, ArrayRef< ParamAttrTy > ParamAttrs, OMPDeclareSimdDeclAttr::BranchStateTy State) |
static bool | getAArch64MTV (QualType QT, ParamKindTy Kind) |
Maps To Vector (MTV), as defined in 3.1.1 of the AAVFABI. More... | |
static bool | getAArch64PBV (QualType QT, ASTContext &C) |
Pass By Value (PBV), as defined in 3.1.2 of the AAVFABI. More... | |
static unsigned | getAArch64LS (QualType QT, ParamKindTy Kind, ASTContext &C) |
Computes the lane size (LS) of a return type or of an input parameter, as defined by LS(P) in 3.2.1 of the AAVFABI. More... | |
static std::tuple< unsigned, unsigned, bool > | getNDSWDS (const FunctionDecl *FD, ArrayRef< ParamAttrTy > ParamAttrs) |
static std::string | mangleVectorParameters (ArrayRef< ParamAttrTy > ParamAttrs) |
Mangle the parameter part of the vector function name according to their OpenMP classification. More... | |
template<typename T > | |
static void | addAArch64VectorName (T VLEN, StringRef LMask, StringRef Prefix, char ISA, StringRef ParSeq, StringRef MangledName, bool OutputBecomesInput, llvm::Function *Fn) |
static void | addAArch64AdvSIMDNDSNames (unsigned NDS, StringRef Mask, StringRef Prefix, char ISA, StringRef ParSeq, StringRef MangledName, bool OutputBecomesInput, llvm::Function *Fn) |
static void | emitAArch64DeclareSimdFunction (CodeGenModule &CGM, const FunctionDecl *FD, unsigned UserVLEN, ArrayRef< ParamAttrTy > ParamAttrs, OMPDeclareSimdDeclAttr::BranchStateTy State, StringRef MangledName, char ISA, unsigned VecRegSize, llvm::Function *Fn, SourceLocation SLoc) |
Emit vector function attributes for AArch64, as defined in the AAVFABI. More... | |
template<OpenMPContextSelectorSetKind CtxSet, OpenMPContextSelectorKind Ctx, typename... Arguments> | |
static bool | checkContext (const OMPContextSelectorData &Data, Arguments... Params) |
Checks current context and returns true if it matches the context selector. More... | |
template<> | |
bool | checkContext< OMP_CTX_SET_implementation, OMP_CTX_vendor > (const OMPContextSelectorData &Data) |
Checks for implementation={vendor(<vendor>)} context selector. More... | |
template<> | |
bool | checkContext< OMP_CTX_SET_device, OMP_CTX_kind, CodeGenModule & > (const OMPContextSelectorData &Data, CodeGenModule &CGM) |
Checks for device={kind(<kind>)} context selector. More... | |
static bool | matchesContext (CodeGenModule &CGM, const CompleteOMPContextSelectorData &ContextData) |
static CompleteOMPContextSelectorData | translateAttrToContextSelectorData (ASTContext &C, const OMPDeclareVariantAttr *A) |
static bool | isStrictSubset (const CompleteOMPContextSelectorData &LHS, const CompleteOMPContextSelectorData &RHS) |
static bool | greaterCtxScore (const CompleteOMPContextSelectorData &LHS, const CompleteOMPContextSelectorData &RHS) |
static const FunctionDecl * | getDeclareVariantFunction (CodeGenModule &CGM, const FunctionDecl *FD) |
Finds the variant function that matches current context with its context selector. More... | |
Variables | |
ident_t | |
enum IdentFieldIndex |
Definition at line 518 of file CGOpenMPRuntime.cpp.
enum KmpTaskTFields |
Indexes of fields for type kmp_task_t.
Definition at line 3884 of file CGOpenMPRuntime.cpp.
enum OpenMPLocationFlags : unsigned |
Values for bit flags used in the ident_t to describe the fields.
All enumeric elements are named and described in accordance with the code from https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h
Definition at line 440 of file CGOpenMPRuntime.cpp.
enum OpenMPOffloadingRequiresDirFlags : int64_t |
Values for bit flags for marking which requires clauses have been used.
Definition at line 469 of file CGOpenMPRuntime.cpp.
Definition at line 485 of file CGOpenMPRuntime.cpp.
enum OpenMPRTLFunction |
Definition at line 565 of file CGOpenMPRuntime.cpp.
enum OpenMPSchedType |
Schedule types for 'omp for' loops (these enumerators are taken from the enum sched_type in kmp.h).
Definition at line 535 of file CGOpenMPRuntime.cpp.
enum ParamKindTy |
Kind of parameter in a function with 'declare simd' directive.
Definition at line 10230 of file CGOpenMPRuntime.cpp.
enum RTCancelKind |
Definition at line 6344 of file CGOpenMPRuntime.cpp.
|
static |
Definition at line 10523 of file CGOpenMPRuntime.cpp.
References addAArch64VectorName().
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Definition at line 10508 of file CGOpenMPRuntime.cpp.
Referenced by addAArch64AdvSIMDNDSNames(), and emitAArch64DeclareSimdFunction().
|
static |
Definition at line 1232 of file CGOpenMPRuntime.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::FieldDecl::Create(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::ICIS_NoInit.
Referenced by clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), createPrivatesRecordDecl(), clang::CodeGen::emitDeclareSimdFunction(), emitReduceFiniFunction(), clang::CodeGen::emitTaskInit(), and clang::CodeGen::getTgtOffloadEntryQTy().
|
static |
Definition at line 3625 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::DispatchRTInput::Chunk, clang::CodeGen::createDispatchInitFunction(), clang::CodeGen::emitForDispatchInit(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CodeGenModule::getLangOpts(), getRuntimeSchedule(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::DispatchRTInput::LB, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, Modifier, OMP_dist_sch_static, OMP_dist_sch_static_chunked, OMP_ord_static, OMP_ord_static_chunked, OMP_sch_modifier_monotonic, OMP_sch_modifier_nonmonotonic, OMP_sch_static, OMP_sch_static_balanced_chunked, OMP_sch_static_chunked, clang::OMPC_SCHEDULE_MODIFIER_last, clang::OMPC_SCHEDULE_MODIFIER_unknown, clang::OpenMPScheduleTy::Schedule, and clang::CodeGen::DispatchRTInput::UB.
Referenced by emitForStaticInitCall().
|
static |
Definition at line 1575 of file CGOpenMPRuntime.cpp.
References clang::RecordDecl::fields(), clang::CodeGen::CGRecordLayout::getLLVMFieldNo(), and clang::CodeGen::CGRecordLayout::getLLVMType().
Referenced by createConstantGlobalStructAndAddToParent().
|
static |
Definition at line 1126 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CodeGen::Address::getPointer(), clang::ASTContext::hasSameType(), clang::CodeGen::Address::invalid(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::CodeGen::Address::isValid(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress().
|
static |
Checks current context and returns true if it matches the context selector.
Definition at line 11026 of file CGOpenMPRuntime.cpp.
References clang::OMP_CTX_SET_unknown, and clang::OMP_CTX_unknown.
bool checkContext< OMP_CTX_SET_device, OMP_CTX_kind, CodeGenModule &> | ( | const OMPContextSelectorData & | Data, |
CodeGenModule & | CGM | ||
) |
Checks for device={kind(<kind>)} context selector.
Definition at line 11049 of file CGOpenMPRuntime.cpp.
bool checkContext< OMP_CTX_SET_implementation, OMP_CTX_vendor > | ( | const OMPContextSelectorData & | Data | ) |
Checks for implementation={vendor(<vendor>)} context selector.
Definition at line 11036 of file CGOpenMPRuntime.cpp.
Referenced by matchesContext().
|
static |
Checks if destructor function is required to be generated.
Definition at line 4929 of file CGOpenMPRuntime.cpp.
References clang::RecordDecl::field_begin().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Check if duplication function is required for taskloops.
Definition at line 4832 of file CGOpenMPRuntime.cpp.
References clang::VarDecl::getAnyInitializer(), and clang::CodeGen::CodeGenFunction::isTrivialInitializer().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 1610 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::beginStruct(), buildStructValue(), clang::CodeGen::CGOpenMPRuntime::CGM, createGlobalStruct(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndAddTo(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCString(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CGOpenMPRuntime::getDefaultLocationReserved2Flags(), clang::CodeGen::ConstantAddress::getPointer(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::CGOpenMPRuntime::isDefaultLocationConstant().
|
static |
Definition at line 1595 of file CGOpenMPRuntime.cpp.
Referenced by createConstantGlobalStructAndAddToParent(), and clang::CodeGen::CGOpenMPRuntime::createOffloadEntry().
|
static |
Definition at line 4399 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::ASTContext::getRecordType(), clang::isOpenMPTaskLoopDirective(), clang::TagDecl::startDefinition(), clang::TTK_Union, and clang::ASTContext::VoidPtrTy.
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 4445 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::RecordDecl::completeDefinition(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getRecordType(), and clang::TagDecl::startDefinition().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 4373 of file CGOpenMPRuntime.cpp.
References clang::Decl::addAttr(), addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::RecordDecl::completeDefinition(), clang::Decl::getAttrs(), clang::CodeGen::CodeGenModule::getContext(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Decl::hasAttrs(), and clang::TagDecl::startDefinition().
Referenced by createKmpTaskTWithPrivatesRecordDecl().
|
static |
Emit vector function attributes for AArch64, as defined in the AAVFABI.
Definition at line 10558 of file CGOpenMPRuntime.cpp.
References addAArch64AdvSIMDNDSNames(), addAArch64VectorName(), clang::DiagnosticsEngine::getCustomDiagID(), clang::CodeGen::CodeGenModule::getDiags(), getNDSWDS(), mangleVectorParameters(), clang::DiagnosticsEngine::Report(), and clang::DiagnosticsEngine::Warning.
Referenced by clang::CodeGen::emitDeclareSimdFunction().
|
static |
Given an array of pointers to variables, project the address of a given variable.
Definition at line 3314 of file CGOpenMPRuntime.cpp.
|
static |
Definition at line 1350 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::Decl::getLocation(), clang::ASTContext::getPointerType(), clang::CodeGen::CodeGenModule::getTypes(), clang::ImplicitParamDecl::Other, clang::ASTContext::VoidTy, and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitUserDefinedReduction().
|
static |
Definition at line 3326 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Create(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::ImplicitParamDecl::Other, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
|
static |
Definition at line 4576 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::Create(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 3709 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::ASTContext::BoolTy, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::StaticRTInput::Chunk, clang::CodeGen::createDispatchFiniFunction(), clang::CodeGen::createDispatchNextFunction(), clang::CodeGen::createForStaticInitFunction(), clang::CodeGen::createRuntimeFunction(), clang::CodeGen::emitDistributeStaticInit(), clang::CodeGen::emitFlush(), clang::CodeGen::emitForNext(), clang::CodeGen::emitForOrderedIterationEnd(), clang::CodeGen::emitForStaticFinish(), clang::CodeGen::emitForStaticInit(), clang::CodeGen::emitNumThreadsClause(), clang::CodeGen::emitProcBindClause(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::Address::getPointer(), getRuntimeSchedule(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::IntTy, clang::isOpenMPDistributeDirective(), clang::isOpenMPLoopDirective(), clang::isOpenMPWorksharingDirective(), clang::CodeGen::StaticRTInput::IVSigned, clang::CodeGen::StaticRTInput::IVSize, clang::OpenMPScheduleTy::M1, clang::OpenMPScheduleTy::M2, OMP_dist_sch_static, OMP_dist_sch_static_chunked, OMP_ord_static, OMP_ord_static_chunked, OMP_sch_static, OMP_sch_static_balanced_chunked, OMP_sch_static_chunked, clang::OMPC_SCHEDULE_MODIFIER_unknown, OMPRTL__kmpc_flush, OMPRTL__kmpc_for_static_fini, OMPRTL__kmpc_push_num_threads, OMPRTL__kmpc_push_proc_bind, clang::CodeGen::StaticRTInput::Ordered, and clang::OpenMPScheduleTy::Schedule.
|
static |
Definition at line 804 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenModule::EmitNullConstant(), clang::CodeGen::RValue::get(), clang::OMPDeclareReductionDecl::getInitializer(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and clang::Expr::IgnoreParenImpCasts().
Referenced by clang::CodeGen::ReductionCodeGen::emitInitialization(), and EmitOMPAggregateInit().
|
static |
Emit the number of teams for a target directive.
Inspect the num_teams clause associated with a teams construct combined or closely nested with the target directive.
Emit a team of size one for directives such as 'target parallel' that have no associated teams construct.
Otherwise, return nullptr.
Definition at line 6586 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::OMPExecutableDirective::getSingleClause(), clang::CodeGen::getSingleCompoundChild(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::Stmt::IgnoreContainers(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), and clang::isOpenMPTeamsDirective().
Referenced by clang::CodeGen::emitTargetNumIterationsCall().
|
static |
Emit the number of threads for a target directive.
Inspect the thread_limit clause associated with a teams construct combined or closely nested with the target directive.
Emit the num_threads clause for directives such as 'target parallel' that have no associated teams construct.
Otherwise, return nullptr.
Definition at line 6805 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Expr::EvaluateAsBooleanCondition(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CapturedStmt::getCapturedStmt(), clang::OMPExecutableDirective::getClausesOfKind(), clang::OMPIfClause::getCondition(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), getNumThreads(), clang::OMPExecutableDirective::getSingleClause(), clang::CodeGen::getSingleCompoundChild(), clang::OMPExecutableDirective::hasClausesOfKind(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), clang::isOpenMPDistributeDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTeamsDirective(), clang::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE(), Offset, and operator*().
Referenced by clang::CodeGen::emitTargetNumIterationsCall().
|
static |
Emit the arrays used to pass the captures and map information to the offloading runtime library.
If there is no map or capture information, return nullptr by reference.
Definition at line 8545 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::ArrayType::Normal, and clang::ASTContext::VoidPtrTy.
Referenced by clang::CodeGen::emitRequiresDirectiveRegFun(), and clang::CodeGen::emitTargetNumIterationsCall().
|
static |
Emit the arguments to be passed to the runtime library based on the arrays of pointers, sizes and map types.
Definition at line 8662 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP2_32(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::VoidPtrPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by clang::CodeGen::emitRequiresDirectiveRegFun(), and clang::CodeGen::emitTargetNumIterationsCall().
|
static |
Emit initialization of arrays of complex types.
DestAddr | Address of the array. |
Type | Type of array. |
Init | Initial expression of array. |
SrcAddr | Address of the original array. |
Definition at line 861 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::EmitBlock(), emitInitWithReductionInitializer(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitOMPSharedLValue(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::OMPDeclareReductionDecl::getInitializer(), clang::CodeGen::Address::getPointer(), clang::QualType::getQualifiers(), clang::CodeGen::Address::getType(), clang::ASTContext::getTypeSizeInChars(), and clang::CodeGen::Address::invalid().
|
static |
Emit reduction operation for each element of array (required for array sections) LHS op = RHS.
Type | Type of array. |
LHSVar | Variable on the left side of the reduction operation (references element of array in original variable). |
RHSVar | Variable on the right side of the reduction operation (references element of array in original variable). |
RedOpGen | Generator of reduction operation with use of LHSVar and RHSVar. |
Definition at line 5449 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getPointer(), and clang::ASTContext::getTypeSizeInChars().
Referenced by clang::CodeGen::emitSingleReductionCombiner().
|
static |
Definition at line 1487 of file CGOpenMPRuntime.cpp.
References clang::Type::castAs(), clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::createRuntimeFunction(), clang::CodeGen::emitParallelOutlinedFunction(), clang::CodeGen::emitTaskOutlinedFunction(), clang::CodeGen::emitTeamsOutlinedFunction(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::OMPExecutableDirective::getBeginLoc(), clang::OMPExecutableDirective::getCapturedStmt(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CodeGenModule::getOpenMPIRBuilder(), clang::CodeGen::CGOpenMPRuntime::getOutlinedHelperName(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), clang::ValueDecl::getType(), clang::isOpenMPTaskLoopDirective(), clang::Type::isPointerType(), OMPRTL__kmpc_omp_task, and clang::CodeGen::RegionCodeGenTy::setAction().
|
static |
Emit initialization for private variables in task-based directives.
Definition at line 4725 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitAggregateAssign(), clang::CodeGen::CodeGenFunction::EmitExprAsInit(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitOMPAggregateAssign(), clang::RecordDecl::field_begin(), clang::CodeGen::OMPTaskDataTy::FirstprivateVars, clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::VarDecl::getAnyInitializer(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getDeclAlign(), clang::Decl::getDeclContext(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::LValue::getTBAAInfo(), clang::CodeGen::LValue::getType(), clang::Type::isArrayType(), clang::isOpenMPTargetDataManagementDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTaskLoopDirective(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), clang::CodeGen::Address::isValid(), clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::lookup(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize(), and clang::CodeGen::Type.
Referenced by emitTaskDupFunction(), and clang::CodeGen::emitTaskInit().
|
static |
Emit a proxy function which accepts kmp_task_t as the second argument.
Definition at line 4473 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::isOpenMPTaskLoopDirective(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenFunction::ReturnValue, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Emits reduction combiner function:
Definition at line 6052 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::ASTContext::getPointerType(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by emitReduceFiniFunction().
|
static |
Emits reduction finalizer function:
Definition at line 6128 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::ASTContext::buildImplicitRecord(), clang::CodeGen::CodeGenFunction::CapturedStmtInfo, clang::CodeGen::CGOpenMPRuntime::CGM, clang::RecordDecl::completeDefinition(), clang::Create(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::createRuntimeFunction(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::CodeGenFunction::EmitCastToVoidPtr(), clang::CodeGen::CodeGenFunction::EmitCheckedInBoundsGEP(), clang::CodeGen::ReductionCodeGen::emitCleanups(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitReduceCombFunction(), emitReduceInitFunction(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::emitTaskReductionFixups(), clang::CodeGen::emitTaskReductionInit(), clang::CodeGen::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::getAddrOfArtificialThreadPrivate(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::LValue::getAlignment(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::ASTContext::getPointerType(), clang::ASTContext::getRecordType(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSharedLValue(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::getTaskReductionItem(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), clang::CodeGen::LValue::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::InternalLinkage, clang::CodeGen::CodeGenTypeCache::IntTy, clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::ReductionCodeGen::needCleanups(), clang::ArrayType::Normal, OMPRTL__kmpc_omp_taskwait, OMPRTL__kmpc_task_reduction_get_th_data, OMPRTL__kmpc_task_reduction_init, clang::ImplicitParamDecl::Other, clang::CodeGen::OMPTaskDataTy::ReductionCopies, clang::CodeGen::OMPTaskDataTy::ReductionOps, clang::CodeGen::OMPTaskDataTy::ReductionVars, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenTypeCache::SizeTy, clang::TagDecl::startDefinition(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::ReductionCodeGen::usesReductionInitializer(), clang::CodeGen::CodeGenTypeCache::VoidPtrTy, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
|
static |
Emits reduction initializer function:
Definition at line 5983 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CanQual< T >::castAs(), clang::Create(), clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::ReductionCodeGen::emitInitialization(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::ASTContext::getPointerType(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::ReductionCodeGen::usesReductionInitializer(), clang::CodeGen::CodeGenTypeCache::VoidPtrTy, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by emitReduceFiniFunction().
|
static |
Emit reduction combiner.
If the combiner is a simple expression emit it as is, otherwise consider it as combiner of UDR decl and emit it as a call of UDR combiner function.
Definition at line 5523 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CodeGenFunction::CGM, clang::Create(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::emitReductionFunction(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::ImplicitParamDecl::Other, Privates, clang::CodeGen::Type, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by clang::CodeGen::emitSingleReductionCombiner().
|
static |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag)
Definition at line 4858 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::Create(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitPrivatesInit(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::OMPTaskDataTy::FirstprivateVars, clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::ASTContext::IntTy, clang::CodeGen::Address::invalid(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::ASTContext::VoidTy.
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Emit a privates mapping function for correct handling of private and firstprivate variables.
Definition at line 4636 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::ImplicitParamDecl::Create(), clang::Create(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::LValue::getPointer(), clang::ASTContext::getPointerType(), clang::CodeGen::Address::getType(), clang::Expr::getType(), clang::CodeGen::LValue::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::ASTContext::VoidTy, clang::QualType::withConst(), and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 10292 of file CGOpenMPRuntime.cpp.
References evaluateCDTSize().
Referenced by clang::CodeGen::emitDeclareSimdFunction().
|
static |
Definition at line 10239 of file CGOpenMPRuntime.cpp.
References clang::Decl::getASTContext(), clang::Type::getCanonicalTypeUnqualified(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getPointerType(), clang::ASTContext::getRecordType(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::IntTy, clang::QualType::isNull(), clang::Type::isRecordType(), clang::Type::isUnionType(), clang::Type::isVoidType(), and Offset.
Referenced by emitX86DeclareSimdFunction().
|
static |
Generates unique name for artificial threadprivate variables.
Format is: <Prefix> "." <Decl_mangled_name> "_" "<Decl_start_loc_raw_enc>"
Definition at line 5959 of file CGOpenMPRuntime.cpp.
References getBaseDecl(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getMangledName(), and clang::CodeGen::CodeGenModule::getOpenMPRuntime().
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::LastprivateConditionalRAII().
|
static |
Computes the lane size (LS) of a return type or of an input parameter, as defined by LS(P)
in 3.2.1 of the AAVFABI.
TODO: Add support for references, section 3.2.1, item 1.
Definition at line 10422 of file CGOpenMPRuntime.cpp.
References getAArch64MTV(), getAArch64PBV(), clang::QualType::getCanonicalType(), clang::Type::getPointeeType(), clang::ASTContext::getTypeSize(), clang::ASTContext::getUIntPtrType(), and clang::Type::isPointerType().
Referenced by getNDSWDS().
|
static |
Maps To Vector (MTV), as defined in 3.1.1 of the AAVFABI.
TODO: Need to implement the behavior for reference marked with a var or no linear modifiers (1.b in the section). For this, we need to extend ParamKindTy to support the linear modifiers.
Definition at line 10376 of file CGOpenMPRuntime.cpp.
References clang::QualType::getCanonicalType(), and clang::Type::isVoidType().
Referenced by getAArch64LS(), and getNDSWDS().
|
static |
Pass By Value (PBV), as defined in 3.1.2 of the AAVFABI.
Definition at line 10397 of file CGOpenMPRuntime.cpp.
References clang::QualType::getCanonicalType(), clang::ASTContext::getTypeSize(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), and clang::Type::isPointerType().
Referenced by getAArch64LS(), and getNDSWDS().
|
static |
Definition at line 1154 of file CGOpenMPRuntime.cpp.
References clang::Expr::IgnoreParenImpCasts().
Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress(), and generateUniqueName().
|
static |
Definition at line 6353 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CapturedStmtInfo, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::createRuntimeFunction(), clang::CodeGen::emitCancellationPointCall(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and OMPRTL__kmpc_cancellationpoint.
|
static |
Finds the variant function that matches current context with its context selector.
Definition at line 11245 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenModule::getContext(), greaterCtxScore(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), matchesContext(), clang::Decl::specific_attrs(), and translateAttrToContextSelectorData().
Referenced by clang::CodeGen::emitDeclareVariant().
|
static |
Definition at line 10438 of file CGOpenMPRuntime.cpp.
References getAArch64LS(), getAArch64MTV(), getAArch64PBV(), clang::Decl::getASTContext(), clang::QualType::getCanonicalType(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), and clang::Type::isVoidType().
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Check for inner distribute directive.
Definition at line 8696 of file CGOpenMPRuntime.cpp.
References clang::CapturedStmt::getCapturedStmt(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::getSingleCompoundChild(), clang::Stmt::IgnoreContainers(), and clang::isOpenMPDistributeDirective().
Referenced by clang::CodeGen::emitTargetNumIterationsCall().
|
static |
Definition at line 6704 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Expr::EvaluateAsBooleanCondition(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CapturedStmt::getCapturedStmt(), clang::OMPIfClause::getCondition(), clang::CodeGen::CodeGenFunction::getContext(), clang::OMPClauseWithPreInit::getPreInitStmt(), clang::CodeGen::getSingleCompoundChild(), clang::Stmt::getSourceRange(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::isOpenMPParallelDirective(), and clang::isOpenMPSimdDirective().
Referenced by emitNumThreadsForTargetDirective().
|
static |
Check if the combiner is a call to UDR combiner and if it is so return the UDR decl used for reduction.
Definition at line 794 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::ReductionCodeGen::emitInitialization(), and clang::CodeGen::ReductionCodeGen::usesReductionInitializer().
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 3564 of file CGOpenMPRuntime.cpp.
References OMP_ord_auto, OMP_ord_dynamic_chunked, OMP_ord_guided_chunked, OMP_ord_runtime, OMP_ord_static, OMP_ord_static_chunked, OMP_sch_auto, OMP_sch_dynamic_chunked, OMP_sch_guided_chunked, OMP_sch_runtime, OMP_sch_static, OMP_sch_static_chunked, and clang::OMPC_SCHEDULE_unknown.
Referenced by addMonoNonMonoModifier(), emitForStaticInitCall(), clang::CodeGen::isDynamic(), clang::CodeGen::isStaticChunked(), and clang::CodeGen::isStaticNonchunked().
|
static |
Map the OpenMP distribute schedule to the runtime enumeration.
Definition at line 3587 of file CGOpenMPRuntime.cpp.
References OMP_dist_sch_static, and OMP_dist_sch_static_chunked.
|
static |
Obtain information that uniquely identifies a target entry.
This consists of the file and device IDs as well as line number associated with the relevant entry source location.
Definition at line 2680 of file CGOpenMPRuntime.cpp.
References clang::SourceManager::getDiagnostics(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isValid(), clang::DiagnosticsEngine::Report(), and SM.
Referenced by clang::CodeGen::emitDeclareTargetVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::getAddrOfDeclareTargetVar(), and clang::CodeGen::registerTargetFirstprivateCopy().
|
static |
Definition at line 11208 of file CGOpenMPRuntime.cpp.
References isStrictSubset().
Referenced by getDeclareVariantFunction().
|
static |
Definition at line 11185 of file CGOpenMPRuntime.cpp.
Referenced by greaterCtxScore().
|
static |
Checks if the expression is constant or does not have non-trivial function calls.
Definition at line 6524 of file CGOpenMPRuntime.cpp.
References clang::Expr::hasNonTrivialCall(), clang::Expr::HasSideEffects(), clang::Expr::isEvaluatable(), and clang::Expr::SE_AllowUndefinedBehavior.
Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), createDestructorDefinitionData(), clang::CodeGen::getSingleCompoundChild(), and clang::TextNodeDumper::VisitCXXRecordDecl().
|
static |
Definition at line 1106 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::LValue::getAddress(), clang::Type::getAs(), clang::CodeGen::LValue::getBaseInfo(), clang::CodeGen::CodeGenFunction::getContext(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CodeGen::CodeGenModule::getTBAAInfoForSubobject(), clang::CodeGen::LValue::getType(), clang::ASTContext::hasSameType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress().
|
static |
Mangle the parameter part of the vector function name according to their OpenMP classification.
The mangling function is defined in section 3.5 of the AAVFABI.
Definition at line 10474 of file CGOpenMPRuntime.cpp.
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Definition at line 11127 of file CGOpenMPRuntime.cpp.
References checkContext< OMP_CTX_SET_implementation, OMP_CTX_vendor >(), and clang::OMP_CTX_unknown.
Referenced by getDeclareVariantFunction().
|
static |
Definition at line 11152 of file CGOpenMPRuntime.cpp.
References clang::Expr::EvaluateKnownConstInt(), and clang::OMP_CTX_unknown.
Referenced by getDeclareVariantFunction().
ident_t |
Definition at line 517 of file CGOpenMPRuntime.cpp.