clang 20.0.0git
|
#include "CGOpenMPRuntime.h"
#include "ABIInfoImpl.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/SmallVector.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 <cstdint>
#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) |
llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind | convertDeviceClause (const VarDecl *VD) |
llvm::OffloadEntriesInfoManager::OMPTargetGlobalVarEntryKind | convertCaptureClause (const VarDecl *VD) |
static llvm::TargetRegionEntryInfo | getEntryInfoFromPresumedLoc (CodeGenModule &CGM, llvm::OpenMPIRBuilder &OMPBuilder, SourceLocation BeginLoc, llvm::StringRef ParentName="") |
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 void | getNumThreads (CodeGenFunction &CGF, const CapturedStmt *CS, const Expr **E, int32_t &UpperBound, bool UpperBoundOnly, llvm::Value **CondVal) |
Check for a num threads constant value (stored in DefaultVal ), or expression (stored in E ). | |
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 | emitOffloadingArraysAndArgs (CodeGenFunction &CGF, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo, CGOpenMPRuntime::TargetDataInfo &Info, llvm::OpenMPIRBuilder &OMPBuilder, bool IsNonContiguous=false, bool ForEndCall=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 void | emitTargetCallFallback (CGOpenMPRuntime *OMPRuntime, llvm::Function *OutlinedFn, const OMPExecutableDirective &D, llvm::SmallVectorImpl< llvm::Value * > &CapturedVars, bool RequiresOuterTask, const CapturedStmt &CS, bool OffloadingMandatory, CodeGenFunction &CGF) |
static llvm::Value * | emitDeviceID (llvm::PointerIntPair< const Expr *, 2, OpenMPDeviceClauseModifier > Device, CodeGenFunction &CGF) |
llvm::Value * | emitDynCGGroupMem (const OMPExecutableDirective &D, CodeGenFunction &CGF) |
static void | genMapInfoForCaptures (MappableExprsHandler &MEHandler, CodeGenFunction &CGF, const CapturedStmt &CS, llvm::SmallVectorImpl< llvm::Value * > &CapturedVars, llvm::OpenMPIRBuilder &OMPBuilder, llvm::DenseSet< CanonicalDeclPtr< const Decl > > &MappedVarSet, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo) |
static void | genMapInfo (MappableExprsHandler &MEHandler, CodeGenFunction &CGF, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo, llvm::OpenMPIRBuilder &OMPBuilder, const llvm::DenseSet< CanonicalDeclPtr< const Decl > > &SkippedVarSet=llvm::DenseSet< CanonicalDeclPtr< const Decl > >()) |
static void | genMapInfo (const OMPExecutableDirective &D, CodeGenFunction &CGF, const CapturedStmt &CS, llvm::SmallVectorImpl< llvm::Value * > &CapturedVars, llvm::OpenMPIRBuilder &OMPBuilder, MappableExprsHandler::MapCombinedInfoTy &CombinedInfo) |
static void | emitNumTeamsForBareTargetDirective (CodeGenFunction &CGF, const OMPExecutableDirective &D, llvm::SmallVectorImpl< llvm::Value * > &NumTeams) |
static void | emitTargetCallKernelLaunch (CGOpenMPRuntime *OMPRuntime, llvm::Function *OutlinedFn, const OMPExecutableDirective &D, llvm::SmallVectorImpl< llvm::Value * > &CapturedVars, bool RequiresOuterTask, const CapturedStmt &CS, bool OffloadingMandatory, llvm::PointerIntPair< const Expr *, 2, OpenMPDeviceClauseModifier > Device, llvm::Value *OutlinedFnID, CodeGenFunction::OMPTargetDataInfo &InputInfo, llvm::Value *&MapTypesArray, llvm::Value *&MapNamesArray, llvm::function_ref< llvm::Value *(CodeGenFunction &CGF, const OMPLoopDirective &D)> SizeEmitter, CodeGenFunction &CGF, CodeGenModule &CGM) |
static void | emitTargetCallElse (CGOpenMPRuntime *OMPRuntime, llvm::Function *OutlinedFn, const OMPExecutableDirective &D, llvm::SmallVectorImpl< llvm::Value * > &CapturedVars, bool RequiresOuterTask, const CapturedStmt &CS, bool OffloadingMandatory, CodeGenFunction &CGF) |
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. | |
template<typename T > | |
static void | EmitDoacrossOrdered (CodeGenFunction &CGF, CodeGenModule &CGM, const T *C, llvm::Value *ULoc, llvm::Value *ThreadID) |
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 10852 of file CGOpenMPRuntime.cpp.
References addAArch64VectorName().
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Definition at line 10837 of file CGOpenMPRuntime.cpp.
Referenced by addAArch64AdvSIMDNDSNames(), and emitAArch64DeclareSimdFunction().
|
static |
Definition at line 1025 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(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), getDependTypes(), and getKmpAffinityType().
|
static |
Definition at line 2473 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 915 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::RawAddress::getElementType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CodeGen::RawAddress::getPointer(), clang::CodeGen::Address::getType(), clang::ASTContext::hasSameType(), clang::CodeGen::RawAddress::invalid(), clang::CodeGen::Address::invalid(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::CodeGen::RawAddress::isValid(), 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 3474 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 3375 of file CGOpenMPRuntime.cpp.
References clang::VarDecl::getAnyInitializer(), clang::Init, and clang::CodeGen::CodeGenFunction::isTrivialInitializer().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
llvm::OffloadEntriesInfoManager::OMPTargetGlobalVarEntryKind convertCaptureClause | ( | const VarDecl * | VD | ) |
Definition at line 1522 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), and clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable().
llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind convertDeviceClause | ( | const VarDecl * | VD | ) |
Definition at line 1499 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), and clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable().
|
static |
Definition at line 2920 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::Union.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 2966 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 2886 of file CGOpenMPRuntime.cpp.
References clang::Decl::addAttr(), addFieldToRecordDecl(), clang::C, clang::RecordDecl::completeDefinition(), E, 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 10887 of file CGOpenMPRuntime.cpp.
References addAArch64AdvSIMDNDSNames(), addAArch64VectorName(), clang::CodeGen::CGOpenMPRuntime::CGM, clang::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 2132 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 1078 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::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitUserDefinedReduction().
|
static |
Definition at line 2145 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), E, 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(), Loc, clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitSingleRegion().
|
static |
Definition at line 4075 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(), clang::Data, E, 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 3097 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(), Loc, clang::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 9449 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::Device, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenTypeCache::Int64Ty, and clang::OMPC_DEVICE_unknown.
Referenced by emitTargetCallKernelLaunch().
|
static |
Definition at line 11245 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), E, clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::Expr::getExprLoc(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CGOpenMPRuntime::getOMPBuilder(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::Expr::getType(), clang::Normal, and clang::CodeGen::CGOpenMPRuntime::OMPBuilder.
llvm::Value * emitDynCGGroupMem | ( | const OMPExecutableDirective & | D, |
CodeGenFunction & | CGF | ||
) |
Definition at line 9467 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, D, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by emitTargetCallKernelLaunch().
|
static |
Definition at line 2567 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGOpenMPRuntime::StaticRTInput::Chunk, clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), 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 598 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::Func, 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::Init, clang::CodeGen::CodeGenFunction::MakeNaturalAlignRawAddrLValue(), clang::Private, clang::Reduction, 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 8851 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(), Loc, and P.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), and genMapInfo().
|
static |
Definition at line 9591 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, D, E, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenTypeCache::Int32Ty, and V.
Referenced by emitTargetCallKernelLaunch().
|
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 8886 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo::CaptureDeviceAddrMap, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and clang::CodeGen::CGOpenMPRuntime::getOrCreateUserDefinedMapperFunc().
Referenced by emitTargetCallKernelLaunch(), 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 657 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::EmitBlock(), emitInitWithReductionInitializer(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::QualType::getQualifiers(), clang::ASTContext::getTypeSizeInChars(), clang::Init, 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 4725 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::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), and clang::ASTContext::getTypeSizeInChars().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), and clang::CodeGen::CGOpenMPRuntime::emitSingleReductionCombiner().
|
static |
Definition at line 1212 of file CGOpenMPRuntime.cpp.
References D, clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::Decl::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 3256 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::CurCodeDecl, D, clang::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::CodeGen::CodeGenFunction::getContext(), clang::Decl::getDeclContext(), clang::CodeGen::LValue::getTBAAInfo(), clang::CodeGen::LValue::getType(), clang::Init, 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 2994 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::Address::emitRawPointer(), 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::LValue::getPointer(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::isOpenMPTaskLoopDirective(), Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::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 5328 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), 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(), Loc, clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::Address::withElementType().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
static |
Emits reduction finalizer function:
Definition at line 5403 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(), Loc, clang::CodeGen::ReductionCodeGen::needCleanups(), clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
static |
Emits reduction initializer function:
Definition at line 5260 of file CGOpenMPRuntime.cpp.
References clang::QualType::addRestrict(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::CanQual< T >::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), 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(), Loc, clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::ReductionCodeGen::usesReductionInitializer(), clang::ASTContext::VoidPtrTy, and clang::CodeGen::Address::withElementType().
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 4802 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::Func, clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntime::getUserDefinedReduction(), and clang::Reduction.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), and clang::CodeGen::CGOpenMPRuntime::emitSingleReductionCombiner().
|
static |
Definition at line 9710 of file CGOpenMPRuntime.cpp.
References D, clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), and emitTargetCallFallback().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetCall().
|
static |
Definition at line 9432 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, D, clang::CodeGen::CGOpenMPRuntime::emitOutlinedFunctionCall(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::Decl::getBeginLoc().
Referenced by emitTargetCallElse(), and emitTargetCallKernelLaunch().
|
static |
Definition at line 9604 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, D, clang::Device, emitDeviceID(), emitDynCGGroupMem(), clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(), emitNumTeamsForBareTargetDirective(), clang::CodeGen::CGOpenMPRuntime::emitNumTeamsForTargetDirective(), clang::CodeGen::CGOpenMPRuntime::emitNumThreadsForTargetDirective(), emitOffloadingArraysAndArgs(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), emitTargetCallFallback(), clang::CodeGen::CGOpenMPRuntime::emitTargetNumIterationsCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), genMapInfo(), clang::Decl::getBeginLoc(), clang::CodeGen::CGOpenMPRuntime::getOMPBuilder(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::CodeGenTypeCache::Int64Ty, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetCall().
|
static |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag)
Definition at line 3403 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), D, clang::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(), Loc, clang::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 3157 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), clang::ImplicitParamDecl::Create(), clang::Data, E, 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(), Loc, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 10678 of file CGOpenMPRuntime.cpp.
References clang::Data, evaluateCDTSize(), and mangleVectorParameters().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction().
|
static |
Definition at line 10579 of file CGOpenMPRuntime.cpp.
References clang::C, E, 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 clang::Vector.
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 5236 of file CGOpenMPRuntime.cpp.
References D, getBaseDecl(), clang::Decl::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getMangledName(), clang::CodeGen::CGOpenMPRuntime::getName(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and clang::SourceLocation::getRawEncoding().
Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups().
|
static |
Definition at line 9577 of file CGOpenMPRuntime.cpp.
References D, genMapInfo(), and genMapInfoForCaptures().
|
static |
Definition at line 9555 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, emitMappingInformation(), and clang::CodeGen::CodeGenModule::getCodeGenOpts().
Referenced by emitTargetCallKernelLaunch(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), and genMapInfo().
|
static |
Definition at line 9480 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CapturedStmt::capture_begin(), clang::CapturedStmt::capture_end(), clang::CapturedStmt::Capture::capturesThis(), clang::CapturedStmt::Capture::capturesVariable(), clang::CapturedStmt::Capture::capturesVariableArrayType(), clang::RecordDecl::field_begin(), clang::CapturedStmt::getCapturedRecordDecl(), clang::CapturedStmt::Capture::getCapturedVar(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), and clang::CodeGen::CodeGenTypeCache::Int64Ty.
Referenced by genMapInfo().
|
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 10784 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 10739 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 10759 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 11348 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 11329 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 944 of file CGOpenMPRuntime.cpp.
References clang::DeclRefExpr::getDecl().
Referenced by generateUniqueName().
|
static |
Definition at line 5699 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), and clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall().
Definition at line 8837 of file CGOpenMPRuntime.cpp.
References E, and clang::Expr::IgnoreParenCasts().
Referenced by emitMappingInformation().
|
static |
Builds kmp_depend_info, if it is not built yet, and builds flags type.
Definition at line 4034 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 1543 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::ASTContext::getSourceManager(), and SM.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetFunction(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), and clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions().
|
static |
Definition at line 1355 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(), clang::ASTContext::getSourceManager(), and Loc.
Referenced by clang::CodeGen::CGOpenMPRuntime::getThreadID().
|
static |
Builds kmp_depend_info, if it is not built yet, and builds flags type.
Definition at line 3599 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 10800 of file CGOpenMPRuntime.cpp.
References clang::C, E, 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 8920 of file CGOpenMPRuntime.cpp.
References D, clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CGOpenMPRuntime::getSingleCompoundChild(), clang::Stmt::IgnoreContainers(), and clang::isOpenMPDistributeDirective().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetNumIterationsCall().
|
static |
Check for a num threads constant value (stored in DefaultVal
), or expression (stored in E
).
If the value is conditional (via an if-clause), store the condition in CondVal
. If E
, and CondVal
respectively, are nullptr, no expression evaluation is perfomed.
Definition at line 6195 of file CGOpenMPRuntime.cpp.
References clang::C, E, clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), 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::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), and clang::Result.
Referenced by clang::CodeGen::CGOpenMPRuntime::getNumThreadsExprForTargetDirective().
|
static |
Definition at line 3563 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, E, clang::CodeGen::CodeGenFunction::EmitArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), 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 588 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 2435 of file CGOpenMPRuntime.cpp.
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 2412 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().
Definition at line 2875 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 9957 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 5971 of file CGOpenMPRuntime.cpp.
References E, 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 896 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), 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(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::Address::withElementType().
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 10634 of file CGOpenMPRuntime.cpp.
References clang::Vector.
Referenced by emitAArch64DeclareSimdFunction(), and emitX86DeclareSimdFunction().
|
static |
Translates internal dependency kind into the runtime kind.
Definition at line 4003 of file CGOpenMPRuntime.cpp.
References clang::OMPC_DEPEND_unknown.
Referenced by emitDependData(), and clang::CodeGen::CGOpenMPRuntime::emitUpdateClause().