clang 17.0.0git
|
#include "CGOpenMPRuntime.h"
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "TargetInfo.h"
#include "clang/AST/APValue.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/Basic/FileManager.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/SourceManager.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <numeric>
#include <optional>
Go to the source code of this file.
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. | |
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. | |
static LValue | loadToBegin (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, LValue BaseLV) |
static Address | castToBase (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, Address OriginalBaseAddress, 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 StringRef | getIdentStringFromSourceLocation (CodeGenFunction &CGF, SourceLocation Loc, SmallString< 128 > &Buffer) |
static llvm::TargetRegionEntryInfo | getTargetEntryUniqueInfo (ASTContext &C, SourceLocation Loc, StringRef ParentName="") |
Obtain information that uniquely identifies a target entry. | |
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. | |
static llvm::Value * | emitCopyprivateCopyFunction (CodeGenModule &CGM, llvm::Type *ArgsElemType, 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. | |
static OpenMPSchedType | getRuntimeSchedule (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) |
Map the OpenMP distribute schedule to the runtime enumeration. | |
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 bool | isAllocatableDecl (const VarDecl *VD) |
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. | |
static llvm::Value * | emitDestructorsFunction (CodeGenModule &CGM, SourceLocation Loc, QualType KmpInt32Ty, QualType KmpTaskTWithPrivatesPtrQTy, QualType KmpTaskTWithPrivatesQTy) |
static llvm::Value * | emitTaskPrivateMappingFunction (CodeGenModule &CGM, SourceLocation Loc, const OMPTaskDataTy &Data, QualType PrivatesQTy, ArrayRef< PrivateDataTy > Privates) |
Emit a privates mapping function for correct handling of private and firstprivate variables. | |
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. | |
static bool | checkInitIsRequired (CodeGenFunction &CGF, ArrayRef< PrivateDataTy > Privates) |
Check if duplication function is required for taskloops. | |
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) | |
static bool | checkDestructorsRequired (const RecordDecl *KmpTaskTWithPrivatesQTyRD, ArrayRef< PrivateDataTy > Privates) |
Checks if destructor function is required to be generated. | |
static std::pair< llvm::Value *, llvm::Value * > | getPointerAndSize (CodeGenFunction &CGF, const Expr *E) |
static void | getKmpAffinityType (ASTContext &C, QualType &KmpTaskAffinityInfoTy) |
Builds kmp_depend_info, if it is not built yet, and builds flags type. | |
static RTLDependenceKindTy | translateDependencyKind (OpenMPDependClauseKind K) |
Translates internal dependency kind into the runtime kind. | |
static void | getDependTypes (ASTContext &C, QualType &KmpDependInfoTy, QualType &FlagsTy) |
Builds kmp_depend_info, if it is not built yet, and builds flags type. | |
static void | emitDependData (CodeGenFunction &CGF, QualType &KmpDependInfoTy, llvm::PointerUnion< unsigned *, LValue * > Pos, const OMPTaskDataTy::DependData &Data, Address DependenciesArray) |
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. | |
static void | emitReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp) |
Emit reduction combiner. | |
static std::string | generateUniqueName (CodeGenModule &CGM, StringRef Prefix, const Expr *Ref) |
Generates unique name for artificial threadprivate variables. | |
static llvm::Value * | emitReduceInitFunction (CodeGenModule &CGM, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) |
Emits reduction initializer function: | |
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: | |
static llvm::Value * | emitReduceFiniFunction (CodeGenModule &CGM, SourceLocation Loc, ReductionCodeGen &RCG, unsigned N) |
Emits reduction finalizer function: | |
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. | |
static llvm::Value * | getNumThreads (CodeGenFunction &CGF, const CapturedStmt *CS, llvm::Value *DefaultThreadLimitVal) |
static void | emitNonContiguousDescriptor (CodeGenFunction &CGF, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo, CGOpenMPRuntime::TargetDataInfo &Info) |
static ValueDecl * | getDeclFromThisExpr (const Expr *E) |
llvm::Constant * | emitMappingInformation (CodeGenFunction &CGF, llvm::OpenMPIRBuilder &OMPBuilder, MappableExprsHandler::MappingExprInfo &MapExprs) |
Emit a string constant containing the names of the values mapped to the offloading runtime library. | |
static void | emitOffloadingArrays (CodeGenFunction &CGF, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo, CGOpenMPRuntime::TargetDataInfo &Info, llvm::OpenMPIRBuilder &OMPBuilder, bool IsNonContiguous=false) |
Emit the arrays used to pass the captures and map information to the offloading runtime library. | |
static const OMPExecutableDirective * | getNestedDistributeDirective (ASTContext &Ctx, const OMPExecutableDirective &D) |
Check for inner distribute directive. | |
static bool | isAssumedToBeNotEmitted (const ValueDecl *VD, bool IsDevice) |
static unsigned | evaluateCDTSize (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. | |
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 4.1.1 of the AAVFABI (2021Q1). | |
static bool | getAArch64PBV (QualType QT, ASTContext &C) |
Pass By Value (PBV), as defined in 3.1.2 of the AAVFABI. | |
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. | |
static std::tuple< unsigned, unsigned, bool > | getNDSWDS (const FunctionDecl *FD, ArrayRef< ParamAttrTy > ParamAttrs) |
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. | |
static llvm::Value * | getAllocatorVal (CodeGenFunction &CGF, const Expr *Allocator) |
Return allocator value from expression, or return a null allocator (default when no allocator specified). | |
static llvm::Value * | getAlignmentValue (CodeGenModule &CGM, const VarDecl *VD) |
Return the alignment from an allocate directive if present. | |
|
static |
Definition at line 11275 of file CGOpenMPRuntime.cpp.
References addAArch64VectorName().
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Definition at line 11260 of file CGOpenMPRuntime.cpp.
Referenced by addAArch64AdvSIMDNDSNames(), and emitAArch64DeclareSimdFunction().
|
static |
Definition at line 1045 of file CGOpenMPRuntime.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::C, clang::FieldDecl::Create(), and clang::ICIS_NoInit.
Referenced by createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), createPrivatesRecordDecl(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), emitNonContiguousDescriptor(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), getDependTypes(), and getKmpAffinityType().
|
static |
Definition at line 2636 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenModule::getLangOpts(), clang::OMPC_SCHEDULE_MODIFIER_last, and clang::OMPC_SCHEDULE_MODIFIER_unknown.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitForDispatchInit(), and emitForStaticInitCall().
|
static |
Definition at line 935 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::CodeGen::Address::getType(), clang::ASTContext::hasSameType(), clang::CodeGen::Address::invalid(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::CodeGen::Address::isValid(), clang::CodeGen::NotKnownNonNull, and clang::CodeGen::Address::withPointer().
Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress().
|
static |
Checks if destructor function is required to be generated.
Definition at line 3657 of file CGOpenMPRuntime.cpp.
References clang::QualType::isDestructedType(), and P.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Check if duplication function is required for taskloops.
Definition at line 3558 of file CGOpenMPRuntime.cpp.
References clang::VarDecl::getAnyInitializer(), and clang::CodeGen::CodeGenFunction::isTrivialInitializer().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 3102 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::isOpenMPTaskLoopDirective(), clang::TagDecl::startDefinition(), and clang::TTK_Union.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 3148 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenModule::getContext(), and clang::TagDecl::startDefinition().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 3068 of file CGOpenMPRuntime.cpp.
References clang::Decl::addAttr(), addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), clang::Decl::getAttrs(), clang::CodeGen::CodeGenModule::getContext(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Decl::hasAttrs(), isAllocatableDecl(), clang::Type::isLValueReferenceType(), and clang::TagDecl::startDefinition().
Referenced by createKmpTaskTWithPrivatesRecordDecl().
|
static |
Emit vector function attributes for AArch64, as defined in the AAVFABI.
Definition at line 11310 of file CGOpenMPRuntime.cpp.
References addAArch64AdvSIMDNDSNames(), addAArch64VectorName(), clang::CodeGen::CGOpenMPRuntime::CGM, Data, clang::DiagnosticsEngine::getCustomDiagID(), clang::CodeGen::CodeGenModule::getDiags(), getNDSWDS(), mangleVectorParameters(), clang::DiagnosticsEngine::Report(), and clang::DiagnosticsEngine::Warning.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction().
|
static |
Given an array of pointers to variables, project the address of a given variable.
Definition at line 2295 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getDeclAlign(), and clang::ValueDecl::getType().
Referenced by emitCopyprivateCopyFunction(), and clang::CodeGen::CGOpenMPRuntime::emitReductionFunction().
|
static |
Definition at line 1089 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitUserDefinedReduction().
|
static |
Definition at line 2308 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), emitAddrOfVarFromArray(), clang::CodeGen::CodeGenFunction::EmitOMPCopy(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitSingleRegion().
|
static |
Definition at line 4258 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CGBuilderTy::CreateGEP(), Data, clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), getDependTypes(), clang::Expr::getExprLoc(), getPointerAndSize(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), P, clang::CodeGen::CodeGenTypeCache::SizeTy, and translateDependencyKind().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDependClause(), and clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause().
|
static |
Definition at line 3279 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), 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::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::QualType::withRestrict().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 2720 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IL, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::IVSize, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::LB, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Ordered, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::ST, and clang::CodeGen::CGOpenMPRuntime::StaticRTInput::UB.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), and clang::CodeGen::CGOpenMPRuntime::emitForStaticInit().
|
static |
Definition at line 616 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLoadOfComplex(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenModule::EmitNullConstant(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getComplex(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::OMPDeclareReductionDecl::getInitializer(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::QualType::getQualifiers(), clang::CodeGen::CGOpenMPRuntime::getUserDefinedReduction(), clang::Expr::IgnoreParenImpCasts(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, clang::CodeGen::TEK_Scalar, clang::VK_LValue, and clang::VK_PRValue.
Referenced by clang::CodeGen::ReductionCodeGen::emitInitialization(), and EmitOMPAggregateInit().
llvm::Constant * emitMappingInformation | ( | CodeGenFunction & | CGF, |
llvm::OpenMPIRBuilder & | OMPBuilder, | ||
MappableExprsHandler::MappingExprInfo & | MapExprs | ||
) |
Emit a string constant containing the names of the values mapped to the offloading runtime library.
Definition at line 9077 of file CGOpenMPRuntime.cpp.
References clang::PresumedLoc::getColumn(), clang::CodeGen::CodeGenFunction::getContext(), getDeclFromThisExpr(), clang::PresumedLoc::getFilename(), clang::ASTContext::getLangOpts(), clang::PresumedLoc::getLine(), clang::Decl::getLocation(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), and P.
Referenced by emitOffloadingArrays(), and clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper().
|
static |
Definition at line 8994 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::CGM, clang::RecordDecl::completeDefinition(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP2_32(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ArrayType::Normal, P, clang::TagDecl::startDefinition(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by emitOffloadingArrays().
|
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 9113 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo::CaptureDeviceAddrMap, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP2_32(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), emitMappingInformation(), emitNonContiguousDescriptor(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntime::getOrCreateUserDefinedMapperFunc(), clang::CodeGen::Address::getPointer(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::codegenoptions::NoDebugInfo, clang::ArrayType::Normal, P, clang::ASTContext::VoidPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), and clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall().
|
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 675 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::EmitBlock(), emitInitWithReductionInitializer(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getPointer(), clang::QualType::getQualifiers(), 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 4907 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateGEP(), 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::getElementType(), clang::CodeGen::Address::getPointer(), and clang::ASTContext::getTypeSizeInChars().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), and clang::CodeGen::CGOpenMPRuntime::emitSingleReductionCombiner().
|
static |
Definition at line 1223 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::OMPExecutableDirective::getBeginLoc(), clang::CodeGen::CGOpenMPRuntime::getOMPBuilder(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::ValueDecl::getType(), and clang::Type::isPointerType().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTeamsOutlinedFunction().
|
static |
Emit initialization for private variables in task-based directives.
Definition at line 3438 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::CurCodeDecl, Data, clang::CodeGen::Decl, clang::CodeGen::CodeGenFunction::EmitAggregateAssign(), clang::CodeGen::CodeGenFunction::EmitExprAsInit(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitOMPAggregateAssign(), clang::RecordDecl::field_begin(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::VarDecl::getAnyInitializer(), clang::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::Decl::getDeclContext(), clang::OMPExecutableDirective::getDirectiveKind(), 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::LambdaCaptureFields, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::Address::withAlignment().
Referenced by emitTaskDupFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Emit a proxy function which accepts kmp_task_t as the second argument.
Definition at line 3176 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CGOpenMPRuntime::emitOutlinedFunctionCall(), 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::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int8Ty, 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::CGOpenMPRuntime::emitTaskInit().
|
static |
Emits reduction combiner function:
Definition at line 5511 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CGOpenMPRuntime::emitSingleReductionCombiner(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::CodeGenModule::getTypes(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
static |
Emits reduction finalizer function:
Definition at line 5587 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::ReductionCodeGen::emitCleanups(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::ReductionCodeGen::needCleanups(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
static |
Emits reduction initializer function:
Definition at line 5442 of file CGOpenMPRuntime.cpp.
References clang::QualType::addRestrict(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CanQual< T >::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::ReductionCodeGen::emitAggregateType(), clang::CodeGen::ReductionCodeGen::emitInitialization(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointer(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::ReductionCodeGen::getPrivateType(), clang::CodeGen::ReductionCodeGen::getRefExpr(), clang::CodeGen::ReductionCodeGen::getSizes(), clang::ASTContext::getSizeType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::Address::invalid(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::ReductionCodeGen::usesReductionInitializer(), and clang::ASTContext::VoidPtrTy.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
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 4984 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and clang::CodeGen::CGOpenMPRuntime::getUserDefinedReduction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), and clang::CodeGen::CGOpenMPRuntime::emitSingleReductionCombiner().
|
static |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag)
Definition at line 3586 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), Data, 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::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::Address::invalid(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Emit a privates mapping function for correct handling of private and firstprivate variables.
Definition at line 3339 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), clang::ImplicitParamDecl::Create(), Data, 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::CGOpenMPRuntime::getName(), clang::QualType::getNonReferenceType(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::LValue::getPointer(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::CodeGen::LValue::getType(), clang::CodeGen::CodeGenModule::getTypes(), isAllocatableDecl(), clang::Type::isLValueReferenceType(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::ImplicitParamDecl::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 11101 of file CGOpenMPRuntime.cpp.
References Data, evaluateCDTSize(), and mangleVectorParameters().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction().
|
static |
Definition at line 11002 of file CGOpenMPRuntime.cpp.
References clang::C, clang::Decl::getASTContext(), clang::Type::getCanonicalTypeUnqualified(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), 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 5418 of file CGOpenMPRuntime.cpp.
References getBaseDecl(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getMangledName(), clang::NamedDecl::getName(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::SourceLocation::getRawEncoding(), and clang::VarDecl::isLocalVarDeclOrParm().
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups().
|
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 11207 of file CGOpenMPRuntime.cpp.
References clang::C, getAArch64MTV(), getAArch64PBV(), clang::QualType::getCanonicalType(), clang::Type::getPointeeType(), and clang::Type::isPointerType().
Referenced by getNDSWDS().
Maps To Vector (MTV), as defined in 4.1.1 of the AAVFABI (2021Q1).
Definition at line 11162 of file CGOpenMPRuntime.cpp.
References clang::QualType::getCanonicalType(), clang::Type::isReferenceType(), 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 11182 of file CGOpenMPRuntime.cpp.
References clang::C, clang::QualType::getCanonicalType(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), and clang::Type::isPointerType().
Referenced by getAArch64LS(), and getNDSWDS().
|
static |
Return the alignment from an allocate directive if present.
Definition at line 11754 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CodeGenModule::getOMPAllocateAlignment(), and clang::CodeGen::CodeGenTypeCache::SizeTy.
Referenced by clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable().
|
static |
Return allocator value from expression, or return a null allocator (default when no allocator specified).
Definition at line 11735 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getTypes(), and clang::ASTContext::VoidPtrTy.
Referenced by clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable().
|
static |
Definition at line 964 of file CGOpenMPRuntime.cpp.
References clang::DeclRefExpr::getDecl().
Referenced by generateUniqueName().
|
static |
Definition at line 5887 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), and clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall().
Definition at line 9063 of file CGOpenMPRuntime.cpp.
References clang::Expr::IgnoreParenCasts().
Referenced by emitMappingInformation().
|
static |
Builds kmp_depend_info, if it is not built yet, and builds flags type.
Definition at line 4216 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), clang::QualType::isNull(), and clang::TagDecl::startDefinition().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDependClause(), emitDependData(), clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), clang::CodeGen::CGOpenMPRuntime::emitUpdateClause(), and clang::CodeGen::CGOpenMPRuntime::getDepobjElements().
|
static |
Definition at line 1348 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CurFuncDecl, clang::PresumedLoc::getColumn(), clang::CodeGen::CodeGenFunction::getContext(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), and clang::ASTContext::getSourceManager().
Referenced by clang::CodeGen::CGOpenMPRuntime::getThreadID().
|
static |
Builds kmp_depend_info, if it is not built yet, and builds flags type.
Definition at line 3782 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), clang::QualType::isNull(), and clang::TagDecl::startDefinition().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 11223 of file CGOpenMPRuntime.cpp.
References clang::C, 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 9312 of file CGOpenMPRuntime.cpp.
References clang::CapturedStmt::getCapturedStmt(), clang::OMPExecutableDirective::getDirectiveKind(), clang::OMPExecutableDirective::getInnermostCapturedStmt(), clang::CodeGen::CGOpenMPRuntime::getSingleCompoundChild(), clang::Stmt::IgnoreContainers(), and clang::isOpenMPDistributeDirective().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetNumIterationsCall().
|
static |
Definition at line 6342 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, 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::CGOpenMPRuntime::getSingleCompoundChild(), clang::Stmt::getSourceRange(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), and clang::Result.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitNumThreadsForTargetDirective().
|
static |
Definition at line 3746 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::Expr::IgnoreParenImpCasts(), and clang::CodeGen::CodeGenTypeCache::SizeTy.
Referenced by emitDependData(), and clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
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 606 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::ReductionCodeGen::emitInitialization(), and clang::CodeGen::ReductionCodeGen::usesReductionInitializer().
|
static |
Map the OpenMP distribute schedule to the runtime enumeration.
Definition at line 2598 of file CGOpenMPRuntime.cpp.
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 2575 of file CGOpenMPRuntime.cpp.
References clang::OMPC_SCHEDULE_unknown.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CGOpenMPRuntime::emitForDispatchInit(), clang::CodeGen::CGOpenMPRuntime::emitForStaticInit(), clang::CodeGen::CGOpenMPRuntime::isDynamic(), clang::CodeGen::CGOpenMPRuntime::isStaticChunked(), and clang::CodeGen::CGOpenMPRuntime::isStaticNonchunked().
|
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 1591 of file CGOpenMPRuntime.cpp.
References clang::C, clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceLocation::isValid(), clang::PresumedLoc::isValid(), and SM.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), and clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions().
Definition at line 3057 of file CGOpenMPRuntime.cpp.
References clang::Decl::getAttr(), clang::VarDecl::getCanonicalDecl(), and clang::Decl::hasAttr().
Referenced by createPrivatesRecordDecl(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), and clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable().
Definition at line 10268 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(), and clang::CodeGen::CGOpenMPRuntime::emitTargetGlobalVariable().
|
static |
Checks if the expression is constant or does not have non-trivial function calls.
Definition at line 6123 of file CGOpenMPRuntime.cpp.
References clang::Expr::hasNonTrivialCall(), clang::Expr::HasSideEffects(), clang::Expr::isEvaluatable(), and clang::Expr::SE_AllowUndefinedBehavior.
Referenced by clang::CodeGen::CGOpenMPRuntime::getSingleCompoundChild(), and clang::TextNodeDumper::VisitCXXRecordDecl().
|
static |
Definition at line 915 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 4.5 of the AAVFABI(2021Q1).
Definition at line 11057 of file CGOpenMPRuntime.cpp.
Referenced by emitAArch64DeclareSimdFunction(), and emitX86DeclareSimdFunction().
|
static |
Translates internal dependency kind into the runtime kind.
Definition at line 4185 of file CGOpenMPRuntime.cpp.
References clang::OMPC_DEPEND_unknown.
Referenced by emitDependData(), and clang::CodeGen::CGOpenMPRuntime::emitUpdateClause().