AMDGPU: Diagnose which LDS global failed to lower
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 3 Jan 2023 14:21:56 +0000 (09:21 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 3 Jan 2023 14:31:07 +0000 (09:31 -0500)
Also lowercase the message to start since that seems to be the
prevailing convention for error messages.

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

index 65e72e0..11ba5c9 100644 (file)
@@ -721,8 +721,9 @@ public:
           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;
 
index 66d357f..bb2fc02 100644 (file)
@@ -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() {