1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck -check-prefix=WAVE64 %s
4 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck -check-prefix=WAVE32 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck -check-prefix=WAVE32 %s
9 name: test_dyn_stackalloc_sgpr_align1
14 - { id: 0, type: variable-sized, alignment: 1 }
19 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align1
20 ; WAVE64: liveins: $sgpr0
22 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
23 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
24 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
25 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
26 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
27 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
28 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align1
29 ; WAVE32: liveins: $sgpr0
31 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
32 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
33 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
34 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
35 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
36 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
37 %0:_(s32) = COPY $sgpr0
38 %1:_(p5) = G_DYN_STACKALLOC %0, 1
39 S_ENDPGM 0, implicit %1
43 name: test_dyn_stackalloc_sgpr_align2
48 - { id: 0, type: variable-sized, alignment: 2 }
53 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align2
54 ; WAVE64: liveins: $sgpr0
56 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
57 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
58 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
59 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
60 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
61 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
62 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align2
63 ; WAVE32: liveins: $sgpr0
65 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
66 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
67 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
68 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
69 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
70 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
71 %0:_(s32) = COPY $sgpr0
72 %1:_(p5) = G_DYN_STACKALLOC %0, 2
73 S_ENDPGM 0, implicit %1
77 name: test_dyn_stackalloc_sgpr_align4
82 - { id: 0, type: variable-sized, alignment: 4 }
87 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align4
88 ; WAVE64: liveins: $sgpr0
90 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
91 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
92 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
93 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
94 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
95 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
96 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align4
97 ; WAVE32: liveins: $sgpr0
99 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
100 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
101 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
102 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
103 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
104 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
105 %0:_(s32) = COPY $sgpr0
106 %1:_(p5) = G_DYN_STACKALLOC %0, 4
107 S_ENDPGM 0, implicit %1
111 name: test_dyn_stackalloc_sgpr_align8
116 - { id: 0, type: variable-sized, alignment: 8 }
121 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align8
122 ; WAVE64: liveins: $sgpr0
123 ; WAVE64-NEXT: {{ $}}
124 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
125 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
126 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
127 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
128 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
129 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
130 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align8
131 ; WAVE32: liveins: $sgpr0
132 ; WAVE32-NEXT: {{ $}}
133 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
134 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
135 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
136 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
137 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
138 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
139 %0:_(s32) = COPY $sgpr0
140 %1:_(p5) = G_DYN_STACKALLOC %0, 8
141 S_ENDPGM 0, implicit %1
145 name: test_dyn_stackalloc_sgpr_align16
150 - { id: 0, type: variable-sized, alignment: 16 }
155 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align16
156 ; WAVE64: liveins: $sgpr0
157 ; WAVE64-NEXT: {{ $}}
158 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
159 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
160 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
161 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
162 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
163 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
164 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align16
165 ; WAVE32: liveins: $sgpr0
166 ; WAVE32-NEXT: {{ $}}
167 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
168 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
169 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
170 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
171 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
172 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
173 %0:_(s32) = COPY $sgpr0
174 %1:_(p5) = G_DYN_STACKALLOC %0, 16
175 S_ENDPGM 0, implicit %1
179 name: test_dyn_stackalloc_sgpr_align32
184 - { id: 0, type: variable-sized, alignment: 32 }
189 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align32
190 ; WAVE64: liveins: $sgpr0
191 ; WAVE64-NEXT: {{ $}}
192 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
193 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
194 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
195 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
196 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
197 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
198 ; WAVE64-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
199 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
200 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align32
201 ; WAVE32: liveins: $sgpr0
202 ; WAVE32-NEXT: {{ $}}
203 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
204 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
205 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
206 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
207 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
208 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1024
209 ; WAVE32-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
210 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
211 %0:_(s32) = COPY $sgpr0
212 %1:_(p5) = G_DYN_STACKALLOC %0, 32
213 S_ENDPGM 0, implicit %1
217 name: test_dyn_stackalloc_sgpr_align64
222 - { id: 0, type: variable-sized, alignment: 64 }
227 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align64
228 ; WAVE64: liveins: $sgpr0
229 ; WAVE64-NEXT: {{ $}}
230 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
231 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
232 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
233 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
234 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
235 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -4096
236 ; WAVE64-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
237 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
238 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align64
239 ; WAVE32: liveins: $sgpr0
240 ; WAVE32-NEXT: {{ $}}
241 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
242 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
243 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
244 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
245 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
246 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
247 ; WAVE32-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
248 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
249 %0:_(s32) = COPY $sgpr0
250 %1:_(p5) = G_DYN_STACKALLOC %0, 64
251 S_ENDPGM 0, implicit %1
255 name: test_dyn_stackalloc_sgpr_align128
260 - { id: 0, type: variable-sized, alignment: 128 }
265 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align128
266 ; WAVE64: liveins: $sgpr0
267 ; WAVE64-NEXT: {{ $}}
268 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
269 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
270 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
271 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
272 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
273 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -8192
274 ; WAVE64-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
275 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
276 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align128
277 ; WAVE32: liveins: $sgpr0
278 ; WAVE32-NEXT: {{ $}}
279 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
280 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
281 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
282 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
283 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
284 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -4096
285 ; WAVE32-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
286 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
287 %0:_(s32) = COPY $sgpr0
288 %1:_(p5) = G_DYN_STACKALLOC %0, 128
289 S_ENDPGM 0, implicit %1
293 name: test_dyn_stackalloc_sgpr_constant_align4
298 - { id: 0, type: variable-sized, alignment: 4 }
302 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align4
303 ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
304 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
305 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
306 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
307 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
308 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
309 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align4
310 ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
311 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
312 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
313 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
314 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
315 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
316 %0:_(s32) = G_CONSTANT i32 32
317 %1:_(p5) = G_DYN_STACKALLOC %0, 4
318 S_ENDPGM 0, implicit %1
322 name: test_dyn_stackalloc_sgpr_constant_align8
327 - { id: 0, type: variable-sized, alignment: 8 }
332 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align8
333 ; WAVE64: liveins: $sgpr0
334 ; WAVE64-NEXT: {{ $}}
335 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
336 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
337 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
338 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
339 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
340 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
341 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align8
342 ; WAVE32: liveins: $sgpr0
343 ; WAVE32-NEXT: {{ $}}
344 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
345 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
346 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
347 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
348 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
349 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
350 %0:_(s32) = G_CONSTANT i32 32
351 %1:_(p5) = G_DYN_STACKALLOC %0, 8
352 S_ENDPGM 0, implicit %1
356 name: test_dyn_stackalloc_sgpr_constant_align16
361 - { id: 0, type: variable-sized, alignment: 16 }
366 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align16
367 ; WAVE64: liveins: $sgpr0
368 ; WAVE64-NEXT: {{ $}}
369 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
370 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
371 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
372 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
373 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
374 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
375 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align16
376 ; WAVE32: liveins: $sgpr0
377 ; WAVE32-NEXT: {{ $}}
378 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
379 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
380 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
381 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
382 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
383 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
384 %0:_(s32) = G_CONSTANT i32 32
385 %1:_(p5) = G_DYN_STACKALLOC %0, 16
386 S_ENDPGM 0, implicit %1
390 name: test_dyn_stackalloc_sgpr_constant_align32
395 - { id: 0, type: variable-sized, alignment: 32 }
400 ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align32
401 ; WAVE64: liveins: $sgpr0
402 ; WAVE64-NEXT: {{ $}}
403 ; WAVE64-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
404 ; WAVE64-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
405 ; WAVE64-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
406 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
407 ; WAVE64-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
408 ; WAVE64-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
409 ; WAVE64-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C2]](s32)
410 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
411 ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align32
412 ; WAVE32: liveins: $sgpr0
413 ; WAVE32-NEXT: {{ $}}
414 ; WAVE32-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
415 ; WAVE32-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
416 ; WAVE32-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
417 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
418 ; WAVE32-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
419 ; WAVE32-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1024
420 ; WAVE32-NEXT: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C2]](s32)
421 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[PTRMASK]](p5)
422 %0:_(s32) = G_CONSTANT i32 32
423 %1:_(p5) = G_DYN_STACKALLOC %0, 32
424 S_ENDPGM 0, implicit %1