1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 < %s | FileCheck --check-prefix=CHECK %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -mattr=-code-object-v3 -filetype=obj -o - < %s | llvm-readelf --notes | FileCheck --check-prefix=HSAMD %s
4 ; CHECK-LABEL: {{^}}min_64_max_64:
7 ; CHECK: NumSGPRsForWavesPerEU: 1
8 ; CHECK: NumVGPRsForWavesPerEU: 1
9 define amdgpu_kernel void @min_64_max_64() #0 {
13 attributes #0 = {"amdgpu-flat-work-group-size"="64,64"}
15 ; CHECK-LABEL: {{^}}min_64_max_128:
16 ; CHECK: SGPRBlocks: 0
17 ; CHECK: VGPRBlocks: 0
18 ; CHECK: NumSGPRsForWavesPerEU: 1
19 ; CHECK: NumVGPRsForWavesPerEU: 1
20 define amdgpu_kernel void @min_64_max_128() #1 {
24 attributes #1 = {"amdgpu-flat-work-group-size"="64,128"}
26 ; CHECK-LABEL: {{^}}min_128_max_128:
27 ; CHECK: SGPRBlocks: 0
28 ; CHECK: VGPRBlocks: 0
29 ; CHECK: NumSGPRsForWavesPerEU: 1
30 ; CHECK: NumVGPRsForWavesPerEU: 1
31 define amdgpu_kernel void @min_128_max_128() #2 {
35 attributes #2 = {"amdgpu-flat-work-group-size"="128,128"}
37 ; CHECK-LABEL: {{^}}min_1024_max_2048
38 ; CHECK: SGPRBlocks: 1
39 ; CHECK: VGPRBlocks: 7
40 ; CHECK: NumSGPRsForWavesPerEU: 12
41 ; CHECK: NumVGPRsForWavesPerEU: 32
42 @var = addrspace(1) global float 0.0
43 define amdgpu_kernel void @min_1024_max_2048() #3 {
44 %val0 = load volatile float, float addrspace(1)* @var
45 %val1 = load volatile float, float addrspace(1)* @var
46 %val2 = load volatile float, float addrspace(1)* @var
47 %val3 = load volatile float, float addrspace(1)* @var
48 %val4 = load volatile float, float addrspace(1)* @var
49 %val5 = load volatile float, float addrspace(1)* @var
50 %val6 = load volatile float, float addrspace(1)* @var
51 %val7 = load volatile float, float addrspace(1)* @var
52 %val8 = load volatile float, float addrspace(1)* @var
53 %val9 = load volatile float, float addrspace(1)* @var
54 %val10 = load volatile float, float addrspace(1)* @var
55 %val11 = load volatile float, float addrspace(1)* @var
56 %val12 = load volatile float, float addrspace(1)* @var
57 %val13 = load volatile float, float addrspace(1)* @var
58 %val14 = load volatile float, float addrspace(1)* @var
59 %val15 = load volatile float, float addrspace(1)* @var
60 %val16 = load volatile float, float addrspace(1)* @var
61 %val17 = load volatile float, float addrspace(1)* @var
62 %val18 = load volatile float, float addrspace(1)* @var
63 %val19 = load volatile float, float addrspace(1)* @var
64 %val20 = load volatile float, float addrspace(1)* @var
65 %val21 = load volatile float, float addrspace(1)* @var
66 %val22 = load volatile float, float addrspace(1)* @var
67 %val23 = load volatile float, float addrspace(1)* @var
68 %val24 = load volatile float, float addrspace(1)* @var
69 %val25 = load volatile float, float addrspace(1)* @var
70 %val26 = load volatile float, float addrspace(1)* @var
71 %val27 = load volatile float, float addrspace(1)* @var
72 %val28 = load volatile float, float addrspace(1)* @var
73 %val29 = load volatile float, float addrspace(1)* @var
74 %val30 = load volatile float, float addrspace(1)* @var
75 %val31 = load volatile float, float addrspace(1)* @var
76 %val32 = load volatile float, float addrspace(1)* @var
77 %val33 = load volatile float, float addrspace(1)* @var
78 %val34 = load volatile float, float addrspace(1)* @var
79 %val35 = load volatile float, float addrspace(1)* @var
80 %val36 = load volatile float, float addrspace(1)* @var
81 %val37 = load volatile float, float addrspace(1)* @var
82 %val38 = load volatile float, float addrspace(1)* @var
83 %val39 = load volatile float, float addrspace(1)* @var
84 %val40 = load volatile float, float addrspace(1)* @var
86 store volatile float %val0, float addrspace(1)* @var
87 store volatile float %val1, float addrspace(1)* @var
88 store volatile float %val2, float addrspace(1)* @var
89 store volatile float %val3, float addrspace(1)* @var
90 store volatile float %val4, float addrspace(1)* @var
91 store volatile float %val5, float addrspace(1)* @var
92 store volatile float %val6, float addrspace(1)* @var
93 store volatile float %val7, float addrspace(1)* @var
94 store volatile float %val8, float addrspace(1)* @var
95 store volatile float %val9, float addrspace(1)* @var
96 store volatile float %val10, float addrspace(1)* @var
97 store volatile float %val11, float addrspace(1)* @var
98 store volatile float %val12, float addrspace(1)* @var
99 store volatile float %val13, float addrspace(1)* @var
100 store volatile float %val14, float addrspace(1)* @var
101 store volatile float %val15, float addrspace(1)* @var
102 store volatile float %val16, float addrspace(1)* @var
103 store volatile float %val17, float addrspace(1)* @var
104 store volatile float %val18, float addrspace(1)* @var
105 store volatile float %val19, float addrspace(1)* @var
106 store volatile float %val20, float addrspace(1)* @var
107 store volatile float %val21, float addrspace(1)* @var
108 store volatile float %val22, float addrspace(1)* @var
109 store volatile float %val23, float addrspace(1)* @var
110 store volatile float %val24, float addrspace(1)* @var
111 store volatile float %val25, float addrspace(1)* @var
112 store volatile float %val26, float addrspace(1)* @var
113 store volatile float %val27, float addrspace(1)* @var
114 store volatile float %val28, float addrspace(1)* @var
115 store volatile float %val29, float addrspace(1)* @var
116 store volatile float %val30, float addrspace(1)* @var
117 store volatile float %val31, float addrspace(1)* @var
118 store volatile float %val32, float addrspace(1)* @var
119 store volatile float %val33, float addrspace(1)* @var
120 store volatile float %val34, float addrspace(1)* @var
121 store volatile float %val35, float addrspace(1)* @var
122 store volatile float %val36, float addrspace(1)* @var
123 store volatile float %val37, float addrspace(1)* @var
124 store volatile float %val38, float addrspace(1)* @var
125 store volatile float %val39, float addrspace(1)* @var
126 store volatile float %val40, float addrspace(1)* @var
130 attributes #3 = {"amdgpu-flat-work-group-size"="1024,2048"}
132 ; HSAMD: NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
133 ; HSAMD: Version: [ 1, 0 ]
135 ; HSAMD: - Name: min_64_max_64
136 ; HSAMD: MaxFlatWorkGroupSize: 64
137 ; HSAMD: - Name: min_64_max_128
138 ; HSAMD: MaxFlatWorkGroupSize: 128
139 ; HSAMD: - Name: min_128_max_128
140 ; HSAMD: MaxFlatWorkGroupSize: 128
141 ; HSAMD: - Name: min_1024_max_2048
142 ; HSAMD: MaxFlatWorkGroupSize: 2048