1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[AMDGPU] Disable LDS lowering for GFX shaders

Apparently these need external LDS symbols to remain.

Fixes: SC1-3279

Differential Revision: https://reviews.llvm.org/D106288
This commit is contained in:
Stanislav Mekhanoshin 2021-07-16 09:15:10 -07:00
parent a09883bcb0
commit c99f31d90e
2 changed files with 19 additions and 1 deletions

View File

@ -162,7 +162,8 @@ public:
bool Changed = processUsedLDS(M);
for (Function &F : M.functions()) {
if (!AMDGPU::isKernelCC(&F))
// Only lower compute kernels' LDS.
if (!AMDGPU::isKernel(F.getCallingConv()))
continue;
Changed |= processUsedLDS(M, &F);
}

View File

@ -12,6 +12,7 @@
;.
; CHECK: @lds.size.8.align.8 = internal unnamed_addr addrspace(3) global [8 x i8] undef, align 8
; CHECK: @lds.k2 = addrspace(3) global [1 x i8] undef, align 1
; CHECK: @llvm.amdgcn.kernel.k0.lds = internal addrspace(3) global %llvm.amdgcn.kernel.k0.lds.t undef, align 16
; CHECK: @llvm.amdgcn.kernel.k1.lds = internal addrspace(3) global %llvm.amdgcn.kernel.k1.lds.t undef, align 16
;.
@ -63,3 +64,19 @@ define amdgpu_kernel void @k1() {
ret void
}
; Do not lower LDS for graphics shaders.
@lds.k2 = addrspace(3) global [1 x i8] undef, align 1
define amdgpu_ps void @k2() {
; CHECK-LABEL: @k2(
; CHECK-NEXT: %lds.k2.bc = bitcast [1 x i8] addrspace(3)* @lds.k2 to i8 addrspace(3)*
; CHECK-NEXT: store i8 1, i8 addrspace(3)* %lds.k2.bc, align 1
; CHECK-NEXT: ret void
;
%lds.k2.bc = bitcast [1 x i8] addrspace(3)* @lds.k2 to i8 addrspace(3)*
store i8 1, i8 addrspace(3)* %lds.k2.bc, align 1
ret void
}