[PATCH] D105981: [AMDGPU][OpenMP] Support linking of math libraries

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 28 07:43:52 PDT 2021


JonChesterfield added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:831-860
   auto Kind = llvm::AMDGPU::parseArchAMDGCN(GpuArch);
   const StringRef CanonArch = llvm::AMDGPU::getArchNameAMDGCN(Kind);
   std::string LibDeviceFile = RocmInstallation.getLibDeviceFile(CanonArch);
   if (LibDeviceFile.empty()) {
     getDriver().Diag(diag::err_drv_no_rocm_device_lib) << 1 << GpuArch;
     return;
   }
----------------
yaxunl wrote:
> I think we'd better absorb this part into the newly added function getCommonDeviceLibOptions so that we have a centralized location for determining device libs. We could use offload kind of the toolchain to differentiate between OpenCL/HIP/OpenMP.
getCommonBitcodeLibs is called by opencl with some other set of constraints around argument names.

Persuading opencl to use the same arguments, getting rid of some of the files, doing things with aliasing, or however else we want to dice this problem is separable from linking the bitcode into openmp and can be left for a later patch. Using a common path for HIP and OpenMP seems a step in the right direction.

It might take quite a long time to reach consensus on how to deduplicate the two remaining copies, which I'd guess is why they were copy/pasted to begin with.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105981/new/

https://reviews.llvm.org/D105981



More information about the cfe-commits mailing list