Lines Matching refs:CGM

605         CGF.CGM.getOpenMPRuntime().getUserDefinedReduction(DRD);  in emitInitWithReductionInitializer()
622 llvm::Constant *Init = CGF.CGM.EmitNullConstant(Ty); in emitInitWithReductionInitializer()
623 std::string Name = CGF.CGM.getOpenMPRuntime().getName({"init"}); in emitInitWithReductionInitializer()
625 CGF.CGM.getModule(), Init->getType(), /*isConstant=*/true, in emitInitWithReductionInitializer()
912 CGF.CGM.getTBAAInfoForSubobject(BaseLV, BaseLV.getType())); in loadToBegin()
1036 CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM) in CGOpenMPRuntime() argument
1037 : CGM(CGM), OMPBuilder(CGM.getModule()) { in CGOpenMPRuntime()
1038 KmpCriticalNameTy = llvm::ArrayType::get(CGM.Int32Ty, /*NumElements*/ 8); in CGOpenMPRuntime()
1040 CGM.getLangOpts().OpenMPIsTargetDevice, isGPU(), in CGOpenMPRuntime()
1041 CGM.getLangOpts().OpenMPOffloadMandatory, in CGOpenMPRuntime()
1045 OMPBuilder.loadOffloadInfoMetadata(CGM.getLangOpts().OpenMPIsTargetDevice in CGOpenMPRuntime()
1046 ? CGM.getLangOpts().OMPHostIRFile in CGOpenMPRuntime()
1052 if (CGM.getLangOpts().OpenMPForceUSM) { in CGOpenMPRuntime()
1078 emitCombinerOrInitializer(CodeGenModule &CGM, QualType Ty, in emitCombinerOrInitializer() argument
1082 ASTContext &C = CGM.getContext(); in emitCombinerOrInitializer()
1092 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitCombinerOrInitializer()
1093 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in emitCombinerOrInitializer()
1094 std::string Name = CGM.getOpenMPRuntime().getName( in emitCombinerOrInitializer()
1097 Name, &CGM.getModule()); in emitCombinerOrInitializer()
1098 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo); in emitCombinerOrInitializer()
1099 if (CGM.getLangOpts().Optimize) { in emitCombinerOrInitializer()
1104 CodeGenFunction CGF(CGM); in emitCombinerOrInitializer()
1137 CGM, D->getType(), D->getCombiner(), in emitUserDefinedReduction()
1144 CGM, D->getType(), in emitUserDefinedReduction()
1213 CodeGenModule &CGM, const OMPExecutableDirective &D, const CapturedStmt *CS, in emitParallelOrTeamsOutlinedFunction() argument
1218 CodeGenFunction CGF(CGM, true); in emitParallelOrTeamsOutlinedFunction()
1241 llvm::OpenMPIRBuilder &OMPBuilder = CGM.getOpenMPRuntime().getOMPBuilder(); in emitParallelOrTeamsOutlinedFunction()
1269 CGM, D, CS, ThreadIDVar, InnermostKind, getOutlinedHelperName(CGF), in emitParallelOutlinedFunction()
1279 CGM, D, CS, ThreadIDVar, InnermostKind, getOutlinedHelperName(CGF), in emitTeamsOutlinedFunction()
1298 CGM.getModule(), OMPRTL___kmpc_omp_task), in emitTaskOutlinedFunction()
1320 CodeGenFunction CGF(CGM, true); in emitTaskOutlinedFunction()
1373 if ((!EmitLoc && CGM.getCodeGenOpts().getDebugInfo() == in emitUpdateLocation()
1398 if (CGM.getLangOpts().OpenMPIRBuilder) { in getThreadID()
1455 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in getThreadID()
1491 llvm::Type *MicroParams[] = {llvm::PointerType::getUnqual(CGM.Int32Ty), in getKmpc_MicroPointerTy()
1492 llvm::PointerType::getUnqual(CGM.Int32Ty)}; in getKmpc_MicroPointerTy()
1493 Kmpc_MicroTy = llvm::FunctionType::get(CGM.VoidTy, MicroParams, true); in getKmpc_MicroPointerTy()
1544 CodeGenModule &CGM, llvm::OpenMPIRBuilder &OMPBuilder, in getEntryInfoFromPresumedLoc() argument
1548 SourceManager &SM = CGM.getContext().getSourceManager(); in getEntryInfoFromPresumedLoc()
1563 auto AddrOfGlobal = [&VD, this]() { return CGM.GetAddrOfGlobal(VD); }; in getAddrOfDeclareTargetVar()
1566 return CGM.getLLVMLinkageVarDefinition(VD); in getAddrOfDeclareTargetVar()
1571 llvm::Type *LlvmPtrTy = CGM.getTypes().ConvertTypeForMem( in getAddrOfDeclareTargetVar()
1572 CGM.getContext().getPointerType(VD->getType())); in getAddrOfDeclareTargetVar()
1575 VD->hasDefinition(CGM.getContext()) == VarDecl::DeclarationOnly, in getAddrOfDeclareTargetVar()
1577 getEntryInfoFromPresumedLoc(CGM, OMPBuilder, in getAddrOfDeclareTargetVar()
1579 CGM.getMangledName(VD), GeneratedRefs, CGM.getLangOpts().OpenMPSimd, in getAddrOfDeclareTargetVar()
1580 CGM.getLangOpts().OMPTargetTriples, LlvmPtrTy, AddrOfGlobal, in getAddrOfDeclareTargetVar()
1585 return ConstantAddress(addr, LlvmPtrTy, CGM.getContext().getDeclAlign(VD)); in getAddrOfDeclareTargetVar()
1590 assert(!CGM.getLangOpts().OpenMPUseTLS || in getOrCreateThreadPrivateCache()
1591 !CGM.getContext().getTargetInfo().isTLSSupported()); in getOrCreateThreadPrivateCache()
1595 CGM.Int8PtrPtrTy, Twine(CGM.getMangledName(VD)).concat(Suffix).str()); in getOrCreateThreadPrivateCache()
1602 if (CGM.getLangOpts().OpenMPUseTLS && in getAddrOfThreadPrivate()
1603 CGM.getContext().getTargetInfo().isTLSSupported()) in getAddrOfThreadPrivate()
1609 CGF.Builder.CreatePointerCast(VDAddr.emitRawPointer(CGF), CGM.Int8PtrTy), in getAddrOfThreadPrivate()
1610 CGM.getSize(CGM.GetTargetTypeStoreSize(VarTy)), in getAddrOfThreadPrivate()
1615 CGM.getModule(), OMPRTL___kmpc_threadprivate_cached), in getAddrOfThreadPrivate()
1627 CGM.getModule(), OMPRTL___kmpc_global_thread_num), in emitThreadPrivateVarInit()
1633 CGF.Builder.CreatePointerCast(VDAddr.emitRawPointer(CGF), CGM.VoidPtrTy), in emitThreadPrivateVarInit()
1637 CGM.getModule(), OMPRTL___kmpc_threadprivate_register), in emitThreadPrivateVarInit()
1644 if (CGM.getLangOpts().OpenMPUseTLS && in emitThreadPrivateVarDefinition()
1645 CGM.getContext().getTargetInfo().isTLSSupported()) in emitThreadPrivateVarDefinition()
1648 VD = VD->getDefinition(CGM.getContext()); in emitThreadPrivateVarDefinition()
1649 if (VD && ThreadPrivateWithDefinition.insert(CGM.getMangledName(VD)).second) { in emitThreadPrivateVarDefinition()
1654 if (CGM.getLangOpts().CPlusPlus && PerformInit) { in emitThreadPrivateVarDefinition()
1657 CodeGenFunction CtorCGF(CGM); in emitThreadPrivateVarDefinition()
1659 ImplicitParamDecl Dst(CGM.getContext(), /*DC=*/nullptr, Loc, in emitThreadPrivateVarDefinition()
1660 /*Id=*/nullptr, CGM.getContext().VoidPtrTy, in emitThreadPrivateVarDefinition()
1664 const auto &FI = CGM.getTypes().arrangeBuiltinFunctionDeclaration( in emitThreadPrivateVarDefinition()
1665 CGM.getContext().VoidPtrTy, Args); in emitThreadPrivateVarDefinition()
1666 llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI); in emitThreadPrivateVarDefinition()
1669 CGM.CreateGlobalInitOrCleanUpFunction(FTy, Name, FI, Loc); in emitThreadPrivateVarDefinition()
1670 CtorCGF.StartFunction(GlobalDecl(), CGM.getContext().VoidPtrTy, Fn, FI, in emitThreadPrivateVarDefinition()
1674 CGM.getContext().VoidPtrTy, Dst.getLocation()); in emitThreadPrivateVarDefinition()
1681 CGM.getContext().VoidPtrTy, Dst.getLocation()); in emitThreadPrivateVarDefinition()
1689 CodeGenFunction DtorCGF(CGM); in emitThreadPrivateVarDefinition()
1691 ImplicitParamDecl Dst(CGM.getContext(), /*DC=*/nullptr, Loc, in emitThreadPrivateVarDefinition()
1692 /*Id=*/nullptr, CGM.getContext().VoidPtrTy, in emitThreadPrivateVarDefinition()
1696 const auto &FI = CGM.getTypes().arrangeBuiltinFunctionDeclaration( in emitThreadPrivateVarDefinition()
1697 CGM.getContext().VoidTy, Args); in emitThreadPrivateVarDefinition()
1698 llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI); in emitThreadPrivateVarDefinition()
1701 CGM.CreateGlobalInitOrCleanUpFunction(FTy, Name, FI, Loc); in emitThreadPrivateVarDefinition()
1703 DtorCGF.StartFunction(GlobalDecl(), CGM.getContext().VoidTy, Fn, FI, Args, in emitThreadPrivateVarDefinition()
1709 /*Volatile=*/false, CGM.getContext().VoidPtrTy, Dst.getLocation()); in emitThreadPrivateVarDefinition()
1721 llvm::Type *CopyCtorTyArgs[] = {CGM.VoidPtrTy, CGM.VoidPtrTy}; in emitThreadPrivateVarDefinition()
1722 auto *CopyCtorTy = llvm::FunctionType::get(CGM.VoidPtrTy, CopyCtorTyArgs, in emitThreadPrivateVarDefinition()
1730 auto *CtorTy = llvm::FunctionType::get(CGM.VoidPtrTy, CGM.VoidPtrTy, in emitThreadPrivateVarDefinition()
1736 auto *DtorTy = llvm::FunctionType::get(CGM.VoidTy, CGM.VoidPtrTy, in emitThreadPrivateVarDefinition()
1743 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg*/ false); in emitThreadPrivateVarDefinition()
1745 llvm::Function *InitFunction = CGM.CreateGlobalInitOrCleanUpFunction( in emitThreadPrivateVarDefinition()
1746 InitFunctionTy, Name, CGM.getTypes().arrangeNullaryFunction()); in emitThreadPrivateVarDefinition()
1747 CodeGenFunction InitCGF(CGM); in emitThreadPrivateVarDefinition()
1749 InitCGF.StartFunction(GlobalDecl(), CGM.getContext().VoidTy, InitFunction, in emitThreadPrivateVarDefinition()
1750 CGM.getTypes().arrangeNullaryFunction(), ArgList, in emitThreadPrivateVarDefinition()
1772 CGM, OMPBuilder, FD->getCanonicalDecl()->getBeginLoc(), FD->getName()); in emitDeclareTargetFunction()
1781 if (CGM.getLangOpts().OpenMPIsTargetDevice) { in emitDeclareTargetFunction()
1783 CGM.getModule(), CGM.VoidPtrTy, in emitDeclareTargetFunction()
1786 CGM.getModule().getDataLayout().getDefaultGlobalsAddressSpace()); in emitDeclareTargetFunction()
1791 Name, Addr, CGM.GetTargetTypeStoreSize(CGM.VoidPtrTy).getQuantity(), in emitDeclareTargetFunction()
1803 if (CGM.getLangOpts().OpenMP && CGM.getLangOpts().OpenMPUseTLS && in getAddrOfArtificialThreadPrivate()
1804 CGM.getTarget().isTLSSupported()) { in getAddrOfArtificialThreadPrivate()
1807 CGM.getContext().getTypeAlignInChars(VarType)); in getAddrOfArtificialThreadPrivate()
1813 CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(GAddr, CGM.VoidPtrTy), in getAddrOfArtificialThreadPrivate()
1814 CGF.Builder.CreateIntCast(CGF.getTypeSize(VarType), CGM.SizeTy, in getAddrOfArtificialThreadPrivate()
1817 CGM.VoidPtrPtrTy, in getAddrOfArtificialThreadPrivate()
1823 CGM.getModule(), OMPRTL___kmpc_threadprivate_cached), in getAddrOfArtificialThreadPrivate()
1826 VarLVType, CGM.getContext().getTypeAlignInChars(VarType)); in getAddrOfArtificialThreadPrivate()
1876 auto &M = CGM.getModule(); in emitParallelCall()
1880 CGOpenMPRuntime &RT = CGF.CGM.getOpenMPRuntime(); in emitParallelCall()
1895 CGOpenMPRuntime &RT = CGF.CGM.getOpenMPRuntime(); in emitParallelCall()
2024 CGF.EmitScalarExpr(Hint), CGM.Int32Ty, /*isSigned=*/false)); in emitCriticalRegion()
2028 CGM.getModule(), in emitCriticalRegion()
2031 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in emitCriticalRegion()
2050 CGM.getModule(), OMPRTL___kmpc_master), in emitMasterRegion()
2053 CGM.getModule(), OMPRTL___kmpc_end_master), in emitMasterRegion()
2073 : llvm::ConstantInt::get(CGM.Int32Ty, /*V=*/0); in emitMaskedRegion()
2079 CGM.getModule(), OMPRTL___kmpc_masked), in emitMaskedRegion()
2082 CGM.getModule(), OMPRTL___kmpc_end_masked), in emitMaskedRegion()
2094 if (CGF.CGM.getLangOpts().OpenMPIRBuilder) { in emitTaskyieldCall()
2100 llvm::ConstantInt::get(CGM.IntTy, /*V=*/0, /*isSigned=*/true)}; in emitTaskyieldCall()
2102 CGM.getModule(), OMPRTL___kmpc_omp_taskyield), in emitTaskyieldCall()
2121 CGM.getModule(), OMPRTL___kmpc_taskgroup), in emitTaskgroupRegion()
2124 CGM.getModule(), OMPRTL___kmpc_end_taskgroup), in emitTaskgroupRegion()
2146 CodeGenModule &CGM, llvm::Type *ArgsElemType, in emitCopyprivateCopyFunction() argument
2150 ASTContext &C = CGM.getContext(); in emitCopyprivateCopyFunction()
2160 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitCopyprivateCopyFunction()
2162 CGM.getOpenMPRuntime().getName({"omp", "copyprivate", "copy_func"}); in emitCopyprivateCopyFunction()
2163 auto *Fn = llvm::Function::Create(CGM.getTypes().GetFunctionType(CGFI), in emitCopyprivateCopyFunction()
2165 &CGM.getModule()); in emitCopyprivateCopyFunction()
2166 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, CGFI); in emitCopyprivateCopyFunction()
2168 CodeGenFunction CGF(CGM); in emitCopyprivateCopyFunction()
2213 ASTContext &C = CGM.getContext(); in emitSingleRegion()
2234 CGM.getModule(), OMPRTL___kmpc_single), in emitSingleRegion()
2237 CGM.getModule(), OMPRTL___kmpc_end_single), in emitSingleRegion()
2268 CGM, CGF.ConvertTypeForMem(CopyprivateArrayTy), CopyprivateVars, in emitSingleRegion()
2283 CGM.getModule(), OMPRTL___kmpc_copyprivate), in emitSingleRegion()
2300 CGM.getModule(), OMPRTL___kmpc_ordered), in emitOrderedRegion()
2303 CGM.getModule(), OMPRTL___kmpc_end_ordered), in emitOrderedRegion()
2351 if (CGF.CGM.getLangOpts().OpenMPIRBuilder) { in emitBarrierCall()
2369 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in emitBarrierCall()
2391 CGM.getModule(), OMPRTL___kmpc_barrier), in emitBarrierCall()
2404 llvm::ConstantInt::get(CGM.Int32Ty, IsFatal ? 2 : 1), in emitErrorCall()
2405 CGF.Builder.CreatePointerCast(MVL, CGM.Int8PtrTy)}; in emitErrorCall()
2407 CGM.getModule(), OMPRTL___kmpc_error), in emitErrorCall()
2473 static int addMonoNonMonoModifier(CodeGenModule &CGM, OpenMPSchedType Schedule, in addMonoNonMonoModifier() argument
2513 if (CGM.getLangOpts().OpenMP >= 50 && Modifier == 0) { in addMonoNonMonoModifier()
2548 CGM, Schedule, ScheduleKind.M1, ScheduleKind.M2)), // Schedule type in emitForDispatchInit()
2604 CGF.Builder.getInt32(addMonoNonMonoModifier(CGF.CGM, Schedule, M1, in emitForStaticInitCall()
2649 CGM.getLangOpts().OpenMPIsTargetDevice && in emitDistributeStaticInit()
2650 (CGM.getTriple().isAMDGCN() || CGM.getTriple().isNVPTX()); in emitDistributeStaticInit()
2679 CGM.getLangOpts().OpenMPIsTargetDevice && in emitForStaticFinish()
2680 (CGM.getTriple().isAMDGCN() || CGM.getTriple().isNVPTX())) in emitForStaticFinish()
2683 CGM.getModule(), OMPRTL___kmpc_distribute_static_fini), in emitForStaticFinish()
2687 CGM.getModule(), OMPRTL___kmpc_for_static_fini), in emitForStaticFinish()
2736 CGM.getModule(), OMPRTL___kmpc_push_num_threads), in emitNumThreadsClause()
2749 llvm::ConstantInt::get(CGM.IntTy, unsigned(ProcBind), /*isSigned=*/true)}; in emitProcBindClause()
2751 CGM.getModule(), OMPRTL___kmpc_push_proc_bind), in emitProcBindClause()
2757 if (CGF.CGM.getLangOpts().OpenMPIRBuilder) { in emitFlush()
2764 CGM.getModule(), OMPRTL___kmpc_flush), in emitFlush()
2798 if (CGM.getLangOpts().OpenMPSimd || OMPBuilder.OffloadInfoManager.empty()) in createOffloadEntriesAndInfoMetadata()
2806 for (auto I = CGM.getContext().getSourceManager().fileinfo_begin(), in createOffloadEntriesAndInfoMetadata()
2807 E = CGM.getContext().getSourceManager().fileinfo_end(); in createOffloadEntriesAndInfoMetadata()
2811 Loc = CGM.getContext().getSourceManager().translateFileLineCol( in createOffloadEntriesAndInfoMetadata()
2819 unsigned DiagID = CGM.getDiags().getCustomDiagID( in createOffloadEntriesAndInfoMetadata()
2823 CGM.getDiags().Report(Loc, DiagID) << EntryInfo.ParentName; in createOffloadEntriesAndInfoMetadata()
2826 unsigned DiagID = CGM.getDiags().getCustomDiagID( in createOffloadEntriesAndInfoMetadata()
2830 CGM.getDiags().Report(Loc, DiagID) << EntryInfo.ParentName; in createOffloadEntriesAndInfoMetadata()
2833 unsigned DiagID = CGM.getDiags().getCustomDiagID( in createOffloadEntriesAndInfoMetadata()
2837 CGM.getDiags().Report(DiagID); in createOffloadEntriesAndInfoMetadata()
2848 ASTContext &C = CGM.getContext(); in emitKmpRoutineEntryT()
2853 KmpRoutineEntryPtrTy = CGM.getTypes().ConvertType(KmpRoutineEntryPtrQTy); in emitKmpRoutineEntryT()
2886 createPrivatesRecordDecl(CodeGenModule &CGM, ArrayRef<PrivateDataTy> Privates) { in createPrivatesRecordDecl() argument
2888 ASTContext &C = CGM.getContext(); in createPrivatesRecordDecl()
2920 createKmpTaskTRecordDecl(CodeGenModule &CGM, OpenMPDirectiveKind Kind, in createKmpTaskTRecordDecl() argument
2923 ASTContext &C = CGM.getContext(); in createKmpTaskTRecordDecl()
2952 CGM.getContext().getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in createKmpTaskTRecordDecl()
2954 CGM.getContext().getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in createKmpTaskTRecordDecl()
2966 createKmpTaskTWithPrivatesRecordDecl(CodeGenModule &CGM, QualType KmpTaskTQTy, in createKmpTaskTWithPrivatesRecordDecl() argument
2968 ASTContext &C = CGM.getContext(); in createKmpTaskTWithPrivatesRecordDecl()
2976 if (const RecordDecl *PrivateRD = createPrivatesRecordDecl(CGM, Privates)) in createKmpTaskTWithPrivatesRecordDecl()
2994 emitProxyTaskFunction(CodeGenModule &CGM, SourceLocation Loc, in emitProxyTaskFunction() argument
3000 ASTContext &C = CGM.getContext(); in emitProxyTaskFunction()
3010 CGM.getTypes().arrangeBuiltinFunctionDeclaration(KmpInt32Ty, Args); in emitProxyTaskFunction()
3012 CGM.getTypes().GetFunctionType(TaskEntryFnInfo); in emitProxyTaskFunction()
3013 std::string Name = CGM.getOpenMPRuntime().getName({"omp_task_entry", ""}); in emitProxyTaskFunction()
3015 TaskEntryTy, llvm::GlobalValue::InternalLinkage, Name, &CGM.getModule()); in emitProxyTaskFunction()
3016 CGM.SetInternalFunctionAttributes(GlobalDecl(), TaskEntry, TaskEntryFnInfo); in emitProxyTaskFunction()
3018 CodeGenFunction CGF(CGM); in emitProxyTaskFunction()
3089 CGM.getOpenMPRuntime().emitOutlinedFunctionCall(CGF, Loc, TaskFunction, in emitProxyTaskFunction()
3097 static llvm::Value *emitDestructorsFunction(CodeGenModule &CGM, in emitDestructorsFunction() argument
3102 ASTContext &C = CGM.getContext(); in emitDestructorsFunction()
3112 CGM.getTypes().arrangeBuiltinFunctionDeclaration(KmpInt32Ty, Args); in emitDestructorsFunction()
3114 CGM.getTypes().GetFunctionType(DestructorFnInfo); in emitDestructorsFunction()
3116 CGM.getOpenMPRuntime().getName({"omp_task_destructor", ""}); in emitDestructorsFunction()
3119 Name, &CGM.getModule()); in emitDestructorsFunction()
3120 CGM.SetInternalFunctionAttributes(GlobalDecl(), DestructorFn, in emitDestructorsFunction()
3123 CodeGenFunction CGF(CGM); in emitDestructorsFunction()
3157 emitTaskPrivateMappingFunction(CodeGenModule &CGM, SourceLocation Loc, in emitTaskPrivateMappingFunction() argument
3160 ASTContext &C = CGM.getContext(); in emitTaskPrivateMappingFunction()
3216 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitTaskPrivateMappingFunction()
3218 CGM.getTypes().GetFunctionType(TaskPrivatesMapFnInfo); in emitTaskPrivateMappingFunction()
3220 CGM.getOpenMPRuntime().getName({"omp_task_privates_map", ""}); in emitTaskPrivateMappingFunction()
3223 &CGM.getModule()); in emitTaskPrivateMappingFunction()
3224 CGM.SetInternalFunctionAttributes(GlobalDecl(), TaskPrivatesMap, in emitTaskPrivateMappingFunction()
3226 if (CGM.getLangOpts().Optimize) { in emitTaskPrivateMappingFunction()
3231 CodeGenFunction CGF(CGM); in emitTaskPrivateMappingFunction()
3403 emitTaskDupFunction(CodeGenModule &CGM, SourceLocation Loc, in emitTaskDupFunction() argument
3410 ASTContext &C = CGM.getContext(); in emitTaskDupFunction()
3424 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitTaskDupFunction()
3425 llvm::FunctionType *TaskDupTy = CGM.getTypes().GetFunctionType(TaskDupFnInfo); in emitTaskDupFunction()
3426 std::string Name = CGM.getOpenMPRuntime().getName({"omp_task_dup", ""}); in emitTaskDupFunction()
3428 TaskDupTy, llvm::GlobalValue::InternalLinkage, Name, &CGM.getModule()); in emitTaskDupFunction()
3429 CGM.SetInternalFunctionAttributes(GlobalDecl(), TaskDup, TaskDupFnInfo); in emitTaskDupFunction()
3431 CodeGenFunction CGF(CGM); in emitTaskDupFunction()
3463 CGF.Int8Ty, CGM.getNaturalTypeAlignment(SharedsTy)); in emitTaskDupFunction()
3618 ASTContext &C = CGM.getContext(); in emitTaskInit()
3653 Privates.emplace_back(CGM.getPointerAlign(), PrivateHelpersTy(VD)); in emitTaskInit()
3668 CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy)); in emitTaskInit()
3678 CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy)); in emitTaskInit()
3685 createKmpTaskTWithPrivatesRecordDecl(CGM, KmpTaskTQTy, Privates); in emitTaskInit()
3703 emitTaskPrivateMappingFunction(CGM, Loc, Data, FI->getType(), Privates); in emitTaskInit()
3713 CGM, Loc, D.getDirectiveKind(), KmpInt32Ty, KmpTaskTWithPrivatesPtrQTy, in emitTaskInit()
3749 llvm::Value *SharedsSize = CGM.getSize(C.getTypeSizeInChars(SharedsTy)); in emitTaskInit()
3770 CGM.getModule(), OMPRTL___kmpc_omp_target_task_alloc), in emitTaskInit()
3775 CGM.getModule(), OMPRTL___kmpc_omp_task_alloc), in emitTaskInit()
3792 CGM.getModule(), OMPRTL___kmpc_task_allow_completion_event), in emitTaskInit()
3801 ASTContext &C = CGM.getContext(); in emitTaskInit()
3819 getKmpAffinityType(CGM.getContext(), KmpTaskAffinityInfoTy); in emitTaskInit()
3851 NumOfElements = llvm::ConstantInt::get(CGM.Int32Ty, NumAffinities, in emitTaskInit()
3925 AffinitiesArray.emitRawPointer(CGF), CGM.VoidPtrTy); in emitTaskInit()
3930 CGM.getModule(), OMPRTL___kmpc_omp_reg_task_with_affinity), in emitTaskInit()
3950 CGF.Int8Ty, CGM.getNaturalTypeAlignment(SharedsTy)); in emitTaskInit()
3964 CGM, Loc, D, KmpTaskTWithPrivatesPtrQTy, KmpTaskTWithPrivatesQTyRD, in emitTaskInit()
3977 CGM, Loc, KmpInt32Ty, KmpTaskTWithPrivatesPtrQTy, in emitTaskInit()
4051 ASTContext &C = CGM.getContext(); in getDepobjElements()
4079 CodeGenModule &CGM = CGF.CGM; in emitDependData() local
4080 ASTContext &C = CGM.getContext(); in emitDependData()
4229 ASTContext &C = CGM.getContext(); in emitDependClause()
4281 NumOfElements = llvm::ConstantInt::get(CGM.IntPtrTy, NumDependencies, in emitDependClause()
4314 NumOfElements = llvm::ConstantInt::get(CGM.Int32Ty, NumDependencies, in emitDependClause()
4356 ASTContext &C = CGM.getContext(); in emitDepobjDependClause()
4383 llvm::Value *RecSize = CGM.getSize(SizeInBytes); in emitDepobjDependClause()
4392 Size = CGM.getSize(Sz.alignTo(Align)); in emitDepobjDependClause()
4403 CGM.getModule(), OMPRTL___kmpc_alloc), in emitDepobjDependClause()
4439 ASTContext &C = CGM.getContext(); in emitDestroyClause()
4460 CGM.getModule(), OMPRTL___kmpc_free), in emitDestroyClause()
4467 ASTContext &C = CGM.getContext(); in emitUpdateClause()
4564 CGM.getModule(), OMPRTL___kmpc_omp_task_with_deps), in emitTaskCall()
4568 CGM.getModule(), OMPRTL___kmpc_omp_task), in emitTaskCall()
4588 auto &M = CGM.getModule(); in emitTaskCall()
4606 CGF.CGM.getOpenMPRuntime().emitOutlinedFunctionCall(CGF, Loc, TaskEntry, in emitTaskCall()
4712 CGM.getModule(), OMPRTL___kmpc_taskloop), in emitTaskLoopCall()
4811 CGF.CGM.getOpenMPRuntime().getUserDefinedReduction(DRD); in emitReductionCombiner()
4824 ASTContext &C = CGM.getContext(); in emitReductionFunction()
4835 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitReductionFunction()
4837 auto *Fn = llvm::Function::Create(CGM.getTypes().GetFunctionType(CGFI), in emitReductionFunction()
4839 &CGM.getModule()); in emitReductionFunction()
4840 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, CGFI); in emitReductionFunction()
4842 CodeGenFunction CGF(CGM); in emitReductionFunction()
4977 ASTContext &C = CGM.getContext(); in emitReduction()
5057 CGM.getModule(), in emitReduction()
5084 CGOpenMPRuntime &RT = CGF.CGM.getOpenMPRuntime(); in emitReduction()
5100 CGM.getModule(), WithNowait ? OMPRTL___kmpc_end_reduce_nowait in emitReduction()
5186 CGOpenMPRuntime &RT = CGF.CGM.getOpenMPRuntime(); in emitReduction()
5222 CGM.getModule(), OMPRTL___kmpc_end_reduce), in emitReduction()
5236 static std::string generateUniqueName(CodeGenModule &CGM, StringRef Prefix, in generateUniqueName() argument
5245 std::string Name = CGM.getOpenMPRuntime().getName( in generateUniqueName()
5246 {D->isLocalVarDeclOrParm() ? D->getName() : CGM.getMangledName(D)}); in generateUniqueName()
5260 static llvm::Value *emitReduceInitFunction(CodeGenModule &CGM, in emitReduceInitFunction() argument
5263 ASTContext &C = CGM.getContext(); in emitReduceInitFunction()
5274 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitReduceInitFunction()
5275 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in emitReduceInitFunction()
5276 std::string Name = CGM.getOpenMPRuntime().getName({"red_init", ""}); in emitReduceInitFunction()
5278 Name, &CGM.getModule()); in emitReduceInitFunction()
5279 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo); in emitReduceInitFunction()
5281 CodeGenFunction CGF(CGM); in emitReduceInitFunction()
5292 Address SizeAddr = CGM.getOpenMPRuntime().getAddrOfArtificialThreadPrivate( in emitReduceInitFunction()
5293 CGF, CGM.getContext().getSizeType(), in emitReduceInitFunction()
5294 generateUniqueName(CGM, "reduction_size", RCG.getRefExpr(N))); in emitReduceInitFunction()
5296 CGM.getContext().getSizeType(), Loc); in emitReduceInitFunction()
5307 CGM.getContext().VoidPtrTy.castAs<PointerType>()->getTypePtr()); in emitReduceInitFunction()
5328 static llvm::Value *emitReduceCombFunction(CodeGenModule &CGM, in emitReduceCombFunction() argument
5334 ASTContext &C = CGM.getContext(); in emitReduceCombFunction()
5345 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitReduceCombFunction()
5346 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in emitReduceCombFunction()
5347 std::string Name = CGM.getOpenMPRuntime().getName({"red_comb", ""}); in emitReduceCombFunction()
5349 Name, &CGM.getModule()); in emitReduceCombFunction()
5350 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo); in emitReduceCombFunction()
5352 CodeGenFunction CGF(CGM); in emitReduceCombFunction()
5358 Address SizeAddr = CGM.getOpenMPRuntime().getAddrOfArtificialThreadPrivate( in emitReduceCombFunction()
5359 CGF, CGM.getContext().getSizeType(), in emitReduceCombFunction()
5360 generateUniqueName(CGM, "reduction_size", RCG.getRefExpr(N))); in emitReduceCombFunction()
5362 CGM.getContext().getSizeType(), Loc); in emitReduceCombFunction()
5388 CGM.getOpenMPRuntime().emitSingleReductionCombiner( in emitReduceCombFunction()
5403 static llvm::Value *emitReduceFiniFunction(CodeGenModule &CGM, in emitReduceFiniFunction() argument
5408 ASTContext &C = CGM.getContext(); in emitReduceFiniFunction()
5414 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitReduceFiniFunction()
5415 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in emitReduceFiniFunction()
5416 std::string Name = CGM.getOpenMPRuntime().getName({"red_fini", ""}); in emitReduceFiniFunction()
5418 Name, &CGM.getModule()); in emitReduceFiniFunction()
5419 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo); in emitReduceFiniFunction()
5421 CodeGenFunction CGF(CGM); in emitReduceFiniFunction()
5429 Address SizeAddr = CGM.getOpenMPRuntime().getAddrOfArtificialThreadPrivate( in emitReduceFiniFunction()
5430 CGF, CGM.getContext().getSizeType(), in emitReduceFiniFunction()
5431 generateUniqueName(CGM, "reduction_size", RCG.getRefExpr(N))); in emitReduceFiniFunction()
5433 CGM.getContext().getSizeType(), Loc); in emitReduceFiniFunction()
5459 ASTContext &C = CGM.getContext(); in emitTaskReductionInit()
5483 llvm::Value *Idxs[] = {llvm::ConstantInt::get(CGM.SizeTy, /*V=*/0), in emitTaskReductionInit()
5484 llvm::ConstantInt::get(CGM.SizeTy, Cnt)}; in emitTaskReductionInit()
5509 SizeValInChars = CGF.Builder.CreateIntCast(SizeValInChars, CGM.SizeTy, in emitTaskReductionInit()
5515 llvm::Value *InitAddr = emitReduceInitFunction(CGM, Loc, RCG, Cnt); in emitTaskReductionInit()
5519 llvm::Value *Fini = emitReduceFiniFunction(CGM, Loc, RCG, Cnt); in emitTaskReductionInit()
5521 Fini ? Fini : llvm::ConstantPointerNull::get(CGM.VoidPtrTy); in emitTaskReductionInit()
5526 CGM, Loc, RCG, Cnt, Data.ReductionOps[Cnt], LHSExprs[Cnt], in emitTaskReductionInit()
5533 llvm::ConstantInt::get(CGM.Int32Ty, /*V=*/1, /*isSigned=*/true), in emitTaskReductionInit()
5543 CGM.IntTy, /*isSigned=*/true); in emitTaskReductionInit()
5546 llvm::ConstantInt::get(CGM.IntTy, Data.IsWorksharingReduction ? 1 : 0, in emitTaskReductionInit()
5548 llvm::ConstantInt::get(CGM.IntTy, Size, /*isSigned=*/true), in emitTaskReductionInit()
5550 TaskRedInput.getPointer(), CGM.VoidPtrTy)}; in emitTaskReductionInit()
5553 CGM.getModule(), OMPRTL___kmpc_taskred_modifier_init), in emitTaskReductionInit()
5558 CGF.Builder.CreateIntCast(getThreadID(CGF, Loc), CGM.IntTy, in emitTaskReductionInit()
5560 llvm::ConstantInt::get(CGM.IntTy, Size, /*isSigned=*/true), in emitTaskReductionInit()
5562 CGM.VoidPtrTy)}; in emitTaskReductionInit()
5564 CGM.getModule(), OMPRTL___kmpc_taskred_init), in emitTaskReductionInit()
5575 CGM.IntTy, /*isSigned=*/true); in emitTaskReductionFini()
5577 llvm::ConstantInt::get(CGM.IntTy, in emitTaskReductionFini()
5582 CGM.getModule(), OMPRTL___kmpc_task_reduction_modifier_fini), in emitTaskReductionFini()
5594 llvm::Value *SizeVal = CGF.Builder.CreateIntCast(Sizes.second, CGM.SizeTy, in emitTaskReductionFixups()
5597 CGF, CGM.getContext().getSizeType(), in emitTaskReductionFixups()
5598 generateUniqueName(CGM, "reduction_size", RCG.getRefExpr(N))); in emitTaskReductionFixups()
5610 CGM.IntTy, in getTaskReductionItem()
5614 SharedLVal.getPointer(CGF), CGM.VoidPtrTy)}; in getTaskReductionItem()
5618 CGM.getModule(), OMPRTL___kmpc_task_reduction_get_th_data), in getTaskReductionItem()
5628 if (CGF.CGM.getLangOpts().OpenMPIRBuilder && Data.Dependences.empty()) { in emitTaskwaitCall()
5634 auto &M = CGM.getModule(); in emitTaskwaitCall()
5732 CGM.getModule(), OMPRTL___kmpc_cancellationpoint), in emitCancellationPointCall()
5761 auto &M = CGM.getModule(); in emitCancelCall()
5766 CGOpenMPRuntime &RT = CGF.CGM.getOpenMPRuntime(); in emitCancelCall()
5813 CGF.CGM.getOpenMPRuntime().emitUsesAllocatorsInit( in Enter()
5821 CGF.CGM.getOpenMPRuntime().emitUsesAllocatorsFini(CGF, in Exit()
5871 CGM.getModule(), OMPRTL___kmpc_init_allocator), in emitUsesAllocatorsInit()
5894 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in emitUsesAllocatorsFini()
5913 CGM.handleCUDALaunchBoundsAttr(nullptr, Attr, &AttrMaxThreadsVal, in computeMinAndMaxThreadsAndTeams()
5916 CGM.handleAMDGPUFlatWorkGroupSizeAttr( in computeMinAndMaxThreadsAndTeams()
5941 getEntryInfoFromPresumedLoc(CGM, OMPBuilder, D.getBeginLoc(), ParentName); in emitTargetOutlinedFunctionHelper()
5943 CodeGenFunction CGF(CGM, true); in emitTargetOutlinedFunctionHelper()
5959 CGM.getTargetCodeGenInfo().setTargetAttributes(nullptr, OutlinedFn, CGM); in emitTargetOutlinedFunctionHelper()
5964 CGM.handleAMDGPUWavesPerEUAttr(OutlinedFn, Attr); in emitTargetOutlinedFunctionHelper()
7074 CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory())) { in generateInfoForComponentList()
7076 BP = CGF.CGM.getOpenMPRuntime().getAddrOfDeclareTargetVar(VD); in generateInfoForComponentList()
7092 (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || in generateInfoForComponentList()
7520 MapValuesArrayTy CurOffsets = {llvm::ConstantInt::get(CGF.CGM.Int64Ty, 0)}; in generateInfoForComponentList()
7521 MapValuesArrayTy CurCounts = {llvm::ConstantInt::get(CGF.CGM.Int64Ty, 1)}; in generateInfoForComponentList()
7523 MapValuesArrayTy DimSizes{llvm::ConstantInt::get(CGF.CGM.Int64Ty, 1)}; in generateInfoForComponentList()
7588 llvm::ConstantInt::get(CGF.CGM.Int64Ty, ElementTypeSize); in generateInfoForComponentList()
7975 if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || in generateAllInfoForClauses()
8883 CodeGenModule &CGM = CGF.CGM; in emitOffloadingArrays() local
8898 if (CGM.getCodeGenOpts().getDebugInfo() != in emitOffloadingArrays()
8915 MFunc = CGF.CGM.getOpenMPRuntime().getOrCreateUserDefinedMapperFunc( in emitOffloadingArrays()
9073 ASTContext &C = CGM.getContext(); in emitUserDefinedMapper()
9081 llvm::Type *ElemTy = CGM.getTypes().ConvertTypeForMem(Ty); in emitUserDefinedMapper()
9104 CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); in emitUserDefinedMapper()
9105 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in emitUserDefinedMapper()
9108 CGM.getCXXABI().getMangleContext().mangleCanonicalTypeName(Ty, Out); in emitUserDefinedMapper()
9111 Name, &CGM.getModule()); in emitUserDefinedMapper()
9112 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo); in emitUserDefinedMapper()
9115 CodeGenFunction MapperCGF(CGM); in emitUserDefinedMapper()
9135 BeginIn, CGM.getTypes().ConvertTypeForMem(PtrTy)); in emitUserDefinedMapper()
9186 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in emitUserDefinedMapper()
9196 Info.BasePointers[I], CGM.getTypes().ConvertTypeForMem(C.VoidPtrTy)); in emitUserDefinedMapper()
9198 Info.Pointers[I], CGM.getTypes().ConvertTypeForMem(C.VoidPtrTy)); in emitUserDefinedMapper()
9201 (CGM.getCodeGenOpts().getDebugInfo() == in emitUserDefinedMapper()
9203 ? llvm::ConstantPointerNull::get(CGM.VoidPtrTy) in emitUserDefinedMapper()
9282 MapperCGF.Builder.CreatePHI(CGM.Int64Ty, 4, "omp.maptype"); in emitUserDefinedMapper()
9301 CGM.getModule(), OMPRTL___tgt_push_mapper_component), in emitUserDefinedMapper()
9403 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in emitUDMapperArrayInitOrDel()
9428 TD = getNestedDistributeDirective(CGM.getContext(), D); in emitTargetNumIterationsCall()
9499 CodeGenFunction &CGF, CodeGenModule &CGM) { in emitTargetCallKernelLaunch() argument
9583 bool EmitDebug = CGF.CGM.getCodeGenOpts().getDebugInfo() != in emitTargetCallKernelLaunch()
9591 CGF.VoidPtrTy, CGM.getPointerAlign()); in emitTargetCallKernelLaunch()
9593 Address(Info.RTArgs.PointersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); in emitTargetCallKernelLaunch()
9595 Address(Info.RTArgs.SizesArray, CGF.Int64Ty, CGM.getPointerAlign()); in emitTargetCallKernelLaunch()
9597 Address(Info.RTArgs.MappersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); in emitTargetCallKernelLaunch()
9699 const bool OffloadingMandatory = !CGM.getLangOpts().OpenMPIsTargetDevice && in emitTargetCall()
9700 CGM.getLangOpts().OpenMPOffloadMandatory; in emitTargetCall()
9708 (CGM.getLangOpts().OpenMP >= 51 && in emitTargetCall()
9731 MapNamesArray, SizeEmitter, CGF, CGM); in emitTargetCall()
9773 CGM, OMPBuilder, E.getBeginLoc(), ParentName); in scanForTargetRegionsFunctions()
9782 CodeGenFunction::EmitOMPTargetDeviceFunction(CGM, ParentName, in scanForTargetRegionsFunctions()
9787 CGM, ParentName, cast<OMPTargetParallelDirective>(E)); in scanForTargetRegionsFunctions()
9791 CGM, ParentName, cast<OMPTargetTeamsDirective>(E)); in scanForTargetRegionsFunctions()
9795 CGM, ParentName, cast<OMPTargetTeamsDistributeDirective>(E)); in scanForTargetRegionsFunctions()
9799 CGM, ParentName, cast<OMPTargetTeamsDistributeSimdDirective>(E)); in scanForTargetRegionsFunctions()
9803 CGM, ParentName, cast<OMPTargetParallelForDirective>(E)); in scanForTargetRegionsFunctions()
9807 CGM, ParentName, cast<OMPTargetParallelForSimdDirective>(E)); in scanForTargetRegionsFunctions()
9811 CGM, ParentName, cast<OMPTargetSimdDirective>(E)); in scanForTargetRegionsFunctions()
9815 CGM, ParentName, in scanForTargetRegionsFunctions()
9821 CGM, ParentName, in scanForTargetRegionsFunctions()
9826 CGM, ParentName, cast<OMPTargetTeamsGenericLoopDirective>(E)); in scanForTargetRegionsFunctions()
9830 CGM, ParentName, cast<OMPTargetParallelGenericLoopDirective>(E)); in scanForTargetRegionsFunctions()
9931 if (!CGM.getLangOpts().OpenMPIsTargetDevice) { in emitTargetFunctions()
9934 CGM.getLangOpts().OpenMPIsTargetDevice)) in emitTargetFunctions()
9942 StringRef Name = CGM.getMangledName(GD); in emitTargetFunctions()
9945 CGM.getLangOpts().OpenMPIsTargetDevice)) in emitTargetFunctions()
9956 CGM.getLangOpts().OpenMPIsTargetDevice)) in emitTargetGlobalVariable()
9959 if (!CGM.getLangOpts().OpenMPIsTargetDevice) in emitTargetGlobalVariable()
9969 CGM.getMangledName(GlobalDecl(Ctor, Ctor_Complete)); in emitTargetGlobalVariable()
9974 CGM.getMangledName(GlobalDecl(Dtor, Dtor_Complete)); in emitTargetGlobalVariable()
9995 if (CGM.getLangOpts().OMPTargetTriples.empty() && in registerTargetGlobalVariable()
9996 !CGM.getLangOpts().OpenMPIsTargetDevice) in registerTargetGlobalVariable()
10009 if (CGM.getLangOpts().OpenMPIsTargetDevice) { in registerTargetGlobalVariable()
10012 StringRef VarName = CGM.getMangledName(VD); in registerTargetGlobalVariable()
10018 auto AddrOfGlobal = [&VD, this]() { return CGM.GetAddrOfGlobal(VD); }; in registerTargetGlobalVariable()
10020 return CGM.getLLVMLinkageVarDefinition(VD); in registerTargetGlobalVariable()
10026 VD->hasDefinition(CGM.getContext()) == VarDecl::DeclarationOnly, in registerTargetGlobalVariable()
10028 getEntryInfoFromPresumedLoc(CGM, OMPBuilder, in registerTargetGlobalVariable()
10030 CGM.getMangledName(VD), GeneratedRefs, CGM.getLangOpts().OpenMPSimd, in registerTargetGlobalVariable()
10031 CGM.getLangOpts().OMPTargetTriples, AddrOfGlobal, LinkageForVariable, in registerTargetGlobalVariable()
10032 CGM.getTypes().ConvertTypeForMem( in registerTargetGlobalVariable()
10033 CGM.getContext().getPointerType(VD->getType())), in registerTargetGlobalVariable()
10037 CGM.addCompilerUsedGlobal(ref); in registerTargetGlobalVariable()
10057 CGM.EmitGlobal(VD); in emitDeferredTargetDecls()
10064 (void)CGM.getOpenMPRuntime().getAddrOfDeclareTargetVar(VD); in emitDeferredTargetDecls()
10133 CodeGenModule &CGM) in DisableAutoDeclareTargetRAII() argument
10134 : CGM(CGM) { in DisableAutoDeclareTargetRAII()
10135 if (CGM.getLangOpts().OpenMPIsTargetDevice) { in DisableAutoDeclareTargetRAII()
10136 SavedShouldMarkAsGlobal = CGM.getOpenMPRuntime().ShouldMarkAsGlobal; in DisableAutoDeclareTargetRAII()
10137 CGM.getOpenMPRuntime().ShouldMarkAsGlobal = false; in DisableAutoDeclareTargetRAII()
10142 if (CGM.getLangOpts().OpenMPIsTargetDevice) in ~DisableAutoDeclareTargetRAII()
10143 CGM.getOpenMPRuntime().ShouldMarkAsGlobal = SavedShouldMarkAsGlobal; in ~DisableAutoDeclareTargetRAII()
10147 if (!CGM.getLangOpts().OpenMPIsTargetDevice || !ShouldMarkAsGlobal) in markAsGlobalTarget()
10156 CGM.GetGlobalValue(CGM.getMangledName(GD)))) in markAsGlobalTarget()
10187 CGM.getModule(), OMPRTL___kmpc_fork_teams); in emitTeamsCall()
10203 CGF.CGM.Int32Ty, /* isSigned = */ true) in emitNumTeamsClause()
10209 CGF.CGM.Int32Ty, /* isSigned = */ true) in emitNumTeamsClause()
10216 CGM.getModule(), OMPRTL___kmpc_push_num_teams), in emitNumTeamsClause()
10227 CGF.CGM.Int32Ty, /* isSigned = */ true) in emitThreadLimitClause()
10234 CGM.getModule(), OMPRTL___kmpc_set_thread_limit), in emitThreadLimitClause()
10276 if (CGM.getCodeGenOpts().getDebugInfo() != in emitTargetDataCalls()
10320 MFunc = CGF.CGM.getOpenMPRuntime().getOrCreateUserDefinedMapperFunc( in emitTargetDataCalls()
10473 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), RTLFn), in emitTargetDataStandAloneCall()
10493 bool EmitDebug = CGF.CGM.getCodeGenOpts().getDebugInfo() != in emitTargetDataStandAloneCall()
10500 CGF.VoidPtrTy, CGM.getPointerAlign()); in emitTargetDataStandAloneCall()
10502 CGM.getPointerAlign()); in emitTargetDataStandAloneCall()
10504 Address(Info.RTArgs.SizesArray, CGF.Int64Ty, CGM.getPointerAlign()); in emitTargetDataStandAloneCall()
10506 Address(Info.RTArgs.MappersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); in emitTargetDataStandAloneCall()
10852 CodeGenModule &CGM, const FunctionDecl *FD, unsigned UserVLEN, in emitAArch64DeclareSimdFunction() argument
10866 unsigned DiagID = CGM.getDiags().getCustomDiagID( in emitAArch64DeclareSimdFunction()
10869 CGM.getDiags().Report(SLoc, DiagID); in emitAArch64DeclareSimdFunction()
10876 unsigned DiagID = CGM.getDiags().getCustomDiagID( in emitAArch64DeclareSimdFunction()
10879 CGM.getDiags().Report(SLoc, DiagID); in emitAArch64DeclareSimdFunction()
10887 unsigned DiagID = CGM.getDiags().getCustomDiagID( in emitAArch64DeclareSimdFunction()
10892 CGM.getDiags().Report(SLoc, DiagID) << WDS; in emitAArch64DeclareSimdFunction()
10961 ASTContext &C = CGM.getContext(); in emitDeclareSimdFunction()
11028 PtrRescalingFactor = CGM.getContext() in emitDeclareSimdFunction()
11038 PtrRescalingFactor = CGM.getContext() in emitDeclareSimdFunction()
11044 CGM.getContext() in emitDeclareSimdFunction()
11095 if (CGM.getTriple().isX86()) { in emitDeclareSimdFunction()
11097 } else if (CGM.getTriple().getArch() == llvm::Triple::aarch64) { in emitDeclareSimdFunction()
11100 if (CGM.getTarget().hasFeature("sve")) in emitDeclareSimdFunction()
11101 emitAArch64DeclareSimdFunction(CGM, FD, VLEN, ParamAttrs, State, in emitDeclareSimdFunction()
11103 else if (CGM.getTarget().hasFeature("neon")) in emitDeclareSimdFunction()
11104 emitAArch64DeclareSimdFunction(CGM, FD, VLEN, ParamAttrs, State, in emitDeclareSimdFunction()
11143 ASTContext &C = CGM.getContext(); in emitDoacrossInit()
11183 CGF.EmitStoreOfScalar(llvm::ConstantInt::getSigned(CGM.Int64Ty, /*V=*/1), in emitDoacrossInit()
11192 llvm::ConstantInt::getSigned(CGM.Int32Ty, NumIterations.size()), in emitDoacrossInit()
11195 CGM.VoidPtrTy)}; in emitDoacrossInit()
11198 CGM.getModule(), OMPRTL___kmpc_doacross_init); in emitDoacrossInit()
11203 CGM.getModule(), OMPRTL___kmpc_doacross_fini); in emitDoacrossInit()
11209 static void EmitDoacrossOrdered(CodeGenFunction &CGF, CodeGenModule &CGM, in EmitDoacrossOrdered() argument
11213 CGM.getContext().getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in EmitDoacrossOrdered()
11215 QualType ArrayTy = CGM.getContext().getConstantArrayType( in EmitDoacrossOrdered()
11231 llvm::OpenMPIRBuilder &OMPBuilder = CGM.getOpenMPRuntime().getOMPBuilder(); in EmitDoacrossOrdered()
11234 RTLFn = OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in EmitDoacrossOrdered()
11238 RTLFn = OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), in EmitDoacrossOrdered()
11247 CGF, CGM, C, emitUpdateLocation(CGF, C->getBeginLoc()), in emitDoacrossOrdered()
11254 CGF, CGM, C, emitUpdateLocation(CGF, C->getBeginLoc()), in emitDoacrossOrdered()
11306 CGF.CGM.getTypes().ConvertType(CGF.getContext().VoidPtrTy)); in getAllocatorVal()
11312 static llvm::Value *getAlignmentValue(CodeGenModule &CGM, const VarDecl *VD) { in getAlignmentValue() argument
11313 std::optional<CharUnits> AllocateAlignment = CGM.getOMPAllocateAlignment(VD); in getAlignmentValue()
11318 return llvm::ConstantInt::get(CGM.SizeTy, AllocateAlignment->getQuantity()); in getAlignmentValue()
11343 CharUnits Align = CGM.getContext().getDeclAlign(CVD); in getAddressOfLocalVariable()
11348 Size, CGM.getSize(Align - CharUnits::fromQuantity(1))); in getAddressOfLocalVariable()
11349 Size = CGF.Builder.CreateUDiv(Size, CGM.getSize(Align)); in getAddressOfLocalVariable()
11350 Size = CGF.Builder.CreateNUWMul(Size, CGM.getSize(Align)); in getAddressOfLocalVariable()
11352 CharUnits Sz = CGM.getContext().getTypeSizeInChars(CVD->getType()); in getAddressOfLocalVariable()
11353 Size = CGM.getSize(Sz.alignTo(Align)); in getAddressOfLocalVariable()
11359 llvm::Value *Alignment = getAlignmentValue(CGM, CVD); in getAddressOfLocalVariable()
11369 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), FnID), Args, in getAddressOfLocalVariable()
11372 CGM.getModule(), OMPRTL___kmpc_free); in getAddressOfLocalVariable()
11373 QualType Ty = CGM.getContext().getPointerType(CVD->getType()); in getAddressOfLocalVariable()
11396 Args[0] = CGF.CGM.getOpenMPRuntime().getThreadID( in getAddressOfLocalVariable()
11430 CodeGenModule &CGM, const OMPLoopDirective &S) in NontemporalDeclsRAII() argument
11431 : CGM(CGM), NeedToPush(S.hasClausesOfKind<OMPNontemporalClause>()) { in NontemporalDeclsRAII()
11432 assert(CGM.getLangOpts().OpenMP && "Not in OpenMP mode."); in NontemporalDeclsRAII()
11436 CGM.getOpenMPRuntime().NontemporalDeclsStack.emplace_back(); in NontemporalDeclsRAII()
11458 CGM.getOpenMPRuntime().NontemporalDeclsStack.pop_back(); in ~NontemporalDeclsRAII()
11465 : CGM(CGF.CGM), NeedToPush(!LocalVars.empty()) { in UntiedTaskLocalDeclsRAII()
11468 CGM.getOpenMPRuntime().FunctionToUntiedTaskStackMap.try_emplace( in UntiedTaskLocalDeclsRAII()
11469 CGF.CurFn, CGM.getOpenMPRuntime().UntiedLocalVarsStack.size()); in UntiedTaskLocalDeclsRAII()
11470 CGM.getOpenMPRuntime().UntiedLocalVarsStack.push_back(LocalVars); in UntiedTaskLocalDeclsRAII()
11476 CGM.getOpenMPRuntime().UntiedLocalVarsStack.pop_back(); in ~UntiedTaskLocalDeclsRAII()
11480 assert(CGM.getLangOpts().OpenMP && "Not in OpenMP mode."); in isNontemporalDecl()
11483 CGM.getOpenMPRuntime().NontemporalDeclsStack, in isNontemporalDecl()
11556 llvm::reverse(CGM.getOpenMPRuntime().LastprivateConditionalStack)) { in tryToDisableInnerAnalysis()
11568 : CGM(CGF.CGM), in LastprivateConditionalRAII()
11569 Action((CGM.getLangOpts().OpenMP >= 50 && in LastprivateConditionalRAII()
11577 assert(CGM.getLangOpts().OpenMP && "Not in OpenMP mode.");
11578 if (CGM.getLangOpts().OpenMP < 50 || Action == ActionToDo::DoNotPush)
11583 CGM.getOpenMPRuntime().LastprivateConditionalStack.emplace_back();
11591 SmallString<16>(generateUniqueName(CGM, "pl_cond", Ref))));
11600 : CGM(CGF.CGM), Action(ActionToDo::DoNotPush) { in LastprivateConditionalRAII()
11601 assert(CGM.getLangOpts().OpenMP && "Not in OpenMP mode."); in LastprivateConditionalRAII()
11602 if (CGM.getLangOpts().OpenMP < 50) in LastprivateConditionalRAII()
11609 CGM.getOpenMPRuntime().LastprivateConditionalStack.emplace_back(); in LastprivateConditionalRAII()
11624 if (CGM.getLangOpts().OpenMP < 50) in ~LastprivateConditionalRAII()
11627 assert(CGM.getOpenMPRuntime().LastprivateConditionalStack.back().Disabled && in ~LastprivateConditionalRAII()
11629 CGM.getOpenMPRuntime().LastprivateConditionalStack.pop_back(); in ~LastprivateConditionalRAII()
11633 !CGM.getOpenMPRuntime().LastprivateConditionalStack.back().Disabled && in ~LastprivateConditionalRAII()
11635 CGM.getOpenMPRuntime().LastprivateConditionalStack.pop_back(); in ~LastprivateConditionalRAII()
11641 ASTContext &C = CGM.getContext(); in emitLastprivateConditionalInit()
11824 if (CGM.getLangOpts().OpenMPSimd) { in emitLastprivateConditionalUpdate()
11936 llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(UniqueName); in emitLastprivateConditionalFinalUpdate()