[PATCH] D106288: [AMDGPU] Disable LDS lowering for GFX shaders
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 02:55:42 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9dc263662304: [AMDGPU] Disable LDS lowering for GFX shaders (authored by rampitec).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106288/new/
https://reviews.llvm.org/D106288
Files:
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll
Index: llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll
+++ llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll
@@ -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 @@
ret void
}
+
+; Do not lower LDS for graphics shaders.
+
+ at 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
+}
Index: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
@@ -162,7 +162,8 @@
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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106288.360063.patch
Type: text/x-patch
Size: 1693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/8dd4d384/attachment-0001.bin>
More information about the llvm-commits
mailing list