[llvm] [AMDGPU] Emit the relocation symbol for LDS and named barrier when object linking is enabled (PR #192380)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 07:49:28 PDT 2026
================
@@ -8348,6 +8348,16 @@ bool SITargetLowering::shouldUseLDSConstAddress(const GlobalValue *GV) const {
if (!GV->hasExternalLinkage())
return true;
+ // With object linking, external LDS declarations need relocations so the
+ // linker can assign their offsets.
+ if (AMDGPUTargetMachine::EnableObjectLinking) {
+ if (const auto *GVar = dyn_cast<GlobalVariable>(GV)) {
+ if (GVar->isDeclaration() &&
+ GVar->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS)
----------------
jmmartinez wrote:
Isn't this always the case (local address and declaration)?
https://github.com/llvm/llvm-project/pull/192380
More information about the llvm-commits
mailing list