[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 09:31:21 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, yaxunl, saiislam, arsenm, carlo.bertolli, MaskRay, jdoerfert, tianshilei1992.
Herald added subscribers: kosarev, StephenFan, t-tye, tpr, dstuttard, jvesely, kzhuravl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, wdng.
Herald added a project: clang.

The AMDGPU library uses several control constants to change code paths
for the math functions and intrinsics. These are normally included using
several individual bitcode libraries at link time. However, this is
problematic because it requires us to know the AMDGPU architecture at
link time which should not be strictly necessary. This patch adds new
code that emits the constants that would normally be included by the
bitcode libraries. This removes around six libraries we would otherwise
need to include and now we can link these libraries in unconditionally
like we do with libdevice.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130096

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/lib/CodeGen/TargetInfo.h
  clang/test/CodeGen/amdgcn-occl-constants.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130096.445849.patch
Type: text/x-patch
Size: 7920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220719/5a47bf6c/attachment-0001.bin>


More information about the cfe-commits mailing list