[all-commits] [llvm/llvm-project] 49ff6a: [Clang] Define AMDGPU ABI when referenced in CodeG...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Sep 13 06:31:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49ff6a96a7dcd4c9d2d353c2ea809b25f2610b19
      https://github.com/llvm/llvm-project/commit/49ff6a96a7dcd4c9d2d353c2ea809b25f2610b19
  Author: Joseph Huber <35342157+jhuber6 at users.noreply.github.com>
  Date:   2023-09-13 (Wed, 13 Sep 2023)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/Targets/AMDGPU.cpp
    A clang/test/CodeGen/amdgpu-abi-version.c
    M clang/test/CodeGenCUDA/amdgpu-workgroup-size.cu

  Log Message:
  -----------
  [Clang] Define AMDGPU ABI when referenced in CodeGen for ABI "none" (#66162)

Summary:
We use the `llvm.amgcn.abi.version` varaible to control code generation.
This is emitted in every module now to indicate what should be used when
compiling. Previously, the logic caused us to emit an external reference
to this variable when creating the code for the `none` type. This would
then cause us not to emit the actual definition. This patch refines the
logic to create the external reference, and then update it if it is
found unset by the time we emit the global. I had to remove the
reference to `GetOrCreateLLVmGlobal` because it did not accept the
proper address space.




More information about the All-commits mailing list