[PATCH] D32619: AMDGPU/AMDHSA: Set COMPUTE_PGM_RSRC2:LDS_SIZE to 0

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 13:27:06 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302277: AMDGPU/AMDHSA: Set COMPUTE_PGM_RSRC2:LDS_SIZE to 0 (authored by kzhuravl).

Changed prior to commit:
  https://reviews.llvm.org/D32619?vs=97022&id=98010#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32619

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/trunk/test/CodeGen/AMDGPU/lds-size.ll


Index: llvm/trunk/test/CodeGen/AMDGPU/lds-size.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/lds-size.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/lds-size.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=ALL -check-prefix=GCN %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefix=ALL -check-prefix=HSA %s
 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=ALL -check-prefix=EG %s
 
 ; This test makes sure we do not double count global values when they are
@@ -11,6 +12,9 @@
 ; EG-NEXT: .long 1
 ; ALL: {{^}}test:
 
+; HSA: granulated_lds_size = 0
+; HSA: workgroup_group_segment_byte_size = 4
+
 ; GCN: ; LDSByteSize: 4 bytes/workgroup (compile time only)
 @lds = internal unnamed_addr addrspace(3) global i32 undef, align 4
 
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -713,7 +713,8 @@
       S_00B84C_TG_SIZE_EN(MFI->hasWorkGroupInfo()) |
       S_00B84C_TIDIG_COMP_CNT(TIDIGCompCnt) |
       S_00B84C_EXCP_EN_MSB(0) |
-      S_00B84C_LDS_SIZE(ProgInfo.LDSBlocks) |
+      // For AMDHSA, LDS_SIZE must be zero, as it is populated by the CP.
+      S_00B84C_LDS_SIZE(STM.isAmdHsaOS() ? 0 : ProgInfo.LDSBlocks) |
       S_00B84C_EXCP_EN(0);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32619.98010.patch
Type: text/x-patch
Size: 1458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170505/632b7797/attachment.bin>


More information about the llvm-commits mailing list