clang
3.9.0
|
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGOpenMPRuntime.h"
#include "CodeGenFunction.h"
#include "clang/AST/Decl.h"
#include "clang/AST/StmtOpenMP.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
Go to the source code of this file.
Classes | |
class | CleanupTy |
A basic class for pre|post-action for advanced codegen sequence for OpenMP region. More... | |
Functions | |
static llvm::Function * | emitCombinerOrInitializer (CodeGenModule &CGM, QualType Ty, const Expr *CombinerInitializer, const VarDecl *In, const VarDecl *Out, bool IsCombiner) |
static CharUnits | getIdentAlign (CodeGenModule &CGM) |
static CharUnits | getIdentSize (CodeGenModule &CGM) |
static CharUnits | getOffsetOfIdentField (IdentFieldIndex Field) |
static Address | createIdentFieldGEP (CodeGenFunction &CGF, Address Addr, IdentFieldIndex Field, const llvm::Twine &Name="") |
static void | emitOMPIfClause (CodeGenFunction &CGF, const Expr *Cond, const RegionCodeGenTy &ThenGen, const RegionCodeGenTy &ElseGen) |
Emits code for OpenMP 'if' clause using specified CodeGen function. More... | |
static Address | emitAddrOfVarFromArray (CodeGenFunction &CGF, Address Array, unsigned Index, const VarDecl *Var) |
Given an array of pointers to variables, project the address of a given variable. More... | |
static llvm::Value * | emitCopyprivateCopyFunction (CodeGenModule &CGM, llvm::Type *ArgsType, ArrayRef< const Expr * > CopyprivateVars, ArrayRef< const Expr * > DestExprs, ArrayRef< const Expr * > SrcExprs, ArrayRef< const Expr * > AssignmentOps) |
static OpenMPSchedType | getRuntimeSchedule (OpenMPScheduleClauseKind ScheduleKind, bool Chunked, bool Ordered) |
Map the OpenMP loop schedule to the runtime enumeration. More... | |
static OpenMPSchedType | getRuntimeSchedule (OpenMPDistScheduleClauseKind ScheduleKind, bool Chunked) |
Map the OpenMP distribute schedule to the runtime enumeration. More... | |
static int | addMonoNonMonoModifier (OpenMPSchedType Schedule, OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2) |
static void | emitForStaticInitCall (CodeGenFunction &CGF, llvm::Value *UpdateLocation, llvm::Value *ThreadId, llvm::Constant *ForStaticInitFunction, OpenMPSchedType Schedule, OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, unsigned IVSize, bool Ordered, Address IL, Address LB, Address UB, Address ST, llvm::Value *Chunk) |
static llvm::Function * | createOffloadingBinaryDescriptorFunction (CodeGenModule &CGM, StringRef Name, const RegionCodeGenTy &Codegen) |
Create a Ctor/Dtor-like function whose body is emitted through Codegen. More... | |
static FieldDecl * | addFieldToRecordDecl (ASTContext &C, DeclContext *DC, QualType FieldTy) |
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::Value * | emitProxyTaskFunction (CodeGenModule &CGM, SourceLocation Loc, OpenMPDirectiveKind Kind, QualType KmpInt32Ty, QualType KmpTaskTWithPrivatesPtrQTy, QualType KmpTaskTWithPrivatesQTy, QualType KmpTaskTQTy, QualType SharedsPtrTy, llvm::Value *TaskFunction, llvm::Value *TaskPrivatesMap) |
Emit a proxy function which accepts kmp_task_t as the second argument. More... | |
static llvm::Value * | emitDestructorsFunction (CodeGenModule &CGM, SourceLocation Loc, QualType KmpInt32Ty, QualType KmpTaskTWithPrivatesPtrQTy, QualType KmpTaskTWithPrivatesQTy) |
static llvm::Value * | emitTaskPrivateMappingFunction (CodeGenModule &CGM, SourceLocation Loc, ArrayRef< const Expr * > PrivateVars, ArrayRef< const Expr * > FirstprivateVars, ArrayRef< const Expr * > LastprivateVars, QualType PrivatesQTy, ArrayRef< PrivateDataTy > Privates) |
Emit a privates mapping function for correct handling of private and firstprivate variables. More... | |
static int | array_pod_sort_comparator (const PrivateDataTy *P1, const PrivateDataTy *P2) |
static void | emitPrivatesInit (CodeGenFunction &CGF, const OMPExecutableDirective &D, Address KmpTaskSharedsPtr, LValue TDBase, const RecordDecl *KmpTaskTWithPrivatesQTyRD, QualType SharedsTy, QualType SharedsPtrTy, const OMPTaskDataTy &Data, ArrayRef< PrivateDataTy > Privates, bool ForDup) |
Emit initialization for private variables in task-based directives. More... | |
static bool | checkInitIsRequired (CodeGenFunction &CGF, ArrayRef< PrivateDataTy > Privates) |
Check if duplication function is required for taskloops. More... | |
static llvm::Value * | emitTaskDupFunction (CodeGenModule &CGM, SourceLocation Loc, const OMPExecutableDirective &D, QualType KmpTaskTWithPrivatesPtrQTy, const RecordDecl *KmpTaskTWithPrivatesQTyRD, const RecordDecl *KmpTaskTQTyRD, QualType SharedsTy, QualType SharedsPtrTy, const OMPTaskDataTy &Data, ArrayRef< PrivateDataTy > Privates, bool WithLastIter) |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag) More... | |
static bool | checkDestructorsRequired (const RecordDecl *KmpTaskTWithPrivatesQTyRD) |
Checks if destructor function is required to be generated. More... | |
static void | EmitOMPAggregateReduction (CodeGenFunction &CGF, QualType Type, const VarDecl *LHSVar, const VarDecl *RHSVar, const llvm::function_ref< void(CodeGenFunction &CGF, const Expr *, const Expr *, const Expr *)> &RedOpGen, const Expr *XExpr=nullptr, const Expr *EExpr=nullptr, const Expr *UpExpr=nullptr) |
Emit reduction operation for each element of array (required for array sections) LHS op = RHS. More... | |
static void | emitReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp) |
Emit reduction combiner. More... | |
static llvm::Value * | emitReductionFunction (CodeGenModule &CGM, llvm::Type *ArgsType, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps) |
static void | emitSingleReductionCombiner (CodeGenFunction &CGF, const Expr *ReductionOp, const Expr *PrivateRef, const DeclRefExpr *LHS, const DeclRefExpr *RHS) |
static RTCancelKind | getCancellationKind (OpenMPDirectiveKind CancelRegion) |
static void | getTargetEntryUniqueInfo (ASTContext &C, SourceLocation Loc, unsigned &DeviceID, unsigned &FileID, unsigned &LineNum) |
Obtain information that uniquely identifies a target entry. More... | |
static const Stmt * | ignoreCompoundStmts (const Stmt *Body) |
discard all CompoundStmts intervening between two constructs More... | |
static llvm::Value * | emitNumTeamsClauseForTargetDirective (CGOpenMPRuntime &OMPRuntime, CodeGenFunction &CGF, const OMPExecutableDirective &D) |
Emit the num_teams clause of an enclosed teams directive at the target region scope. More... | |
static llvm::Value * | emitThreadLimitClauseForTargetDirective (CGOpenMPRuntime &OMPRuntime, CodeGenFunction &CGF, const OMPExecutableDirective &D) |
Emit the thread_limit clause of an enclosed teams directive at the target region scope. More... | |
static void | emitOffloadingArrays (CodeGenFunction &CGF, llvm::Value *&BasePointersArray, llvm::Value *&PointersArray, llvm::Value *&SizesArray, llvm::Value *&MapTypesArray, MappableExprsHandler::MapValuesArrayTy &BasePointers, MappableExprsHandler::MapValuesArrayTy &Pointers, MappableExprsHandler::MapValuesArrayTy &Sizes, MappableExprsHandler::MapFlagsArrayTy &MapTypes) |
Emit the arrays used to pass the captures and map information to the offloading runtime library. More... | |
static void | emitOffloadingArraysArgument (CodeGenFunction &CGF, llvm::Value *&BasePointersArrayArg, llvm::Value *&PointersArrayArg, llvm::Value *&SizesArrayArg, llvm::Value *&MapTypesArrayArg, llvm::Value *BasePointersArray, llvm::Value *PointersArray, llvm::Value *SizesArray, llvm::Value *MapTypesArray, unsigned NumElems) |
Emit the arguments to be passed to the runtime library based on the arrays of pointers, sizes and map types. More... | |
static unsigned | evaluateCDTSize (const FunctionDecl *FD, ArrayRef< ParamAttrTy > ParamAttrs) |
static void | emitX86DeclareSimdFunction (const FunctionDecl *FD, llvm::Function *Fn, llvm::APSInt VLENVal, ArrayRef< ParamAttrTy > ParamAttrs, OMPDeclareSimdDeclAttr::BranchStateTy State) |
Variables | |
ident_t | |
enum IdentFieldIndex |
Definition at line 465 of file CGOpenMPRuntime.cpp.
enum KmpTaskTFields |
Indexes of fields for type kmp_task_t.
Definition at line 2665 of file CGOpenMPRuntime.cpp.
enum OpenMPLocationFlags |
Values for bit flags used in the ident_t to describe the fields.
All enumeric elements are named and described in accordance with the code from http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h
Definition at line 420 of file CGOpenMPRuntime.cpp.
Definition at line 5540 of file CGOpenMPRuntime.cpp.
enum OpenMPRTLFunction |
Definition at line 512 of file CGOpenMPRuntime.cpp.
enum OpenMPSchedType |
Schedule types for 'omp for' loops (these enumerators are taken from the enum sched_type in kmp.h).
Definition at line 482 of file CGOpenMPRuntime.cpp.
enum ParamKindTy |
Kind of parameter in a function with 'declare simd' directive.
Definition at line 6266 of file CGOpenMPRuntime.cpp.
enum RTCancelKind |
Definition at line 4645 of file CGOpenMPRuntime.cpp.
|
static |
Definition at line 3065 of file CGOpenMPRuntime.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::FieldDecl::Create(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::ICIS_NoInit.
Referenced by createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), createPrivatesRecordDecl(), clang::CodeGen::emitDoacrossInit(), clang::CodeGen::emitTaskCall(), clang::CodeGen::getTgtBinaryDescriptorQTy(), clang::CodeGen::getTgtDeviceImageQTy(), and clang::CodeGen::getTgtOffloadEntryQTy().
|
static |
Definition at line 2411 of file CGOpenMPRuntime.cpp.
References Modifier, OMP_sch_modifier_monotonic, OMP_sch_modifier_nonmonotonic, OMP_sch_static_balanced_chunked, OMP_sch_static_chunked, clang::OMPC_SCHEDULE_MODIFIER_last, and clang::OMPC_SCHEDULE_MODIFIER_unknown.
Referenced by clang::CodeGen::emitForDispatchInit(), and emitForStaticInitCall().
|
static |
Definition at line 3493 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Checks if destructor function is required to be generated.
Definition at line 3669 of file CGOpenMPRuntime.cpp.
References clang::RecordDecl::field_begin().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Check if duplication function is required for taskloops.
Definition at line 3577 of file CGOpenMPRuntime.cpp.
References clang::VarDecl::getAnyInitializer(), and clang::CodeGen::CodeGenFunction::isTrivialInitializer().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 834 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateStructGEP(), getOffsetOfIdentField(), and clang::Name.
Referenced by clang::CodeGen::emitUpdateLocation().
|
static |
Definition at line 3191 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getIntTypeForBitwidth(), clang::isOpenMPTaskLoopDirective(), clang::TagDecl::startDefinition(), and clang::TTK_Union.
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 3235 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenModule::getContext(), and clang::TagDecl::startDefinition().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Create a Ctor/Dtor-like function whose body is emitted through Codegen.
This is used to emit the two functions that register and unregister the descriptor of the current compilation unit.
Definition at line 2761 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenModule::CreateGlobalInitOrDestructFunction(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getTypes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::createOffloadingBinaryDescriptorRegistration().
|
static |
Definition at line 3164 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), E, clang::CodeGen::CodeGenModule::getContext(), clang::ValueDecl::getType(), I, and clang::TagDecl::startDefinition().
Referenced by createKmpTaskTWithPrivatesRecordDecl().
|
static |
Given an array of pointers to variables, project the address of a given variable.
Definition at line 2152 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getDeclAlign(), clang::CodeGen::CodeGenTypeCache::getPointerSize(), and clang::ValueDecl::getType().
Referenced by emitCopyprivateCopyFunction(), and emitReductionFunction().
|
static |
Definition at line 739 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::Create(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::OMPPrivateScope::ForceCleanup(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::emitUserDefinedReduction().
|
static |
Definition at line 2165 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::Create(), 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::CodeGenTypeCache::getPointerAlign(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), I, clang::InternalLinkage, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 3359 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Definition at line 2482 of file CGOpenMPRuntime.cpp.
References addMonoNonMonoModifier(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), OMP_dist_sch_static, OMP_dist_sch_static_chunked, OMP_ord_static, OMP_ord_static_chunked, OMP_sch_static, OMP_sch_static_balanced_chunked, and OMP_sch_static_chunked.
Referenced by clang::CodeGen::emitDistributeStaticInit(), and clang::CodeGen::emitForStaticInit().
|
static |
Emit the num_teams clause of an enclosed teams directive at the target region scope.
If there is no teams directive associated with the target directive, or if there is no num_teams clause associated with the enclosed teams directive, return nullptr.
Definition at line 4863 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::OMPExecutableDirective::getSingleClause(), ignoreCompoundStmts(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
|
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 5551 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getPointer(), clang::ArrayType::Normal, P, and S.
Referenced by clang::CodeGen::emitTargetDataCalls(), and clang::CodeGen::emitTargetDataStandAloneCall().
|
static |
Emit the arguments to be passed to the runtime library based on the arrays of pointers, sizes and map types.
Definition at line 5664 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CodeGenFunction::CGM.
Referenced by clang::CodeGen::emitTargetDataCalls(), and clang::CodeGen::emitTargetDataStandAloneCall().
|
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 4130 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsArrayTypeUnsafe(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getPointer(), and clang::ASTContext::getTypeSizeInChars().
Referenced by emitReductionFunction(), and emitSingleReductionCombiner().
|
static |
Emits code for OpenMP 'if' clause using specified CodeGen function.
Here is the logic: if (Cond) { ThenGen(); } else { ElseGen(); }
Definition at line 1892 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), and clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr().
Referenced by clang::CodeGen::emitCancelCall(), clang::CodeGen::emitTargetDataCalls(), clang::CodeGen::emitTargetDataStandAloneCall(), and clang::CodeGen::emitTaskCall().
|
static |
Emit initialization for private variables in task-based directives.
Definition at line 3499 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitAggregateAssign(), clang::CodeGen::CodeGenFunction::EmitExprAsInit(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitOMPAggregateAssign(), clang::RecordDecl::field_begin(), clang::CodeGen::OMPTaskDataTy::FirstprivateVars, clang::CodeGen::LValue::getAddress(), clang::VarDecl::getAnyInitializer(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getType(), clang::Type::isArrayType(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::lookup(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize().
Referenced by emitTaskDupFunction(), and clang::CodeGen::emitTaskInit().
|
static |
Emit a proxy function which accepts kmp_task_t as the second argument.
Definition at line 3264 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::begin(), clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::end(), 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::LValue::getPointer(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::isOpenMPTaskLoopDirective(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::ReturnValue, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::QualType::withRestrict().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
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 4204 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), and clang::CodeGen::CodeGenModule::getOpenMPRuntime().
Referenced by emitReductionFunction(), and emitSingleReductionCombiner().
|
static |
Definition at line 4221 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::Create(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), E, emitAddrOfVarFromArray(), EmitOMPAggregateReduction(), emitReductionCombiner(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::CodeGenTypeCache::getPointerSize(), clang::CodeGen::CodeGenModule::getTypes(), I, clang::InternalLinkage, clang::Type::isVariablyModifiedType(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 4309 of file CGOpenMPRuntime.cpp.
References EmitOMPAggregateReduction(), emitReductionCombiner(), clang::DeclRefExpr::getDecl(), clang::Expr::getType(), and clang::Type::isArrayType().
|
static |
Emit task_dup function (for initialization of private/firstprivate/lastprivate vars and last_iter flag)
Definition at line 3601 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::Type::castAs(), clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitPrivatesInit(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::RecordDecl::field_begin(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::OMPTaskDataTy::FirstprivateVars, clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Emit a privates mapping function for correct handling of private and firstprivate variables.
Definition at line 3415 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::ImplicitParamDecl::Create(), clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), E, clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::Address::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
Referenced by clang::CodeGen::emitTaskInit().
|
static |
Emit the thread_limit clause of an enclosed teams directive at the target region scope.
If there is no teams directive associated with the target directive, or if there is no thread_limit clause associated with the enclosed teams directive, return nullptr.
Definition at line 4912 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::CapturedStmt::getCapturedStmt(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::OMPExecutableDirective::getSingleClause(), ignoreCompoundStmts(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
|
static |
Definition at line 6328 of file CGOpenMPRuntime.cpp.
References Buffer, and evaluateCDTSize().
Referenced by clang::CodeGen::emitDeclareSimdFunction().
|
static |
Definition at line 6275 of file CGOpenMPRuntime.cpp.
References E, clang::Type::getCanonicalTypeUnqualified(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getPointerType(), clang::ASTContext::getRecordType(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), I, clang::ASTContext::IntTy, clang::QualType::isNull(), clang::Type::isRecordType(), clang::Type::isUnionType(), and clang::Type::isVoidType().
Referenced by emitX86DeclareSimdFunction().
|
static |
Definition at line 4654 of file CGOpenMPRuntime.cpp.
Referenced by clang::CodeGen::emitCancelCall(), and clang::CodeGen::emitCancellationPointCall().
|
static |
Definition at line 823 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypeCache::getPointerAlign().
Referenced by clang::CodeGen::emitUpdateLocation().
|
static |
Definition at line 826 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), and clang::CodeGen::CodeGenTypeCache::getPointerSize().
Referenced by clang::CodeGen::emitUpdateLocation().
|
static |
Definition at line 830 of file CGOpenMPRuntime.cpp.
References clang::CharUnits::fromQuantity().
Referenced by createIdentFieldGEP().
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 2363 of file CGOpenMPRuntime.cpp.
References OMP_ord_auto, OMP_ord_dynamic_chunked, OMP_ord_guided_chunked, OMP_ord_runtime, OMP_ord_static, OMP_ord_static_chunked, OMP_sch_auto, OMP_sch_dynamic_chunked, OMP_sch_guided_chunked, OMP_sch_runtime, OMP_sch_static, OMP_sch_static_chunked, and clang::OMPC_SCHEDULE_unknown.
Referenced by clang::CodeGen::emitDistributeStaticInit(), clang::CodeGen::emitForDispatchInit(), clang::CodeGen::emitForStaticInit(), clang::CodeGen::isDynamic(), and clang::CodeGen::isStaticNonchunked().
|
static |
Map the OpenMP distribute schedule to the runtime enumeration.
Definition at line 2386 of file CGOpenMPRuntime.cpp.
References OMP_dist_sch_static, and OMP_dist_sch_static_chunked.
|
static |
Obtain information that uniquely identifies a target entry.
This consists of the file and device IDs as well as line number associated with the relevant entry source location.
Definition at line 4753 of file CGOpenMPRuntime.cpp.
References clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), ID, clang::SourceLocation::isFileID(), clang::SourceLocation::isValid(), and SM.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), and clang::CodeGen::scanForTargetRegionsFunctions().
discard all CompoundStmts intervening between two constructs
Definition at line 4851 of file CGOpenMPRuntime.cpp.
Referenced by emitNumTeamsClauseForTargetDirective(), and emitThreadLimitClauseForTargetDirective().
ident_t |
Definition at line 464 of file CGOpenMPRuntime.cpp.