[llvm] r316024 - AMDGPU: Start generating metadata for MaxFlatWorkGroupSize
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 17 13:03:21 PDT 2017
Author: kzhuravl
Date: Tue Oct 17 13:03:21 2017
New Revision: 316024
URL: http://llvm.org/viewvc/llvm-project?rev=316024&view=rev
Log:
AMDGPU: Start generating metadata for MaxFlatWorkGroupSize
Differential Revision: https://reviews.llvm.org/D38958
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
llvm/trunk/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll
llvm/trunk/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll
llvm/trunk/test/MC/AMDGPU/hsa-metadata-kernel-code-props.s
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=316024&r1=316023&r2=316024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Tue Oct 17 13:03:21 2017
@@ -1179,7 +1179,7 @@ AMDGPU::HSAMD::Kernel::CodeProps::Metada
HSACodeProps.mWavefrontSize = STM.getWavefrontSize();
HSACodeProps.mNumSGPRs = CurrentProgramInfo.NumSGPR;
HSACodeProps.mNumVGPRs = CurrentProgramInfo.NumVGPR;
- // TODO: Emit HSACodeProps.mMaxFlatWorkgroupSize.
+ HSACodeProps.mMaxFlatWorkgroupSize = MFI.getMaxFlatWorkGroupSize();
HSACodeProps.mIsDynamicCallStack = ProgramInfo.DynamicCallStack;
HSACodeProps.mIsXNACKEnabled = STM.isXNACKEnabled();
Modified: llvm/trunk/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll?rev=316024&r1=316023&r2=316024&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll Tue Oct 17 13:03:21 2017
@@ -1,4 +1,5 @@
-; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 < %s | FileCheck --check-prefix=CHECK %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=HSAMD %s
; CHECK-LABEL: {{^}}min_64_max_64:
; CHECK: SGPRBlocks: 0
@@ -127,3 +128,15 @@ define amdgpu_kernel void @min_1024_max_
ret void
}
attributes #3 = {"amdgpu-flat-work-group-size"="1024,2048"}
+
+; HSAMD: NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
+; HSAMD: Version: [ 1, 0 ]
+; HSAMD: Kernels:
+; HSAMD: - Name: min_64_max_64
+; HSAMD: MaxFlatWorkgroupSize: 64
+; HSAMD: - Name: min_64_max_128
+; HSAMD: MaxFlatWorkgroupSize: 128
+; HSAMD: - Name: min_128_max_128
+; HSAMD: MaxFlatWorkgroupSize: 128
+; HSAMD: - Name: min_1024_max_2048
+; HSAMD: MaxFlatWorkgroupSize: 2048
Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll?rev=316024&r1=316023&r2=316024&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll Tue Oct 17 13:03:21 2017
@@ -9,17 +9,18 @@
; CHECK: - Name: test
; CHECK: SymbolName: 'test at kd'
; CHECK: CodeProps:
-; CHECK: KernargSegmentSize: 24
-; CHECK: GroupSegmentFixedSize: 0
+; CHECK: KernargSegmentSize: 24
+; CHECK: GroupSegmentFixedSize: 0
; CHECK: PrivateSegmentFixedSize: 0
-; CHECK: KernargSegmentAlign: 8
-; CHECK: WavefrontSize: 64
-; GFX700: NumSGPRs: 6
-; GFX800: NumSGPRs: 96
-; GFX900: NumSGPRs: 6
-; GFX700: NumVGPRs: 4
-; GFX800: NumVGPRs: 6
-; GFX900: NumVGPRs: 6
+; CHECK: KernargSegmentAlign: 8
+; CHECK: WavefrontSize: 64
+; GFX700: NumSGPRs: 6
+; GFX800: NumSGPRs: 96
+; GFX900: NumSGPRs: 6
+; GFX700: NumVGPRs: 4
+; GFX800: NumVGPRs: 6
+; GFX900: NumVGPRs: 6
+; CHECK: MaxFlatWorkgroupSize: 256
define amdgpu_kernel void @test(
half addrspace(1)* %r,
half addrspace(1)* %a,
Modified: llvm/trunk/test/MC/AMDGPU/hsa-metadata-kernel-code-props.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/hsa-metadata-kernel-code-props.s?rev=316024&r1=316023&r2=316024&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/hsa-metadata-kernel-code-props.s (original)
+++ llvm/trunk/test/MC/AMDGPU/hsa-metadata-kernel-code-props.s Tue Oct 17 13:03:21 2017
@@ -13,6 +13,7 @@
// CHECK: PrivateSegmentFixedSize: 16
// CHECK: KernargSegmentAlign: 16
// CHECK: WavefrontSize: 64
+// CHECK: MaxFlatWorkgroupSize: 256
.amd_amdgpu_hsa_metadata
Version: [ 1, 0 ]
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
@@ -25,4 +26,5 @@
PrivateSegmentFixedSize: 16
KernargSegmentAlign: 16
WavefrontSize: 64
+ MaxFlatWorkgroupSize: 256
.end_amd_amdgpu_hsa_metadata
More information about the llvm-commits
mailing list