[all-commits] [llvm/llvm-project] 624f12: [amdgpu] Drop lowering of LDS used by global varia...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Tue Dec 14 13:59:43 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 624f12d34f94a9e814753f26f0b499870697b68c
      https://github.com/llvm/llvm-project/commit/624f12d34f94a9e814753f26f0b499870697b68c
  Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
  Date:   2021-12-14 (Tue, 14 Dec 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp
    M llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h
    R llvm/test/CodeGen/AMDGPU/lower-kernel-lds-global-uses.ll
    R llvm/test/CodeGen/AMDGPU/lower-module-lds-global-alias.ll
    R llvm/test/CodeGen/AMDGPU/lower-module-lds-global-uses.ll
    R llvm/test/CodeGen/AMDGPU/lower-module-lds-indirect.ll

  Log Message:
  -----------
  [amdgpu] Drop lowering of LDS used by global variables

Approximately revert D103431.

LDS variables are allocated at kernel launch and deallocated at kernel exit.
The address is therefore kernel execution dependent. Global variables are
initialized by values written to .data, which can't be done for a LDS variable
as there is no kernel running, or by a global constructor. Initializing the
global to the address of some LDS allocated by a global constructor is possible
but indistinguishable from undef.

Assigning the address of a LDS variable to a global should be a sema error. It
isn't for openmp, haven't checked other languages. Failing that it could be set
to undef, perhaps in this pass.

Reviewed By: rampitec

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




More information about the All-commits mailing list