clang
3.7.0
|
#include "CGOpenMPRuntime.h"
#include "CodeGenFunction.h"
#include "CGCleanup.h"
#include "clang/AST/Decl.h"
#include "clang/AST/StmtOpenMP.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
Go to the source code of this file.
Enumerations | |
enum | OpenMPSchedType { OMP_sch_lower = 32, OMP_sch_static_chunked = 33, OMP_sch_static = 34, OMP_sch_dynamic_chunked = 35, OMP_sch_guided_chunked = 36, OMP_sch_runtime = 37, OMP_sch_auto = 38, OMP_ord_lower = 64, OMP_ord_static_chunked = 65, OMP_ord_static = 66, OMP_ord_dynamic_chunked = 67, OMP_ord_guided_chunked = 68, OMP_ord_runtime = 69, OMP_ord_auto = 70, OMP_sch_default = OMP_sch_static } |
Schedule types for 'omp for' loops (these enumerators are taken from the enum sched_type in kmp.h). More... | |
enum | KmpTaskTFields |
Indexes of fields for type kmp_task_t. More... | |
enum | RTCancelKind |
Functions | |
static void | emitOMPIfClause (CodeGenFunction &CGF, const Expr *Cond, const RegionCodeGenTy &ThenGen, const RegionCodeGenTy &ElseGen) |
Emits code for OpenMP 'if' clause using specified CodeGen function. Here is the logic: if (Cond) { ThenGen(); } else { ElseGen(); }. More... | |
static void | emitIfStmt (CodeGenFunction &CGF, llvm::Value *IfCond, OpenMPDirectiveKind Kind, const RegionCodeGenTy &BodyOpGen) |
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 void | addFieldToRecordDecl (ASTContext &C, DeclContext *DC, QualType FieldTy) |
static RecordDecl * | createPrivatesRecordDecl (CodeGenModule &CGM, const ArrayRef< PrivateDataTy > Privates) |
static RecordDecl * | createKmpTaskTRecordDecl (CodeGenModule &CGM, QualType KmpInt32Ty, QualType KmpRoutineEntryPointerQTy) |
static RecordDecl * | createKmpTaskTWithPrivatesRecordDecl (CodeGenModule &CGM, QualType KmpTaskTQTy, const ArrayRef< PrivateDataTy > Privates) |
static llvm::Value * | emitProxyTaskFunction (CodeGenModule &CGM, SourceLocation Loc, 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, const ArrayRef< const Expr * > PrivateVars, const ArrayRef< const Expr * > FirstprivateVars, QualType PrivatesQTy, const 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 llvm::Value * | emitReductionFunction (CodeGenModule &CGM, llvm::Type *ArgsType, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps) |
static RTCancelKind | getCancellationKind (OpenMPDirectiveKind CancelRegion) |
enum KmpTaskTFields |
Indexes of fields for type kmp_task_t.
Definition at line 1778 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 1571 of file CGOpenMPRuntime.cpp.
enum RTCancelKind |
Definition at line 2746 of file CGOpenMPRuntime.cpp.
|
static |
Definition at line 1802 of file CGOpenMPRuntime.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::FieldDecl::Create(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ICIS_NoInit, and clang::Decl::setAccess().
Referenced by createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), and createPrivatesRecordDecl().
|
static |
Definition at line 2092 of file CGOpenMPRuntime.cpp.
|
static |
Definition at line 1847 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::CodeGen::CodeGenModule::getContext(), and clang::TagDecl::startDefinition().
|
static |
Definition at line 1867 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenModule::getContext(), and clang::TagDecl::startDefinition().
|
static |
Definition at line 1826 of file CGOpenMPRuntime.cpp.
References addFieldToRecordDecl(), clang::ASTContext::buildImplicitRecord(), clang::CodeGen::CodeGenModule::getContext(), and clang::TagDecl::startDefinition().
Referenced by createKmpTaskTWithPrivatesRecordDecl().
|
static |
Definition at line 1355 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, AttributeLangSupport::C, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), 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::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 1963 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), 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::MakeNaturalAlignAddrLValue(), clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 1286 of file CGOpenMPRuntime.cpp.
References clang::ASTContext::BoolTy, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), and clang::CodeGen::CodeGenModule::getOpenMPRuntime().
|
static |
Emits code for OpenMP 'if' clause using specified CodeGen function. Here is the logic: if (Cond) { ThenGen(); } else { ElseGen(); }.
Definition at line 1099 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), and clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr().
|
static |
Emit a proxy function which accepts kmp_task_t as the second argument.
Definition at line 1894 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::Type::getAsTagDecl(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenFunction::ReturnValue, clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
|
static |
Definition at line 2440 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenTypes::arrangeFreeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::Create(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::OMPPrivateScope::ForceCleanup(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Emit a privates mapping function for correct handling of private and firstprivate variables.
Definition at line 2019 of file CGOpenMPRuntime.cpp.
References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::Builder, clang::ImplicitParamDecl::Create(), clang::Create(), clang::CodeGen::CodeGenFunction::disableDebugInfo(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), 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::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::InternalLinkage, clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 2755 of file CGOpenMPRuntime.cpp.
|
static |
Map the OpenMP loop schedule to the runtime enumeration.
Definition at line 1592 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::isDynamic(), and clang::isStaticNonchunked().