Lines Matching defs:CodeGenFunction
15 #include "CodeGenFunction.h"
51 class OMPLexicalScope : public CodeGenFunction::LexicalScope {
52 void emitPreInitStmt(CodeGenFunction &CGF, const OMPExecutableDirective &S) {
61 CodeGenFunction::AutoVarEmission Emission =
70 CodeGenFunction::OMPPrivateScope InlinedShareds;
72 static bool isCapturedVar(CodeGenFunction &CGF, const VarDecl *VD) {
81 CodeGenFunction &CGF, const OMPExecutableDirective &S,
84 : CodeGenFunction::LexicalScope(CGF, S.getSourceRange()),
121 OMPParallelScope(CodeGenFunction &CGF, const OMPExecutableDirective &S)
136 OMPTeamsScope(CodeGenFunction &CGF, const OMPExecutableDirective &S)
143 class OMPLoopScope : public CodeGenFunction::RunCleanupsScope {
144 void emitPreInitStmt(CodeGenFunction &CGF, const OMPLoopBasedDirective &S) {
146 CodeGenFunction::OMPMapVars PreCondVars;
223 OMPLoopScope(CodeGenFunction &CGF, const OMPLoopBasedDirective &S)
224 : CodeGenFunction::RunCleanupsScope(CGF) {
229 class OMPSimdLexicalScope : public CodeGenFunction::LexicalScope {
230 CodeGenFunction::OMPPrivateScope InlinedShareds;
232 static bool isCapturedVar(CodeGenFunction &CGF, const VarDecl *VD) {
240 OMPSimdLexicalScope(CodeGenFunction &CGF, const OMPExecutableDirective &S)
241 : CodeGenFunction::LexicalScope(CGF, S.getSourceRange()),
251 CodeGenFunction::AutoVarEmission Emission =
312 static void emitCommonOMPTargetDirective(CodeGenFunction &CGF,
316 LValue CodeGenFunction::EmitOMPSharedLValue(const Expr *E) {
332 llvm::Value *CodeGenFunction::getTypeSize(QualType Ty) {
352 void CodeGenFunction::GenerateOpenMPCapturedVars(
399 static Address castValueFromUintptr(CodeGenFunction &CGF, SourceLocation Loc,
454 CodeGenFunction &CGF, FunctionArgList &Args,
638 CodeGenFunction::GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S,
659 CodeGenFunction::OMPPrivateScope LocalScope(*this);
679 CodeGenFunction WrapperCGF(CGM, /*suppressNewContext=*/true);
722 void CodeGenFunction::EmitOMPAggregateAssign(
787 void CodeGenFunction::EmitOMPCopy(QualType OriginalType, Address DestAddr,
806 CodeGenFunction::OMPPrivateScope Remap(*this);
815 CodeGenFunction::OMPPrivateScope Remap(*this);
824 bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D,
968 void CodeGenFunction::EmitOMPPrivateClause(
970 CodeGenFunction::OMPPrivateScope &PrivateScope) {
993 bool CodeGenFunction::EmitOMPCopyinClause(const OMPExecutableDirective &D) {
1065 bool CodeGenFunction::EmitOMPLastprivateClauseInit(
1128 void CodeGenFunction::EmitOMPLastprivateClauseFinal(
1219 void CodeGenFunction::EmitOMPReductionClauseInit(
1221 CodeGenFunction::OMPPrivateScope &PrivateScope, bool ForInscan) {
1263 [&Emission](CodeGenFunction &CGF) {
1429 void CodeGenFunction::EmitOMPReductionClauseFinal(
1473 CodeGenFunction &CGF, const OMPExecutableDirective &D,
1474 const llvm::function_ref<llvm::Value *(CodeGenFunction &)> CondGen) {
1501 typedef llvm::function_ref<void(CodeGenFunction &,
1508 checkForLastprivateConditionalUpdate(CodeGenFunction &CGF,
1565 CodeGenFunction &CGF, const OMPExecutableDirective &S,
1575 CodeGenFunction::RunCleanupsScope NumThreadsScope(CGF);
1582 CodeGenFunction::RunCleanupsScope ProcBindScope(CGF);
1618 static void emitEmptyBoundParameters(CodeGenFunction &,
1622 static void emitOMPCopyinClause(CodeGenFunction &CGF,
1635 Address CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(
1636 CodeGenFunction &CGF, const VarDecl *VD) {
1685 Address CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(
1686 CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr,
1708 std::string CodeGenFunction::OMPBuilderCBHelpers::getNameWithSeparators(
1720 void CodeGenFunction::OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
1721 CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP,
1737 void CodeGenFunction::OMPBuilderCBHelpers::EmitOMPOutlinedRegionBody(
1738 CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP,
1754 void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
1803 CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(*this, &CGSI);
1813 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
1830 [](CodeGenFunction &) { return nullptr; });
1836 void CodeGenFunction::EmitOMPMetaDirective(const OMPMetaDirective &S) {
1844 CodeGenFunction::CGCapturedStmtInfo *CGSI = nullptr;
1845 CodeGenFunction::CGCapturedStmtRAII *CapInfoRAII = nullptr;
1853 OMPTransformDirectiveScopeRAII(CodeGenFunction &CGF, const Stmt *S) {
1856 CGSI = new CodeGenFunction::CGCapturedStmtInfo(CR_OpenMP);
1857 CapInfoRAII = new CodeGenFunction::CGCapturedStmtRAII(CGF, CGSI);
1870 static void emitBody(CodeGenFunction &CGF, const Stmt *S, const Stmt *NextLoop,
1880 CodeGenFunction::LexicalScope Scope(CGF, S->getSourceRange());
1909 void CodeGenFunction::EmitOMPLoopBody(const OMPLoopDirective &D,
1981 static EmittedClosureTy emitCapturedStmtFunc(CodeGenFunction &ParentCGF,
1984 CodeGenFunction CGF(ParentCGF.CGM, /*suppressNewContext=*/true);
1985 std::unique_ptr<CodeGenFunction::CGCapturedStmtInfo> CSI =
1986 std::make_unique<CodeGenFunction::CGCapturedStmtInfo>(*S);
1987 CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(CGF, CSI.get());
1995 emitCapturedStmtCall(CodeGenFunction &ParentCGF, EmittedClosureTy Cap,
2007 CodeGenFunction::EmitOMPCollapsedCanonicalLoopNest(const Stmt *S, int Depth) {
2033 void CodeGenFunction::EmitOMPCanonicalLoop(const OMPCanonicalLoop *S) {
2108 void CodeGenFunction::EmitOMPInnerLoop(
2111 const llvm::function_ref<void(CodeGenFunction &)> BodyGen,
2112 const llvm::function_ref<void(CodeGenFunction &)> PostIncGen) {
2169 bool CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) {
2207 void CodeGenFunction::EmitOMPLinearClauseFinal(
2209 const llvm::function_ref<llvm::Value *(CodeGenFunction &)> CondGen) {
2232 CodeGenFunction::OMPPrivateScope VarScope(*this);
2245 static void emitAlignedClause(CodeGenFunction &CGF,
2280 void CodeGenFunction::EmitOMPPrivateLoopCounters(
2281 const OMPLoopDirective &S, CodeGenFunction::OMPPrivateScope &LoopScope) {
2322 static void emitPreCond(CodeGenFunction &CGF, const OMPLoopDirective &S,
2328 CodeGenFunction::OMPPrivateScope PreCondScope(CGF);
2338 CodeGenFunction::OMPMapVars PreCondVars;
2360 void CodeGenFunction::EmitOMPLinearClause(
2361 const OMPLoopDirective &D, CodeGenFunction::OMPPrivateScope &PrivateScope) {
2394 static void emitSimdlenSafelenClause(CodeGenFunction &CGF,
2419 void CodeGenFunction::EmitOMPSimdInit(const OMPLoopDirective &D) {
2438 void CodeGenFunction::EmitOMPSimdFinal(
2440 const llvm::function_ref<llvm::Value *(CodeGenFunction &)> CondGen) {
2483 static void emitOMPLoopBodyWithStopPoint(CodeGenFunction &CGF,
2485 CodeGenFunction::JumpDest LoopExit) {
2491 static LValue EmitOMPHelperVar(CodeGenFunction &CGF,
2498 static void emitCommonSimdLoop(CodeGenFunction &CGF, const OMPLoopDirective &S,
2501 auto &&ThenGen = [&S, &SimdInitGen, &BodyCodeGen](CodeGenFunction &CGF,
2504 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
2509 auto &&ElseGen = [&BodyCodeGen](CodeGenFunction &CGF, PrePostActionTy &) {
2510 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
2534 static void emitOMPSimdRegion(CodeGenFunction &CGF, const OMPLoopDirective &S,
2587 CodeGenFunction::OMPPrivateScope LoopScope(CGF);
2601 [&S](CodeGenFunction &CGF, PrePostActionTy &) {
2604 [&S, &LoopScope](CodeGenFunction &CGF, PrePostActionTy &) {
2607 [&S](CodeGenFunction &CGF) {
2609 CodeGenFunction::JumpDest());
2611 [](CodeGenFunction &) {});
2613 CGF.EmitOMPSimdFinal(S, [](CodeGenFunction &) { return nullptr; });
2619 [](CodeGenFunction &) { return nullptr; });
2621 CGF.EmitOMPLinearClauseFinal(S, [](CodeGenFunction &) { return nullptr; });
2662 GetAlignedMapping(const OMPSimdDirective &S, CodeGenFunction &CGF) {
2692 void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) {
2696 auto &&CodeGenIRBuilder = [this, &S, UseOMPIRBuilder](CodeGenFunction &CGF,
2751 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
2764 void CodeGenFunction::EmitOMPTileDirective(const OMPTileDirective &S) {
2770 void CodeGenFunction::EmitOMPReverseDirective(const OMPReverseDirective &S) {
2776 void CodeGenFunction::EmitOMPInterchangeDirective(
2783 void CodeGenFunction::EmitOMPUnrollDirective(const OMPUnrollDirective &S) {
2845 void CodeGenFunction::EmitOMPOuterLoop(
2847 CodeGenFunction::OMPPrivateScope &LoopScope,
2848 const CodeGenFunction::OMPLoopArguments &LoopArgs,
2849 const CodeGenFunction::CodeGenLoopTy &CodeGenLoop,
2850 const CodeGenFunction::CodeGenOrderedTy &CodeGenOrdered) {
2908 [&S, IsMonotonic](CodeGenFunction &CGF, PrePostActionTy &) {
2921 &LoopScope](CodeGenFunction &CGF, PrePostActionTy &) {
2930 [&S, LoopExit, &CodeGenLoop](CodeGenFunction &CGF) {
2933 [IVSize, IVSigned, Loc, &CodeGenOrdered](CodeGenFunction &CGF) {
2953 auto &&CodeGen = [DynamicOrOrdered, &S, &LoopArgs](CodeGenFunction &CGF) {
2961 void CodeGenFunction::EmitOMPForOuterLoop(
3048 auto &&CodeGenOrdered = [Ordered](CodeGenFunction &CGF, SourceLocation Loc,
3072 static void emitEmptyOrdered(CodeGenFunction &, SourceLocation Loc,
3075 void CodeGenFunction::EmitOMPDistributeOuterLoop(
3137 emitDistributeParallelForInnerBounds(CodeGenFunction &CGF,
3180 emitDistributeParallelForDispatchBounds(CodeGenFunction &CGF,
3198 CodeGenFunction &CGF, const OMPExecutableDirective &S,
3215 emitInnerParallelForWhenCombined(CodeGenFunction &CGF,
3217 CodeGenFunction::JumpDest LoopExit) {
3218 auto &&CGInlinedWorksharingLoop = [&S](CodeGenFunction &CGF,
3231 CodeGenFunction::OMPCancelStackRAII CancelRegion(CGF, S.getDirectiveKind(),
3245 void CodeGenFunction::EmitOMPDistributeParallelForDirective(
3247 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
3255 void CodeGenFunction::EmitOMPDistributeParallelForSimdDirective(
3257 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
3265 void CodeGenFunction::EmitOMPDistributeSimdDirective(
3267 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
3274 void CodeGenFunction::EmitOMPTargetSimdDeviceFunction(
3277 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
3288 void CodeGenFunction::EmitOMPTargetSimdDirective(
3290 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
3308 bool CodeGenFunction::EmitOMPWorksharingLoop(
3445 [&S](CodeGenFunction &CGF, PrePostActionTy &) {
3455 &LoopScope](CodeGenFunction &CGF, PrePostActionTy &) {
3491 [&S, LoopExit](CodeGenFunction &CGF) {
3494 [](CodeGenFunction &) {});
3498 auto &&CodeGen = [&S](CodeGenFunction &CGF) {
3514 EmitOMPSimdFinal(S, [IL, &S](CodeGenFunction &CGF) {
3525 *this, S, [IL, &S](CodeGenFunction &CGF) {
3535 EmitOMPLinearClauseFinal(S, [IL, &S](CodeGenFunction &CGF) {
3554 emitForLoopBounds(CodeGenFunction &CGF, const OMPExecutableDirective &S) {
3568 emitDispatchForLoopBounds(CodeGenFunction &CGF, const OMPExecutableDirective &S,
3586 CodeGenFunction &CGF, const OMPLoopDirective &S,
3587 llvm::function_ref<llvm::Value *(CodeGenFunction &)> NumIteratorsGen) {
3618 CodeGenFunction::OpaqueValueMapping DimMapping(
3638 CodeGenFunction &CGF, const OMPLoopDirective &S,
3639 llvm::function_ref<llvm::Value *(CodeGenFunction &)> NumIteratorsGen) {
3668 CodeGenFunction::OpaqueValueMapping IdxMapping(
3702 CodeGenFunction &CGF, const OMPLoopDirective &S,
3703 llvm::function_ref<llvm::Value *(CodeGenFunction &)> NumIteratorsGen,
3704 llvm::function_ref<void(CodeGenFunction &)> FirstGen,
3705 llvm::function_ref<void(CodeGenFunction &)> SecondGen) {
3723 CodeGenFunction::ParentLoopDirectiveForScanRegion ScanRegion(CGF, S);
3732 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
3738 &Privates](CodeGenFunction &CGF, PrePostActionTy &Action) {
3775 CodeGenFunction::OMPPrivateScope PrivScope(CGF);
3783 CodeGenFunction::OpaqueValueMapping IdxMapping(
3794 CodeGenFunction::OpaqueValueMapping IdxMapping(
3842 static bool emitWorksharingDirective(CodeGenFunction &CGF,
3850 const auto &&NumIteratorsGen = [&S](CodeGenFunction &CGF) {
3851 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
3855 const auto &&FirstGen = [&S, HasCancel](CodeGenFunction &CGF) {
3856 CodeGenFunction::OMPCancelStackRAII CancelRegion(
3866 &HasLastprivates](CodeGenFunction &CGF) {
3867 CodeGenFunction::OMPCancelStackRAII CancelRegion(
3879 CodeGenFunction::OMPCancelStackRAII CancelRegion(CGF, S.getDirectiveKind(),
3937 void CodeGenFunction::EmitOMPForDirective(const OMPForDirective &S) {
3942 UseOMPIRBuilder](CodeGenFunction &CGF, PrePostActionTy &) {
3992 void CodeGenFunction::EmitOMPForSimdDirective(const OMPForSimdDirective &S) {
3994 auto &&CodeGen = [&S, &HasLastprivates](CodeGenFunction &CGF,
4012 static LValue createSectionLVal(CodeGenFunction &CGF, QualType Ty,
4021 void CodeGenFunction::EmitSections(const OMPExecutableDirective &S) {
4026 &HasLastprivates](CodeGenFunction &CGF, PrePostActionTy &) {
4045 CodeGenFunction::OpaqueValueMapping OpaqueIV(CGF, &IVRefExpr, IV);
4047 CodeGenFunction::OpaqueValueMapping OpaqueUB(CGF, &UBRefExpr, UB);
4056 auto &&BodyGen = [CapturedStmt, CS, &S, &IV](CodeGenFunction &CGF) {
4092 CodeGenFunction::OMPPrivateScope LoopScope(CGF);
4126 [](CodeGenFunction &) {});
4128 auto &&CodeGen = [&S](CodeGenFunction &CGF) {
4135 emitPostUpdateForReductionClause(CGF, S, [IL, &S](CodeGenFunction &CGF) {
4167 void CodeGenFunction::EmitOMPSectionsDirective(const OMPSectionsDirective &S) {
4213 CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(*this, &CGSI);
4236 void CodeGenFunction::EmitOMPSectionDirective(const OMPSectionDirective &S) {
4263 void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) {
4281 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4308 static void emitMaster(CodeGenFunction &CGF, const OMPExecutableDirective &S) {
4309 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4316 void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) {
4344 static void emitMasked(CodeGenFunction &CGF, const OMPExecutableDirective &S) {
4345 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4356 void CodeGenFunction::EmitOMPMaskedDirective(const OMPMaskedDirective &S) {
4391 void CodeGenFunction::EmitOMPCriticalDirective(const OMPCriticalDirective &S) {
4428 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4442 void CodeGenFunction::EmitOMPParallelForDirective(
4446 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4452 const auto &&NumIteratorsGen = [&S](CodeGenFunction &CGF) {
4453 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
4455 CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(CGF, &CGSI);
4476 void CodeGenFunction::EmitOMPParallelForSimdDirective(
4480 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4486 const auto &&NumIteratorsGen = [&S](CodeGenFunction &CGF) {
4487 CodeGenFunction::OMPLocalDeclMapRAII Scope(CGF);
4489 CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(CGF, &CGSI);
4510 void CodeGenFunction::EmitOMPParallelMasterDirective(
4514 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4531 [](CodeGenFunction &) { return nullptr; });
4537 void CodeGenFunction::EmitOMPParallelMaskedDirective(
4541 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4558 [](CodeGenFunction &) { return nullptr; });
4564 void CodeGenFunction::EmitOMPParallelSectionsDirective(
4568 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
4653 void CodeGenFunction::EmitOMPTaskBasedDirective(
4757 CapturedRegion](CodeGenFunction &CGF,
5070 void CodeGenFunction::EmitOMPTargetTaskBasedDirective(
5143 &InputInfo](CodeGenFunction &CGF, PrePostActionTy &Action) {
5217 void CodeGenFunction::processInReduction(const OMPExecutableDirective &S,
5219 CodeGenFunction &CGF,
5304 void CodeGenFunction::EmitOMPTaskDirective(const OMPTaskDirective &S) {
5321 auto &&BodyGen = [CS](CodeGenFunction &CGF, PrePostActionTy &) {
5325 IfCond](CodeGenFunction &CGF, llvm::Function *OutlinedFn,
5336 void CodeGenFunction::EmitOMPTaskyieldDirective(
5341 void CodeGenFunction::EmitOMPErrorDirective(const OMPErrorDirective &S) {
5351 void CodeGenFunction::EmitOMPBarrierDirective(const OMPBarrierDirective &S) {
5355 void CodeGenFunction::EmitOMPTaskwaitDirective(const OMPTaskwaitDirective &S) {
5367 void CodeGenFunction::EmitOMPTaskgroupDirective(
5381 CodeGenFunction::CGCapturedStmtInfo CapStmtInfo;
5387 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
5415 void CodeGenFunction::EmitOMPFlushDirective(const OMPFlushDirective &S) {
5430 void CodeGenFunction::EmitOMPDepobjDirective(const OMPDepobjDirective &S) {
5453 void CodeGenFunction::EmitOMPScanDirective(const OMPScanDirective &S) {
5653 void CodeGenFunction::EmitOMPDistributeLoop(const OMPLoopDirective &S,
5817 [&S](CodeGenFunction &CGF, PrePostActionTy &) {
5822 StaticChunked](CodeGenFunction &CGF, PrePostActionTy &) {
5825 [&S, LoopExit, &CodeGenLoop](CodeGenFunction &CGF) {
5828 [&S, StaticChunked](CodeGenFunction &CGF) {
5850 EmitOMPSimdFinal(S, [IL, &S](CodeGenFunction &CGF) {
5861 *this, S, [IL, &S](CodeGenFunction &CGF) {
5882 void CodeGenFunction::EmitOMPDistributeDirective(
5884 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
5894 CodeGenFunction CGF(CGM, /*suppressNewContext=*/true);
5895 CodeGenFunction::CGCapturedStmtInfo CapStmtInfo;
5903 static void emitRestoreIP(CodeGenFunction &CGF, const T *C,
5926 void CodeGenFunction::EmitOMPOrderedDirective(const OMPOrderedDirective &S) {
5996 auto &&CodeGen = [&S, C, this](CodeGenFunction &CGF,
6015 static llvm::Value *convertToScalarValue(CodeGenFunction &CGF, RValue Val,
6027 static CodeGenFunction::ComplexPairTy
6028 convertToComplexValue(CodeGenFunction &CGF, RValue Val, QualType SrcType,
6032 CodeGenFunction::ComplexPairTy ComplexVal;
6039 ComplexVal = CodeGenFunction::ComplexPairTy(
6054 static void emitSimpleAtomicStore(CodeGenFunction &CGF, llvm::AtomicOrdering AO,
6062 static RValue emitSimpleAtomicLoad(CodeGenFunction &CGF,
6072 void CodeGenFunction::emitOMPSimpleStore(LValue LVal, RValue RVal,
6090 static void emitOMPAtomicReadExpr(CodeGenFunction &CGF, llvm::AtomicOrdering AO,
6121 static void emitOMPAtomicWriteExpr(CodeGenFunction &CGF,
6148 static std::pair<bool, RValue> emitOMPAtomicRMW(CodeGenFunction &CGF, LValue X,
6266 std::pair<bool, RValue> CodeGenFunction::EmitOMPAtomicSimpleUpdateExpr(
6290 static void emitOMPAtomicUpdateExpr(CodeGenFunction &CGF,
6311 CodeGenFunction::OpaqueValueMapping MapExpr(CGF, ERValExpr, ExprRValue);
6312 CodeGenFunction::OpaqueValueMapping MapX(CGF, XRValExpr, XRValue);
6338 static RValue convertToType(CodeGenFunction &CGF, RValue Value,
6355 static void emitOMPAtomicCaptureExpr(CodeGenFunction &CGF,
6386 CodeGenFunction::OpaqueValueMapping MapExpr(CGF, ERValExpr, ExprRValue);
6387 CodeGenFunction::OpaqueValueMapping MapX(CGF, XRValExpr, XRValue);
6403 CodeGenFunction::OpaqueValueMapping MapExpr(CGF, ERValExpr, ExprRValue);
6404 CodeGenFunction::OpaqueValueMapping MapX(CGF, XRValExpr, Res.second);
6463 CodeGenFunction &CGF, llvm::AtomicOrdering AO, llvm::AtomicOrdering FailAO,
6543 static void emitOMPAtomicExpr(CodeGenFunction &CGF, OpenMPClauseKind Kind,
6575 void CodeGenFunction::EmitOMPAtomicDirective(const OMPAtomicDirective &S) {
6658 static void emitCommonOMPTargetDirective(CodeGenFunction &CGF,
6668 CGF, OMPD_target, [&S](CodeGenFunction &CGF, PrePostActionTy &) {
6730 [IsOffloadEntry](CodeGenFunction &CGF,
6746 static void emitTargetRegion(CodeGenFunction &CGF, const OMPTargetDirective &S,
6749 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
6760 void CodeGenFunction::EmitOMPTargetDeviceFunction(CodeGenModule &CGM,
6763 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6774 void CodeGenFunction::EmitOMPTargetDirective(const OMPTargetDirective &S) {
6775 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6781 static void emitCommonOMPTeamsDirective(CodeGenFunction &CGF,
6808 void CodeGenFunction::EmitOMPTeamsDirective(const OMPTeamsDirective &S) {
6810 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6822 [](CodeGenFunction &) { return nullptr; });
6825 static void emitTargetTeamsRegion(CodeGenFunction &CGF, PrePostActionTy &Action,
6830 auto &&CodeGen = [&S, CS](CodeGenFunction &CGF, PrePostActionTy &Action) {
6832 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
6844 [](CodeGenFunction &) { return nullptr; });
6847 void CodeGenFunction::EmitOMPTargetTeamsDeviceFunction(
6850 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6861 void CodeGenFunction::EmitOMPTargetTeamsDirective(
6863 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6870 emitTargetTeamsDistributeRegion(CodeGenFunction &CGF, PrePostActionTy &Action,
6873 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
6878 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
6881 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
6890 [](CodeGenFunction &) { return nullptr; });
6893 void CodeGenFunction::EmitOMPTargetTeamsDistributeDeviceFunction(
6896 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6907 void CodeGenFunction::EmitOMPTargetTeamsDistributeDirective(
6909 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6916 CodeGenFunction &CGF, PrePostActionTy &Action,
6919 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
6924 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
6927 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
6936 [](CodeGenFunction &) { return nullptr; });
6939 void CodeGenFunction::EmitOMPTargetTeamsDistributeSimdDeviceFunction(
6942 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6953 void CodeGenFunction::EmitOMPTargetTeamsDistributeSimdDirective(
6955 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
6961 void CodeGenFunction::EmitOMPTeamsDistributeDirective(
6964 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
6969 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
6981 [](CodeGenFunction &) { return nullptr; });
6984 void CodeGenFunction::EmitOMPTeamsDistributeSimdDirective(
6986 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
6991 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7003 [](CodeGenFunction &) { return nullptr; });
7006 void CodeGenFunction::EmitOMPTeamsDistributeParallelForDirective(
7008 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7014 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7026 [](CodeGenFunction &) { return nullptr; });
7029 void CodeGenFunction::EmitOMPTeamsDistributeParallelForSimdDirective(
7031 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7037 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7050 [](CodeGenFunction &) { return nullptr; });
7053 void CodeGenFunction::EmitOMPInteropDirective(const OMPInteropDirective &S) {
7124 CodeGenFunction &CGF, const OMPTargetTeamsDistributeParallelForDirective &S,
7127 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7133 auto &&CodeGenTeams = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7136 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
7147 [](CodeGenFunction &) { return nullptr; });
7150 void CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForDeviceFunction(
7155 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7166 void CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForDirective(
7168 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7175 CodeGenFunction &CGF,
7179 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7185 auto &&CodeGenTeams = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7188 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
7199 [](CodeGenFunction &) { return nullptr; });
7202 void CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForSimdDeviceFunction(
7207 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7218 void CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForSimdDirective(
7220 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7226 void CodeGenFunction::EmitOMPCancellationPointDirective(
7232 void CodeGenFunction::EmitOMPCancelDirective(const OMPCancelDirective &S) {
7261 CodeGenFunction::JumpDest
7262 CodeGenFunction::getOMPCancelDestination(OpenMPDirectiveKind Kind) {
7276 void CodeGenFunction::EmitOMPUseDevicePtrClause(
7327 void CodeGenFunction::EmitOMPUseDeviceAddrClause(
7376 void CodeGenFunction::EmitOMPTargetDataDirective(
7391 void Enter(CodeGenFunction &CGF) override {
7397 auto &&CodeGen = [&](CodeGenFunction &CGF, PrePostActionTy &Action) {
7398 auto &&InnermostCodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7403 auto &&PrivCodeGen = [&](CodeGenFunction &CGF, PrePostActionTy &Action) {
7488 void CodeGenFunction::EmitOMPTargetEnterDataDirective(
7509 void CodeGenFunction::EmitOMPTargetExitDataDirective(
7530 static void emitTargetParallelRegion(CodeGenFunction &CGF,
7536 auto &&CodeGen = [&S, CS](CodeGenFunction &CGF, PrePostActionTy &Action) {
7538 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
7552 [](CodeGenFunction &) { return nullptr; });
7555 void CodeGenFunction::EmitOMPTargetParallelDeviceFunction(
7558 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7569 void CodeGenFunction::EmitOMPTargetParallelDirective(
7571 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7577 static void emitTargetParallelForRegion(CodeGenFunction &CGF,
7583 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7585 CodeGenFunction::OMPCancelStackRAII CancelRegion(
7594 void CodeGenFunction::EmitOMPTargetParallelForDeviceFunction(
7598 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7609 void CodeGenFunction::EmitOMPTargetParallelForDirective(
7611 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7618 emitTargetParallelForSimdRegion(CodeGenFunction &CGF,
7624 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7633 void CodeGenFunction::EmitOMPTargetParallelForSimdDeviceFunction(
7637 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7648 void CodeGenFunction::EmitOMPTargetParallelForSimdDirective(
7650 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7657 static void mapParam(CodeGenFunction &CGF, const DeclRefExpr *Helper,
7659 CodeGenFunction::OMPPrivateScope &Privates) {
7664 void CodeGenFunction::EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S) {
7699 auto &&BodyGen = [CS, &S](CodeGenFunction &CGF, PrePostActionTy &) {
7764 [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7768 [&S, &LoopScope](CodeGenFunction &CGF, PrePostActionTy &) {
7771 [&S](CodeGenFunction &CGF) {
7773 CodeGenFunction::JumpDest());
7775 [](CodeGenFunction &) {});
7792 CGF.EmitOMPLinearClauseFinal(S, [LIP, &S](CodeGenFunction &CGF) {
7799 IfCond](CodeGenFunction &CGF, llvm::Function *OutlinedFn,
7802 &Data](CodeGenFunction &CGF, PrePostActionTy &) {
7816 [&S, &BodyGen, &TaskGen, &Data](CodeGenFunction &CGF,
7826 void CodeGenFunction::EmitOMPTaskLoopDirective(const OMPTaskLoopDirective &S) {
7832 void CodeGenFunction::EmitOMPTaskLoopSimdDirective(
7840 void CodeGenFunction::EmitOMPMasterTaskLoopDirective(
7842 auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7852 void CodeGenFunction::EmitOMPMasterTaskLoopSimdDirective(
7854 auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7864 void CodeGenFunction::EmitOMPParallelMasterTaskLoopDirective(
7866 auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7867 auto &&TaskLoopCodeGen = [&S](CodeGenFunction &CGF,
7882 void CodeGenFunction::EmitOMPParallelMasterTaskLoopSimdDirective(
7884 auto &&CodeGen = [this, &S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7885 auto &&TaskLoopCodeGen = [&S](CodeGenFunction &CGF,
7901 void CodeGenFunction::EmitOMPTargetUpdateDirective(
7922 void CodeGenFunction::EmitOMPGenericLoopDirective(
7925 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7944 void CodeGenFunction::EmitOMPParallelGenericLoopDirective(
7948 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
7963 void CodeGenFunction::EmitOMPTeamsGenericLoopDirective(
7967 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
7972 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
7984 [](CodeGenFunction &) { return nullptr; });
7988 static void emitTargetTeamsLoopCodegenStatus(CodeGenFunction &CGF,
8007 CodeGenFunction &CGF, PrePostActionTy &Action,
8012 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
8018 auto &&CodeGenTeams = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
8021 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
8034 [](CodeGenFunction &) { return nullptr; });
8038 CodeGenFunction &CGF, PrePostActionTy &Action,
8042 auto &&CodeGenDistribute = [&S](CodeGenFunction &CGF, PrePostActionTy &) {
8047 auto &&CodeGen = [&S, &CodeGenDistribute](CodeGenFunction &CGF,
8050 CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
8062 [](CodeGenFunction &) { return nullptr; });
8065 void CodeGenFunction::EmitOMPTargetTeamsGenericLoopDirective(
8067 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8076 void CodeGenFunction::EmitOMPTargetTeamsGenericLoopDeviceFunction(
8080 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8096 CodeGenFunction &CGF, const OMPTargetParallelGenericLoopDirective &S,
8100 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8102 CodeGenFunction::OMPCancelStackRAII CancelRegion(
8111 void CodeGenFunction::EmitOMPTargetParallelGenericLoopDeviceFunction(
8115 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8128 void CodeGenFunction::EmitOMPTargetParallelGenericLoopDirective(
8130 auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
8136 void CodeGenFunction::EmitSimpleOMPExecutableDirective(
8144 auto &&CodeGen = [&D](CodeGenFunction &CGF, PrePostActionTy &Action) {