Skip to content

Commit 6ccb076

Browse files
committedMay 5, 2017
AMDGPU/AMDHSA: Set COMPUTE_PGM_RSRC2:LDS_SIZE to 0
This field is populated by the CP Differential Revision: https://reviews.llvm.org/D32619 llvm-svn: 302277
1 parent 391a2ac commit 6ccb076

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,8 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
713713
S_00B84C_TG_SIZE_EN(MFI->hasWorkGroupInfo()) |
714714
S_00B84C_TIDIG_COMP_CNT(TIDIGCompCnt) |
715715
S_00B84C_EXCP_EN_MSB(0) |
716-
S_00B84C_LDS_SIZE(ProgInfo.LDSBlocks) |
716+
// For AMDHSA, LDS_SIZE must be zero, as it is populated by the CP.
717+
S_00B84C_LDS_SIZE(STM.isAmdHsaOS() ? 0 : ProgInfo.LDSBlocks) |
717718
S_00B84C_EXCP_EN(0);
718719
}
719720

‎llvm/test/CodeGen/AMDGPU/lds-size.ll

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=ALL -check-prefix=GCN %s
2+
; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefix=ALL -check-prefix=HSA %s
23
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=ALL -check-prefix=EG %s
34

45
; This test makes sure we do not double count global values when they are
@@ -11,6 +12,9 @@
1112
; EG-NEXT: .long 1
1213
; ALL: {{^}}test:
1314

15+
; HSA: granulated_lds_size = 0
16+
; HSA: workgroup_group_segment_byte_size = 4
17+
1418
; GCN: ; LDSByteSize: 4 bytes/workgroup (compile time only)
1519
@lds = internal unnamed_addr addrspace(3) global i32 undef, align 4
1620

0 commit comments

Comments
 (0)
Please sign in to comment.