Index: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp +++ lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp @@ -232,6 +232,8 @@ false); OutStreamer->emitRawComment(" ScratchSize: " + Twine(KernelInfo.ScratchSize), false); + OutStreamer->emitRawComment(" LDSByteSize: " + Twine(KernelInfo.LDSSize) + + " bytes/workgroup (compile time only)", false); OutStreamer->emitRawComment(" COMPUTE_PGM_RSRC2:USER_SGPR: " + Twine(G_00B84C_USER_SGPR(KernelInfo.ComputePGMRSrc2)), Index: test/CodeGen/AMDGPU/lds-size.ll =================================================================== --- test/CodeGen/AMDGPU/lds-size.ll +++ test/CodeGen/AMDGPU/lds-size.ll @@ -1,11 +1,17 @@ -; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s +; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=ALL -check-prefix=GCN %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 ; used in different basic blocks. -; CHECK: .long 166120 -; CHECK-NEXT: .long 1 -; CHECK-LABEL: {{^}}test: +; GCN: .long 47180 +; GCN-NEXT: .long 32900 + +; EG: .long 166120 +; EG-NEXT: .long 1 +; ALL: {{^}}test: + +; GCN: ; LDSByteSize: 4 bytes/workgroup (compile time only) @lds = internal unnamed_addr addrspace(3) global i32 undef, align 4 define void @test(i32 addrspace(1)* %out, i32 %cond) {