diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp index 65e72e0ed9a20..11ba5c91dae9b 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -721,8 +721,9 @@ class AMDGPULowerModuleLDS : public ModulePass { if (K.second.size() == 1) { KernelAccessVariables.insert(GV); } else { - report_fatal_error("Cannot lower LDS to kernel access as it is " - "reachable from multiple kernels"); + report_fatal_error( + "cannot lower LDS '" + GV->getName() + + "' to kernel access as it is reachable from multiple kernels"); } break; diff --git a/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-ambiguous.ll b/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-ambiguous.ll index 66d357f724c3c..bb2fc02f5af5e 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-ambiguous.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-ambiguous.ll @@ -36,7 +36,7 @@ define amdgpu_kernel void @k1() { ;; Function accesses variable, reachable from two kernels, can't use kernel lowering for either ;; Hybrid can put it in module lds without cost as the first variable is free -; KERNEL: LLVM ERROR: Cannot lower LDS to kernel access as it is reachable from multiple kernels +; KERNEL: LLVM ERROR: cannot lower LDS 'function.lds' to kernel access as it is reachable from multiple kernels @function.lds = addrspace(3) global i16 undef define void @f0() {