clang 19.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 <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 | 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 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 | 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 10753 of file CGOpenMPRuntime.cpp.
References addAArch64VectorName().
Referenced by emitAArch64DeclareSimdFunction().
|
static |
Definition at line 10738 of file CGOpenMPRuntime.cpp.
Referenced by addAArch64AdvSIMDNDSNames(), and emitAArch64DeclareSimdFunction().
|
static |
Definition at line 1023 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 2470 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 913 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 3463 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 3364 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 1520 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 1497 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), and clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable().
|
static |
Definition at line 2908 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 2954 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 2874 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 10788 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 2129 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 1076 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 2142 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::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitSingleRegion().
|
static |
Definition at line 4063 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, 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 3085 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::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 9397 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 11146 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CGOpenMPRuntime::CGM, clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), 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::CodeGen::Address::getPointer(), clang::Expr::getType(), clang::Normal, and clang::CodeGen::CGOpenMPRuntime::OMPBuilder.
llvm::Value * emitDynCGGroupMem | ( | const OMPExecutableDirective & | D, |
CodeGenFunction & | CGF | ||
) |
Definition at line 9415 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::OMPExecutableDirective::getSingleClause(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by emitTargetCallKernelLaunch().
|
static |
Definition at line 2555 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 596 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::MakeNaturalAlignAddrLValue(), 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 8786 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(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), and clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper().
|
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 8822 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::TargetDataInfo::CaptureDeviceAddrMap, clang::CodeGen::CodeGenFunction::CGM, emitMappingInformation(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), 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 655 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::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getPointer(), 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 4712 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 1210 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 3244 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::CurCodeDecl, 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::OMPExecutableDirective::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::Decl::getDeclContext(), clang::OMPExecutableDirective::getDirectiveKind(), 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 2982 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::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 5315 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(), 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 5390 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::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit().
|
static |
Emits reduction initializer function:
Definition at line 5247 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(), 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 4789 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 9607 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), emitTargetCallFallback(), and clang::OMPExecutableDirective::getDirectiveKind().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetCall().
|
static |
Definition at line 9380 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGOpenMPRuntime::emitOutlinedFunctionCall(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::OMPExecutableDirective::getBeginLoc().
Referenced by emitTargetCallElse(), and emitTargetCallKernelLaunch().
|
static |
Definition at line 9429 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::AllocaInsertPt, 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::CodeGen::CodeGenFunction::CGM, clang::Device, emitDeviceID(), emitDynCGGroupMem(), clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(), clang::CodeGen::CGOpenMPRuntime::emitNumTeamsForTargetDirective(), clang::CodeGen::CGOpenMPRuntime::emitNumThreadsForTargetDirective(), emitOffloadingArrays(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), emitTargetCallFallback(), clang::CodeGen::CGOpenMPRuntime::emitTargetNumIterationsCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::RecordDecl::field_begin(), clang::CapturedStmt::getCapturedRecordDecl(), clang::CapturedStmt::Capture::getCapturedVar(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::OMPExecutableDirective::getDirectiveKind(), clang::CodeGen::CGOpenMPRuntime::getOMPBuilder(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypeSize(), clang::OMPExecutableDirective::hasClausesOfKind(), 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 3392 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), 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(), 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 3145 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::C, clang::Type::castAs(), clang::ImplicitParamDecl::Create(), clang::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::Other, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTaskInit().
|
static |
Definition at line 10579 of file CGOpenMPRuntime.cpp.
References clang::Data, evaluateCDTSize(), and mangleVectorParameters().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction().
|
static |
Definition at line 10480 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 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 5223 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 10685 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 10640 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 10660 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 11248 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 11229 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 942 of file CGOpenMPRuntime.cpp.
References clang::DeclRefExpr::getDecl().
Referenced by generateUniqueName().
|
static |
Definition at line 5687 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), and clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall().
Definition at line 8772 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 4022 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 1541 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 1353 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 3588 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 10701 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 8870 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 |
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 6187 of file CGOpenMPRuntime.cpp.
References clang::C, 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 3552 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 586 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 2432 of file CGOpenMPRuntime.cpp.
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 2409 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 2863 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 9854 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 5959 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 894 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 10535 of file CGOpenMPRuntime.cpp.
References clang::Vector.
Referenced by emitAArch64DeclareSimdFunction(), and emitX86DeclareSimdFunction().
|
static |
Translates internal dependency kind into the runtime kind.
Definition at line 3991 of file CGOpenMPRuntime.cpp.
References clang::OMPC_DEPEND_unknown.
Referenced by emitDependData(), and clang::CodeGen::CGOpenMPRuntime::emitUpdateClause().