[PATCH] D155132: [amdgpu][lds] Raise an explicit unimplemented error on absolute address LDS variables

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 03:32:39 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9418c40af7ec: [amdgpu][lds] Raise an explicit unimplemented error on absolute address LDS… (authored by JonChesterfield).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155132/new/

https://reviews.llvm.org/D155132

Files:
  llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
  llvm/test/CodeGen/AMDGPU/lds-reject-absolute-addresses.ll


Index: llvm/test/CodeGen/AMDGPU/lds-reject-absolute-addresses.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AMDGPU/lds-reject-absolute-addresses.ll
@@ -0,0 +1,15 @@
+; RUN: not --crash opt -S -mtriple=amdgcn-- -amdgpu-lower-module-lds < %s 2>&1 | FileCheck %s
+; RUN: not --crash opt -S -mtriple=amdgcn-- -passes=amdgpu-lower-module-lds < %s 2>&1 | FileCheck %s
+
+ at var1 = addrspace(3) global i32 undef, !absolute_symbol !0
+
+; CHECK: LLVM ERROR: LDS variables with absolute addresses are unimplemented.
+define amdgpu_kernel void @kern() {
+  %val0 = load i32, ptr addrspace(3) @var1
+  %val1 = add i32 %val0, 4
+  store i32 %val1, ptr addrspace(3) @var1
+  ret void
+}
+
+!0 = !{i64 0, i64 1}
+
Index: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
@@ -354,6 +354,11 @@
         continue;
       }
 
+      if (GV.isAbsoluteSymbolRef()) {
+        report_fatal_error(
+            "LDS variables with absolute addresses are unimplemented.");
+      }
+
       for (User *V : GV.users()) {
         if (auto *I = dyn_cast<Instruction>(V)) {
           Function *F = I->getFunction();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155132.539928.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/2fe3669d/attachment.bin>


More information about the llvm-commits mailing list