[all-commits] [llvm/llvm-project] 1d97cb: [HIP] Emit amdgpu_code_object_version module flag

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue Feb 8 18:59:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d97cb1f6e44a77cfc6911b916656e3c5de9bec8
      https://github.com/llvm/llvm-project/commit/1d97cb1f6e44a77cfc6911b916656e3c5de9bec8
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

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

  Log Message:
  -----------
  [HIP] Emit amdgpu_code_object_version module flag

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.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D119026




More information about the All-commits mailing list