[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 12 14:25:54 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, ronlieb, arsenm, yaxunl, tianshilei1992, ye-luo.
Herald added subscribers: kosarev, kerbowa, guansong, t-tye, tpr, dstuttard, jvesely, kzhuravl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1, MaskRay, wdng.
Herald added a project: clang.

Previously, we linked in the ROCm device libraries which provide math
and other utility functions late. This is not stricly correct as this
library contains several flags that are only set per-TU, such as fast
math or denormalization. This patch changes this to pass the bitcode
libraries per-TU using the same method we use for the CUDA libraries.
This has the advantage that we correctly propagate attributes making
this implementation more correct. Additionally, many annoying unused
functions were not being fully removed during LTO. This lead to
erroneous warning messages and remarks on unused functions.

I am not sure if not finding these libraries should be a hard error. let
me know if it should be demoted to a warning saying that some device
utilities will not work without them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133726

Files:
  clang/lib/Driver/ToolChains/AMDGPU.cpp
  clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
  clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/amdgpu-openmp-toolchain.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133726.459558.patch
Type: text/x-patch
Size: 6132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220912/aa7d3eeb/attachment-0001.bin>


More information about the cfe-commits mailing list