[CodeGen][NFC] Remove redundant map lookup (#125342)
[llvm-project.git] / llvm / test / MC / AMDGPU / hsa-diag-v4.s
blob3733b162edcfbd2aaef1241ecbf8e2dfcca196b9
1 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GCN,GFX8,PREGFX10,AMDHSA
2 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GCN,GFX10PLUS,GFX10,AMDHSA
3 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx1100 -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GCN,GFX10PLUS,GFX11,AMDHSA
4 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx1200 -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GCN,GFX10PLUS,GFX12,AMDHSA
5 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd- -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GCN,NONAMDHSA
6 // RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx90a -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=ALL,GFX90A,PREGFX10,AMDHSA
8 .text
10 // GCN-LABEL: warning: test_target
11 // GFX8-NOT: error:
12 // GFX10: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810:xnack+ does not match the specified target id amdgcn-amd-amdhsa--gfx1010:xnack+
13 // GFX11: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810:xnack+ does not match the specified target id amdgcn-amd-amdhsa--gfx1100
14 // GFX12: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810:xnack+ does not match the specified target id amdgcn-amd-amdhsa--gfx1200
15 // NONAMDHSA: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810:xnack+ does not match the specified target id amdgcn-amd-unknown--gfx810
16 .warning "test_target"
17 .amdgcn_target "amdgcn-amd-amdhsa--gfx810:xnack+"
19 // GCN-LABEL: warning: test_amdhsa_kernel_no_name
20 // GCN: error: unknown directive
21 .warning "test_amdhsa_kernel_no_name"
22 .amdhsa_kernel
23 .end_amdhsa_kernel
25 // GCN-LABEL: warning: test_amdhsa_kernel_empty
26 // NONAMDHSA: error: unknown directive
27 .warning "test_amdhsa_kernel_empty"
28 .amdhsa_kernel test_amdhsa_kernel_empty
29 .end_amdhsa_kernel
31 // GCN-LABEL: warning: test_amdhsa_kernel_unknown_directive
32 // AMDHSA: error: expected .amdhsa_ directive or .end_amdhsa_kernel
33 // NONAMDHSA: error: unknown directive
34 .warning "test_amdhsa_kernel_unknown_directive"
35 .amdhsa_kernel test_amdhsa_kernel_unknown_directive
37 .end_amdhsa_kernel
39 // GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_invalid_size
40 // AMDHSA: error: value out of range
41 // NONAMDHSA: error: unknown directive
42 .warning "test_amdhsa_group_segment_fixed_size_invalid_size"
43 .amdhsa_kernel test_amdhsa_group_segment_fixed_size_invalid_size
44 .amdhsa_group_segment_fixed_size -1
45 .end_amdhsa_kernel
47 // GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_invalid_expression
48 // AMDHSA: error: value out of range
49 // NONAMDHSA: error: unknown directive
50 .warning "test_amdhsa_group_segment_fixed_size_invalid_expression"
51 .amdhsa_kernel test_amdhsa_group_segment_fixed_size_invalid_expression
52 .amdhsa_group_segment_fixed_size 10000000000 + 1
53 .end_amdhsa_kernel
55 // GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_repeated
56 // AMDHSA: error: .amdhsa_ directives cannot be repeated
57 // NONAMDHSA: error: unknown directive
58 .warning "test_amdhsa_group_segment_fixed_size_repeated"
59 .amdhsa_kernel test_amdhsa_group_segment_fixed_size_repeated
60 .amdhsa_group_segment_fixed_size 1
61 .amdhsa_group_segment_fixed_size 1
62 .end_amdhsa_kernel
64 // GCN-LABEL: warning: test_amdhsa_next_free_vgpr_missing
65 // AMDHSA: error: .amdhsa_next_free_vgpr directive is required
66 // NONAMDHSA: error: unknown directive
67 .warning "test_amdhsa_next_free_vgpr_missing"
68 .amdhsa_kernel test_amdhsa_next_free_vgpr_missing
69 .end_amdhsa_kernel
71 // GCN-LABEL: warning: test_amdhsa_next_free_sgpr_missing
72 // AMDHSA: error: .amdhsa_next_free_sgpr directive is required
73 // NONAMDHSA: error: unknown directive
74 .warning "test_amdhsa_next_free_sgpr_missing"
75 .amdhsa_kernel test_amdhsa_next_free_sgpr_missing
76 .amdhsa_next_free_vgpr 0
77 .end_amdhsa_kernel
79 // ALL-LABEL: warning: test_amdhsa_accum_offset
80 // NONGFX9A: error: directive requires gfx90a+
81 // GFX90A: error: .amdhsa_next_free_vgpr directive is required
82 // NONAMDHSA: error: unknown directive
83 .warning "test_amdhsa_accum_offset"
84 .amdhsa_kernel test_amdhsa_accum_offset
85 .amdhsa_accum_offset 4
86 .end_amdhsa_kernel
88 // ALL-LABEL: warning: test_amdhsa_accum_offset_missing
89 // NONGFX9A: error: directive requires gfx90a+
90 // GFX90A: error: .amdhsa_accum_offset directive is required
91 // NONAMDHSA: error: unknown directive
92 .warning "test_amdhsa_accum_offset_missing"
93 .amdhsa_kernel test_amdhsa_accum_offset_missing
94 .amdhsa_next_free_sgpr 0
95 .amdhsa_next_free_vgpr 0
96 .end_amdhsa_kernel
98 // ALL-LABEL: warning: test_amdhsa_accum_offset_invalid0
99 // NONGFX9A: error: directive requires gfx90a+
100 // GFX90A: error: accum_offset should be in range [4..256] in increments of 4
101 // NONAMDHSA: error: unknown directive
102 .warning "test_amdhsa_accum_offset_invalid0"
103 .amdhsa_kernel test_amdhsa_accum_offset_invalid0
104 .amdhsa_next_free_sgpr 0
105 .amdhsa_next_free_vgpr 0
106 .amdhsa_accum_offset 0
107 .end_amdhsa_kernel
109 // ALL-LABEL: warning: test_amdhsa_accum_offset_invalid5
110 // NONGFX9A: error: directive requires gfx90a+
111 // GFX90A: error: accum_offset should be in range [4..256] in increments of 4
112 // NONAMDHSA: error: unknown directive
113 .warning "test_amdhsa_accum_offset_invalid5"
114 .amdhsa_kernel test_amdhsa_accum_offset_invalid5
115 .amdhsa_next_free_sgpr 0
116 .amdhsa_next_free_vgpr 0
117 .amdhsa_accum_offset 5
118 .end_amdhsa_kernel
120 // ALL-LABEL: warning: test_amdhsa_accum_offset_invalid257
121 // NONGFX9A: error: directive requires gfx90a+
122 // GFX90A: error: accum_offset should be in range [4..256] in increments of 4
123 // NONAMDHSA: error: unknown directive
124 .warning "test_amdhsa_accum_offset_invalid257"
125 .amdhsa_kernel test_amdhsa_accum_offset_invalid257
126 .amdhsa_next_free_sgpr 0
127 .amdhsa_next_free_vgpr 0
128 .amdhsa_accum_offset 257
129 .end_amdhsa_kernel
131 // ALL-LABEL: warning: test_amdhsa_accum_offset_invalid8
132 // NONGFX9A: error: directive requires gfx90a+
133 // GFX90A: error: accum_offset exceeds total VGPR allocation
134 // NONAMDHSA: error: unknown directive
135 .warning "test_amdhsa_accum_offset_invalid8"
136 .amdhsa_kernel test_amdhsa_accum_offset_invalid8
137 .amdhsa_next_free_sgpr 0
138 .amdhsa_next_free_vgpr 0
139 .amdhsa_accum_offset 8
140 .end_amdhsa_kernel
142 // ALL-LABEL: warning: test_amdhsa_tg_split
143 // NONGFX90A: error: directive requires gfx90a+
144 // GFX90A: error: .amdhsa_next_free_vgpr directive is required
145 // NONAMDHSA: error: unknown directive
146 .warning "test_amdhsa_tg_split"
147 .amdhsa_kernel test_amdhsa_tg_split
148 .amdhsa_tg_split 1
149 .end_amdhsa_kernel
151 // ALL-LABEL: warning: test_amdhsa_tg_split_invalid
152 // NONGFX90A: error: directive requires gfx90a+
153 // GFX90A: error: value out of range
154 // NONAMDHSA: error: unknown directive
155 .warning "test_amdhsa_tg_split_invalid"
156 .amdhsa_kernel test_amdhsa_tg_split_invalid
157 .amdhsa_tg_split 5
158 .end_amdhsa_kernel
160 // ALL-LABEL: warning: test_amdhsa_wavefront_size32
161 // PREGFX10: error: directive requires gfx10+
162 // GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
163 // NONAMDHSA: error: unknown directive
164 .warning "test_amdhsa_wavefront_size32"
165 .amdhsa_kernel test_amdhsa_wavefront_size32
166 .amdhsa_wavefront_size32 1
167 .end_amdhsa_kernel
169 // GCN-LABEL: warning: test_amdhsa_wavefront_size32_invalid
170 // PREGFX10: error: directive requires gfx10+
171 // GFX10PLUS: error: value out of range
172 // NONAMDHSA: error: unknown directive
173 .warning "test_amdhsa_wavefront_size32_invalid"
174 .amdhsa_kernel test_amdhsa_wavefront_size32_invalid
175 .amdhsa_wavefront_size32 5
176 .end_amdhsa_kernel
178 // GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode
179 // PREGFX10: error: directive requires gfx10+
180 // GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
181 // NONAMDHSA: error: unknown directive
182 .warning "test_amdhsa_workgroup_processor_mode"
183 .amdhsa_kernel test_amdhsa_workgroup_processor_mode
184 .amdhsa_workgroup_processor_mode 1
185 .end_amdhsa_kernel
187 // GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode_invalid
188 // PREGFX10: error: directive requires gfx10+
189 // GFX10PLUS: error: value out of range
190 // NONAMDHSA: error: unknown directive
191 .warning "test_amdhsa_workgroup_processor_mode_invalid"
192 .amdhsa_kernel test_amdhsa_workgroup_processor_mode_invalid
193 .amdhsa_workgroup_processor_mode 5
194 .end_amdhsa_kernel
196 // GCN-LABEL: warning: test_amdhsa_memory_ordered
197 // PREGFX10: error: directive requires gfx10+
198 // GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
199 // NONAMDHSA: error: unknown directive
200 .warning "test_amdhsa_memory_ordered"
201 .amdhsa_kernel test_amdhsa_memory_ordered
202 .amdhsa_memory_ordered 1
203 .end_amdhsa_kernel
205 // GCN-LABEL: warning: test_amdhsa_memory_ordered_invalid
206 // PREGFX10: error: directive requires gfx10+
207 // GFX10PLUS: error: value out of range
208 // NONAMDHSA: error: unknown directive
209 .warning "test_amdhsa_memory_ordered_invalid"
210 .amdhsa_kernel test_amdhsa_memory_ordered_invalid
211 .amdhsa_memory_ordered 5
212 .end_amdhsa_kernel
214 // GCN-LABEL: warning: test_amdhsa_forward_progress
215 // PREGFX10: error: directive requires gfx10+
216 // GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
217 // NONAMDHSA: error: unknown directive
218 .warning "test_amdhsa_forward_progress"
219 .amdhsa_kernel test_amdhsa_forward_progress
220 .amdhsa_forward_progress 1
221 .end_amdhsa_kernel
223 // GCN-LABEL: warning: test_amdhsa_forward_progress_invalid
224 // PREGFX10: error: directive requires gfx10+
225 // GFX10PLUS: error: value out of range
226 // NONAMDHSA: error: unknown directive
227 .warning "test_amdhsa_forward_progress_invalid"
228 .amdhsa_kernel test_amdhsa_forward_progress_invalid
229 .amdhsa_forward_progress 5
230 .end_amdhsa_kernel
232 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid1
233 // PREGFX10: error: directive requires gfx10 or gfx11
234 // GFX10: error: .amdhsa_next_free_vgpr directive is required
235 // GFX11: error: .amdhsa_next_free_vgpr directive is required
236 // GFX12: error: directive requires gfx10 or gfx11
237 // NONAMDHSA: error: unknown directive
238 .warning "test_amdhsa_shared_vgpr_count_invalid1"
239 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid1
240 .amdhsa_shared_vgpr_count 8
241 .end_amdhsa_kernel
243 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid2
244 // PREGFX10: error: directive requires gfx10 or gfx11
245 // GFX10: error: shared_vgpr_count directive not valid on wavefront size 32
246 // GFX11: error: shared_vgpr_count directive not valid on wavefront size 32
247 // GFX12: error: directive requires gfx10 or gfx11
248 // NONAMDHSA: error: unknown directive
249 .warning "test_amdhsa_shared_vgpr_count_invalid2"
250 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid2
251 .amdhsa_next_free_vgpr 16
252 .amdhsa_next_free_sgpr 0
253 .amdhsa_shared_vgpr_count 8
254 .amdhsa_wavefront_size32 1
255 .end_amdhsa_kernel
257 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid3
258 // PREGFX10: error: directive requires gfx10 or gfx11
259 // GFX10: error: value out of range
260 // GFX11: error: value out of range
261 // GFX12: error: directive requires gfx10 or gfx11
262 // NONAMDHSA: error: unknown directive
263 .warning "test_amdhsa_shared_vgpr_count_invalid3"
264 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid3
265 .amdhsa_next_free_vgpr 32
266 .amdhsa_next_free_sgpr 0
267 .amdhsa_shared_vgpr_count 16
268 .end_amdhsa_kernel
270 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid4
271 // PREGFX10: error: directive requires gfx10 or gfx11
272 // GFX10: error: shared_vgpr_count*2 + compute_pgm_rsrc1.GRANULATED_WORKITEM_VGPR_COUNT cannot exceed 63
273 // GFX11: error: shared_vgpr_count*2 + compute_pgm_rsrc1.GRANULATED_WORKITEM_VGPR_COUNT cannot exceed 63
274 // GFX12: error: directive requires gfx10 or gfx11
275 // NONAMDHSA: error: unknown directive
276 .warning "test_amdhsa_shared_vgpr_count_invalid4"
277 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid4
278 .amdhsa_next_free_vgpr 273
279 .amdhsa_next_free_sgpr 0
280 .amdhsa_shared_vgpr_count 15
281 .end_amdhsa_kernel
283 // GCN-LABEL: warning: test_next_free_vgpr_invalid
284 // AMDHSA: error: .amdgcn.next_free_{v,s}gpr symbols must be absolute expressions
285 // NONAMDHSA-NOT: error:
286 .warning "test_next_free_vgpr_invalid"
287 .set .amdgcn.next_free_vgpr, "foo"
288 v_mov_b32_e32 v0, s0
290 // GCN-LABEL: warning: test_end
291 .warning "test_end"