clang
3.9.0
|
#include "CGCleanup.h"
#include "CGOpenMPRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/DeclOpenMP.h"
#include "llvm/IR/CallSite.h"
Go to the source code of this file.
Functions | |
static Address | castValueFromUintptr (CodeGenFunction &CGF, QualType DstType, StringRef Name, LValue AddrLV, bool isReferenceType=false) |
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. More... | |
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, const Expr *Init, Address SrcAddr=Address::invalid()) |
Emit initialization of arrays of complex types. More... | |
static Address | castToBase (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, LValue BaseLV, llvm::Value *Addr) |
static LValue | loadToBegin (CodeGenFunction &CGF, QualType BaseTy, QualType ElTy, LValue BaseLV) |
static void | emitPostUpdateForReductionClause (CodeGenFunction &CGF, const OMPExecutableDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> &CondGen) |
static void | emitCommonOMPParallelDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) |
static void | emitAlignedClause (CodeGenFunction &CGF, const OMPExecutableDirective &D) |
static void | emitPreCond (CodeGenFunction &CGF, const OMPLoopDirective &S, const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount) |
static void | emitSimdlenSafelenClause (CodeGenFunction &CGF, const OMPExecutableDirective &D, bool IsMonotonic) |
static LValue | EmitOMPHelperVar (CodeGenFunction &CGF, const DeclRefExpr *Helper) |
Emit a helper variable and return corresponding lvalue. More... | |
static LValue | createSectionLVal (CodeGenFunction &CGF, QualType Ty, const Twine &Name, llvm::Value *Init=nullptr) |
static llvm::Function * | emitOutlinedOrderedFunction (CodeGenModule &CGM, const CapturedStmt *S) |
static llvm::Value * | convertToScalarValue (CodeGenFunction &CGF, RValue Val, QualType SrcType, QualType DestType, SourceLocation Loc) |
static CodeGenFunction::ComplexPairTy | convertToComplexValue (CodeGenFunction &CGF, RValue Val, QualType SrcType, QualType DestType, SourceLocation Loc) |
static void | emitSimpleAtomicStore (CodeGenFunction &CGF, bool IsSeqCst, LValue LVal, RValue RVal) |
static void | EmitOMPAtomicReadExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *V, SourceLocation Loc) |
static void | EmitOMPAtomicWriteExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *E, SourceLocation Loc) |
static std::pair< bool, RValue > | emitOMPAtomicRMW (CodeGenFunction &CGF, LValue X, RValue Update, BinaryOperatorKind BO, llvm::AtomicOrdering AO, bool IsXLHSInRHSPart) |
static void | EmitOMPAtomicUpdateExpr (CodeGenFunction &CGF, bool IsSeqCst, const Expr *X, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc) |
static RValue | convertToType (CodeGenFunction &CGF, RValue Value, QualType SourceType, QualType ResType, SourceLocation Loc) |
static void | EmitOMPAtomicCaptureExpr (CodeGenFunction &CGF, bool IsSeqCst, bool IsPostfixUpdate, const Expr *V, const Expr *X, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc) |
static void | EmitOMPAtomicExpr (CodeGenFunction &CGF, OpenMPClauseKind Kind, bool IsSeqCst, bool IsPostfixUpdate, const Expr *X, const Expr *V, const Expr *E, const Expr *UE, bool IsXLHSInRHSPart, SourceLocation Loc) |
static void | emitCommonOMPTeamsDirective (CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) |
static void | mapParam (CodeGenFunction &CGF, const DeclRefExpr *Helper, const ImplicitParamDecl *PVD, CodeGenFunction::OMPPrivateScope &Privates) |
Emit a helper variable and return corresponding lvalue. More... | |
|
static |
Definition at line 886 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::getPointer(), clang::ASTContext::hasSameType(), clang::CodeGen::Address::invalid(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::CodeGen::Address::isValid(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
static |
Definition at line 172 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getLValueReferenceType(), clang::CodeGen::Address::getPointer(), clang::ASTContext::getPointerType(), clang::ASTContext::getUIntPtrType(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction().
|
static |
Definition at line 2795 of file CGStmtOpenMP.cpp.
References clang::Type::castAs(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::RValue::getComplexVal(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::RValue::isComplex(), clang::CodeGen::RValue::isScalar(), and clang::CodeGen::TEK_Complex.
Referenced by convertToType(), and clang::CodeGen::CodeGenFunction::emitOMPSimpleStore().
|
static |
Definition at line 2781 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::EmitComplexToScalarConversion(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::RValue::getComplexVal(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::CodeGenFunction::hasScalarEvaluationKind(), clang::CodeGen::RValue::isAggregate(), and clang::CodeGen::RValue::isScalar().
Referenced by convertToType(), and clang::CodeGen::CodeGenFunction::emitOMPSimpleStore().
|
static |
Definition at line 3041 of file CGStmtOpenMP.cpp.
References convertToComplexValue(), convertToScalarValue(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getComplex(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, and clang::CodeGen::TEK_Scalar.
Referenced by EmitOMPAtomicCaptureExpr().
|
static |
Definition at line 2144 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
|
static |
Definition at line 1391 of file CGStmtOpenMP.cpp.
References E, clang::CodeGen::CodeGenFunction::EmitAlignmentAssumption(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::OMPExecutableDirective::getClausesOfKind(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getOpenMPDefaultSimdAlign(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective().
|
static |
Definition at line 1190 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::OMPExecutableDirective::getClausesOfKind(), clang::OMPExecutableDirective::getLocStart(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::OMPExecutableDirective::getSingleClause(), and clang::OMPD_unknown.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelForSimdDirective(), and clang::CodeGen::CodeGenFunction::EmitOMPParallelSectionsDirective().
|
static |
Definition at line 3317 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::OMPExecutableDirective::getLocStart(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and S.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPTeamsDirective().
|
static |
Definition at line 397 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLoadOfComplex(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenModule::EmitNullConstant(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getAggregate(), clang::CodeGen::RValue::getComplex(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::OMPDeclareReductionDecl::getInitializer(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::QualType::getQualifiers(), clang::Expr::IgnoreParenImpCasts(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, clang::CodeGen::TEK_Scalar, and clang::VK_RValue.
Referenced by EmitOMPAggregateInit(), and clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
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 451 of file CGStmtOpenMP.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), 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(), getReductionInit(), clang::ASTContext::getTypeSizeInChars(), and clang::CodeGen::Address::invalid().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
static |
Definition at line 3058 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, convertToType(), clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitOMPAtomicSimpleUpdateExpr(), clang::CodeGen::CodeGenFunction::emitOMPSimpleStore(), clang::QualType::getNonReferenceType(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Expr::isLValue(), and clang::None.
Referenced by EmitOMPAtomicExpr().
|
static |
Definition at line 3139 of file CGStmtOpenMP.cpp.
References EmitOMPAtomicCaptureExpr(), EmitOMPAtomicReadExpr(), EmitOMPAtomicUpdateExpr(), EmitOMPAtomicWriteExpr(), clang::OMPC_threadprivate, clang::OMPC_uniform, and clang::OMPC_unknown.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().
|
static |
Definition at line 2849 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitAtomicLoad(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::emitOMPSimpleStore(), clang::QualType::getNonReferenceType(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::Expr::getType(), clang::Expr::isLValue(), and clang::None.
Referenced by EmitOMPAtomicExpr().
|
static |
Definition at line 2887 of file CGStmtOpenMP.cpp.
References clang::prec::And, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, Context, clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::Address::getElementType(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::RValue::getScalarVal(), clang::ASTContext::getTargetInfo(), clang::CodeGen::LValue::getType(), clang::ASTContext::getTypeSize(), clang::TargetInfo::hasBuiltinAtomic(), clang::Type::hasSignedIntegerRepresentation(), clang::CodeGen::RValue::isScalar(), clang::CodeGen::LValue::isSimple(), and clang::ASTContext::toBits().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicSimpleUpdateExpr().
|
static |
Definition at line 3003 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitOMPAtomicSimpleUpdateExpr(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::Expr::IgnoreImpCasts(), clang::Expr::isLValue(), and clang::None.
Referenced by EmitOMPAtomicExpr().
|
static |
Definition at line 2873 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), emitSimpleAtomicStore(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), clang::Expr::isLValue(), and clang::None.
Referenced by EmitOMPAtomicExpr().
|
static |
Emit a helper variable and return corresponding lvalue.
Definition at line 1917 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), and clang::DeclRefExpr::getDecl().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPDistributeLoop().
|
static |
Definition at line 2746 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::CapturedStmtInfo, and clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPOrderedDirective().
|
static |
Definition at line 1165 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::OMPExecutableDirective::getClausesOfKind(), and clang::CodeGen::CodeGenFunction::HaveInsertPoint().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), and clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective().
|
static |
Definition at line 1456 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitOMPPrivateLoopCounters(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), I, clang::OMPLoopDirective::inits(), and clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPDistributeLoop(), clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective(), and clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective().
|
static |
Definition at line 1508 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::RValue::getScalarVal(), clang::OMPExecutableDirective::getSingleClause(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), clang::CodeGen::AggValueSlot::ignored(), clang::CodeGen::CodeGenFunction::LoopStack, clang::CodeGen::LoopInfoStack::setParallel(), and clang::CodeGen::LoopInfoStack::setVectorizeWidth().
|
static |
Definition at line 2819 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::EmitAtomicStore(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), clang::CodeGen::LValue::isGlobalReg(), and clang::CodeGen::LValue::isVolatile().
Referenced by EmitOMPAtomicWriteExpr().
|
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 387 of file CGStmtOpenMP.cpp.
Referenced by EmitOMPAggregateInit(), and clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
static |
Definition at line 913 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast(), clang::CodeGen::CodeGenFunction::EmitLoadOfPointerLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::LValue::getAlignmentSource(), clang::Type::getAs(), clang::CodeGen::CodeGenFunction::getContext(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::LValue::getType(), clang::ASTContext::hasSameType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().
|
static |
Emit a helper variable and return corresponding lvalue.
Definition at line 3467 of file CGStmtOpenMP.cpp.
References clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), and clang::DeclRefExpr::getDecl().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective().