[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 11:36:02 PST 2022


yaxunl created this revision.
yaxunl added reviewers: tra, b-sumner.
Herald added subscribers: dang, kerbowa, t-tye, tpr, dstuttard, jvesely, kzhuravl.
yaxunl requested review of this revision.
Herald added a subscriber: wdng.

code object version determines ABI, therefore should not be mixed.

This patch emits amdgpu_code_object_version module flag in LLVM IR
based on code object version (default 4).

The amdgpu_code_object_version value is code object version times 100.

LLVM IR with different amdgpu_code_object_version module flag cannot
be linked.

The -cc1 option -mcode-object-version=none is for ROCm device library use
only, which supports multiple ABI.


https://reviews.llvm.org/D119026

Files:
  clang/include/clang/Basic/TargetOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/CodeGenCUDA/amdgpu-asan-printf.cu
  clang/test/CodeGenCUDA/amdgpu-asan.cu
  clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
  clang/test/Driver/hip-code-object-version.hip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119026.406054.patch
Type: text/x-patch
Size: 8334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220204/5074c534/attachment.bin>


More information about the cfe-commits mailing list