[llvm] [AMDGPU] Set gfx13 LDS to 192KB and model LDS size via subtarget features (PR #214513)

Mariusz Sikora via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 06:26:51 PDT 2026


================
@@ -0,0 +1,21 @@
+; RUN: llc -mtriple=amdgpu13.10--amdpal < %s | FileCheck %s --check-prefixes=CHECK
+
+; GFX1310 allocates LDS with 256-dword (1024-byte) granularity. So .lds_size is
+; the requested size rounded up to the next 1024 bytes (0x5808 -> 0x5c00).
+
+; CHECK: .gs:
+; CHECK: .entry_point_symbol: gs_shader_granularity_256DW
+; CHECK-NEXT: .forward_progress: true
+; CHECK-NEXT: .lds_size:       0x5c00
+
+ at LDS.GS = external addrspace(3) global [u0x5808 x i8], align 4
+
+define dllexport amdgpu_gs void @gs_shader_granularity_256DW() {
+  %ptr = getelementptr i8, ptr addrspace(3) @LDS.GS, i8 0
+  store i8 0, ptr addrspace(3) %ptr, align 4
+  ret void
+}
+
+!amdgpu.pal.metadata.msgpack = !{!0}
----------------
mariusz-sikora-at-amd wrote:

Now I know why it is needed. By default we are using PAL 2.6. If you use `amdgpu_vs/gs/ps/es/hs/ls` then you need to have PAL 3.0+ to print `.lds_size`. But if you use `amdgpu_kernel, amdgpu_cs` it won't check the PAL version.

This line is outside of the PAL version check : https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp#L1790

https://github.com/llvm/llvm-project/pull/214513


More information about the llvm-commits mailing list