Lines Matching refs:CGM

92     return CGM.GetAddrOfConstantCString(Str, Name.c_str()).getPointer();  in makeConstantString()
128 CGBuilderTy FuncBuilder(CGM, Context); in makeDummyFunction()
173 CGNVCUDARuntime(CodeGenModule &CGM);
194 if (CGM.getLangOpts().HIP) in addPrefixToName()
200 if (CGM.getLangOpts().HIP) in addUnderscoredPrefixToName()
205 static std::unique_ptr<MangleContext> InitDeviceMC(CodeGenModule &CGM) { in InitDeviceMC() argument
209 if (CGM.getContext().getAuxTargetInfo() && in InitDeviceMC()
210 CGM.getContext().getTargetInfo().getCXXABI().isMicrosoft() && in InitDeviceMC()
211 CGM.getContext().getAuxTargetInfo()->getCXXABI().isItaniumFamily()) { in InitDeviceMC()
213 CGM.getContext().createDeviceMangleContext( in InitDeviceMC()
214 *CGM.getContext().getAuxTargetInfo())); in InitDeviceMC()
217 return std::unique_ptr<MangleContext>(CGM.getContext().createMangleContext( in InitDeviceMC()
218 CGM.getContext().getAuxTargetInfo())); in InitDeviceMC()
221 CGNVCUDARuntime::CGNVCUDARuntime(CodeGenModule &CGM) in CGNVCUDARuntime() argument
222 : CGCUDARuntime(CGM), Context(CGM.getLLVMContext()), in CGNVCUDARuntime()
223 TheModule(CGM.getModule()), in CGNVCUDARuntime()
224 RelocatableDeviceCode(CGM.getLangOpts().GPURelocatableDeviceCode), in CGNVCUDARuntime()
225 DeviceMC(InitDeviceMC(CGM)) { in CGNVCUDARuntime()
226 IntTy = CGM.IntTy; in CGNVCUDARuntime()
227 SizeTy = CGM.SizeTy; in CGNVCUDARuntime()
228 VoidTy = CGM.VoidTy; in CGNVCUDARuntime()
229 PtrTy = CGM.UnqualPtrTy; in CGNVCUDARuntime()
235 return CGM.CreateRuntimeFunction( in getSetupArgumentFn()
241 if (CGM.getLangOpts().HIP) { in getLaunchFn()
243 return CGM.CreateRuntimeFunction( in getLaunchFn()
247 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(IntTy, PtrTy, false), in getLaunchFn()
274 if (CGM.getLangOpts().CUDAIsDevice) in getDeviceSideName()
275 MC = &CGM.getCXXABI().getMangleContext(); in getDeviceSideName()
287 if (CGM.getContext().shouldExternalize(ND) && in getDeviceSideName()
288 CGM.getLangOpts().GPURelocatableDeviceCode) { in getDeviceSideName()
292 CGM.printPostfixForExternalizedDecl(Out, ND); in getDeviceSideName()
306 if (CudaFeatureEnabled(CGM.getTarget().getSDKVersion(), in emitDeviceStub()
347 TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl(); in emitDeviceStubBodyNew()
359 CGM.getContext().Idents.get(LaunchKernelName); in emitDeviceStubBodyNew()
367 CGM.Error(CGF.CurFuncDecl->getLocation(), in emitDeviceStubBodyNew()
379 CGF.CreateTempAlloca(SizeTy, CGM.getSizeAlign(), "shmem_size"); in emitDeviceStubBodyNew()
380 Address Stream = CGF.CreateTempAlloca(PtrTy, CGM.getPointerAlign(), "stream"); in emitDeviceStubBodyNew()
381 llvm::FunctionCallee cudaPopConfigFn = CGM.CreateRuntimeFunction( in emitDeviceStubBodyNew()
412 llvm::Type *Ty = CGM.getTypes().ConvertType(CQT); in emitDeviceStubBodyNew()
416 CGM.getTypes().arrangeFunctionDeclaration(cudaLaunchKernelFD); in emitDeviceStubBodyNew()
418 CGM.CreateRuntimeFunction(FTy, LaunchKernelName); in emitDeviceStubBodyNew()
425 if (CGM.getContext().getTargetInfo().getCXXABI().isMicrosoft() && in emitDeviceStubBodyNew()
431 CGM.getModule().getNamedGlobal(GlobalVarName); in emitDeviceStubBodyNew()
434 CGM.getModule(), CGM.Int8Ty, in emitDeviceStubBodyNew()
436 llvm::ConstantInt::get(CGM.Int8Ty, 0), GlobalVarName); in emitDeviceStubBodyNew()
440 HandleVar->setComdat(CGM.getModule().getOrInsertComdat(GlobalVarName)); in emitDeviceStubBodyNew()
443 CGF.Builder.CreateAlignedStore(llvm::ConstantInt::get(CGM.Int8Ty, 1), in emitDeviceStubBodyNew()
460 auto TInfo = CGM.getContext().getTypeInfoInChars(A->getType()); in emitDeviceStubBodyLegacy()
553 CGBuilderTy Builder(CGM, Context); in makeRegisterGlobalsFn()
561 llvm::FunctionCallee RegisterFunc = CGM.CreateRuntimeFunction( in makeRegisterGlobalsFn()
589 if (CGM.getLangOpts().HIP || in makeRegisterGlobalsFn()
590 ToCudaVersion(CGM.getTarget().getSDKVersion()) >= CudaVersion::CUDA_90) in makeRegisterGlobalsFn()
597 llvm::FunctionCallee RegisterVar = CGM.CreateRuntimeFunction( in makeRegisterGlobalsFn()
604 llvm::FunctionCallee RegisterManagedVar = CGM.CreateRuntimeFunction( in makeRegisterGlobalsFn()
609 llvm::FunctionCallee RegisterSurf = CGM.CreateRuntimeFunction( in makeRegisterGlobalsFn()
615 llvm::FunctionCallee RegisterTex = CGM.CreateRuntimeFunction( in makeRegisterGlobalsFn()
628 CGM.getDataLayout().getTypeAllocSize(Var->getValueType()); in makeRegisterGlobalsFn()
632 auto *ManagedVar = CGM.getModule().getNamedGlobal( in makeRegisterGlobalsFn()
699 bool IsHIP = CGM.getLangOpts().HIP; in makeModuleCtorFunction()
700 bool IsCUDA = CGM.getLangOpts().CUDA; in makeModuleCtorFunction()
702 StringRef CudaGpuBinaryFileName = CGM.getCodeGenOpts().CudaGpuBinaryFileName; in makeModuleCtorFunction()
717 llvm::FunctionCallee RegisterFatbinFunc = CGM.CreateRuntimeFunction( in makeModuleCtorFunction()
730 auto VFS = CGM.getFileSystem(); in makeModuleCtorFunction()
734 CGM.getDiags().Report(diag::err_cannot_open_file) in makeModuleCtorFunction()
747 CGBuilderTy CtorBuilder(CGM, Context); in makeModuleCtorFunction()
776 CGM.getModule(), CGM.Int8Ty, in makeModuleCtorFunction()
778 "__hip_fatbin_" + CGM.getContext().getCUIDHash(), nullptr, in makeModuleCtorFunction()
786 FatbinConstantName = CGM.getTriple().isMacOSX() in makeModuleCtorFunction()
791 CGM.getTriple().isMacOSX() ? "__NV_CUDA,__nv_fatbin" : ".nv_fatbin"; in makeModuleCtorFunction()
794 CGM.getTriple().isMacOSX() ? "__NV_CUDA,__fatbin" : ".nvFatBinSegment"; in makeModuleCtorFunction()
796 ModuleIDSectionName = CGM.getTriple().isMacOSX() in makeModuleCtorFunction()
809 ConstantInitBuilder Builder(CGM); in makeModuleCtorFunction()
820 addUnderscoredPrefixToName("_fatbin_wrapper"), CGM.getPointerAlign(), in makeModuleCtorFunction()
846 : "__hip_gpubin_handle_" + CGM.getContext().getCUIDHash()); in makeModuleCtorFunction()
847 GpuBinaryHandle->setAlignment(CGM.getPointerAlign().getAsAlign()); in makeModuleCtorFunction()
886 GpuBinaryHandle->setAlignment(CGM.getPointerAlign().getAsAlign()); in makeModuleCtorFunction()
888 CGM.getPointerAlign()); in makeModuleCtorFunction()
895 if (CudaFeatureEnabled(CGM.getTarget().getSDKVersion(), in makeModuleCtorFunction()
898 llvm::FunctionCallee RegisterFatbinEndFunc = CGM.CreateRuntimeFunction( in makeModuleCtorFunction()
919 llvm::FunctionCallee RegisterLinkedBinaryFunc = CGM.CreateRuntimeFunction( in makeModuleCtorFunction()
936 CGM.CreateRuntimeFunction(AtExitTy, "atexit", llvm::AttributeList(), in makeModuleCtorFunction()
970 llvm::FunctionCallee UnregisterFatbinFunc = CGM.CreateRuntimeFunction( in makeModuleDtorFunction()
981 CGBuilderTy DtorBuilder(CGM, Context); in makeModuleDtorFunction()
991 if (CGM.getLangOpts().HIP) { in makeModuleDtorFunction()
1013 CGCUDARuntime *CodeGen::CreateNVCUDARuntime(CodeGenModule &CGM) { in CreateNVCUDARuntime() argument
1014 return new CGNVCUDARuntime(CGM); in CreateNVCUDARuntime()
1026 if (CGM.getLangOpts().GPURelocatableDeviceCode) in internalizeDeviceSideVar()
1059 CGM.getContext().CUDADeviceVarODRUsedByHost.contains(D) || in handleVarRegistration()
1101 CGM.getModule(), Var->getType(), in transformManagedVars()
1108 CGM.getContext().getTargetAddressSpace(CGM.getLangOpts().CUDAIsDevice in transformManagedVars()
1119 if (CGM.getLangOpts().CUDAIsDevice && !Var->isDeclaration()) { in transformManagedVars()
1121 CGM.addCompilerUsedGlobal(Var); in transformManagedVars()
1122 CGM.addCompilerUsedGlobal(ManagedVar); in transformManagedVars()
1132 StringRef Section = CGM.getLangOpts().HIP ? "hip_offloading_entries" in createOffloadingEntries()
1134 llvm::Module &M = CGM.getModule(); in createOffloadingEntries()
1143 CGM.getDataLayout().getTypeAllocSize(I.Var->getValueType()); in createOffloadingEntries()
1178 if (CGM.getLangOpts().CUDAIsDevice) { in finalizeModule()
1197 CGM.addCompilerUsedGlobal(Info.Var); in finalizeModule()
1202 if (CGM.getLangOpts().OffloadingNewDriver && RelocatableDeviceCode) in finalizeModule()
1220 if (CGM.getLangOpts().HIP) { in getKernelHandle()
1231 if (!CGM.getLangOpts().HIP) { in getKernelHandle()
1240 CGM.getMangledName( in getKernelHandle()
1242 Var->setAlignment(CGM.getPointerAlign().getAsAlign()); in getKernelHandle()
1248 CGM.maybeSetTrivialComdat(*FD, *Var); in getKernelHandle()