[llvm] 6fed2c9 - AMDGPU: Diagnose which LDS global failed to lower

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 06:31:11 PST 2023


Author: Matt Arsenault
Date: 2023-01-03T09:31:07-05:00
New Revision: 6fed2c90d3b9fabe8742ae1308632c06dd4b76ea

URL: https://github.com/llvm/llvm-project/commit/6fed2c90d3b9fabe8742ae1308632c06dd4b76ea
DIFF: https://github.com/llvm/llvm-project/commit/6fed2c90d3b9fabe8742ae1308632c06dd4b76ea.diff

LOG: AMDGPU: Diagnose which LDS global failed to lower

Also lowercase the message to start since that seems to be the
prevailing convention for error messages.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
    llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-ambiguous.ll

Removed: 
    


################################################################################
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() {


        


More information about the llvm-commits mailing list