• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck -check-prefix=WAVE64 %s
3# XUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck -check-prefix=WAVE64 %s
4# RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck -check-prefix=WAVE32 %s
5# XUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck -check-prefix=WAVE32 %s
6
7
8---
9name: test_dyn_stackalloc_sgpr_align1
10legalized:       true
11frameInfo:
12  maxAlignment: 2
13stack:
14  - { id: 0, type: variable-sized, alignment: 1 }
15body: |
16  bb.0:
17    liveins: $sgpr0
18
19    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align1
20    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
21    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
22    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
23    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
24    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
25    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
26    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align1
27    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
28    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
29    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
30    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
31    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
32    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
33    %0:_(s32) = COPY $sgpr0
34    %1:_(p5) = G_DYN_STACKALLOC %0, 1
35    S_ENDPGM 0, implicit %1
36...
37
38---
39name: test_dyn_stackalloc_sgpr_align2
40legalized:       true
41frameInfo:
42  maxAlignment: 2
43stack:
44  - { id: 0, type: variable-sized, alignment: 2 }
45body: |
46  bb.0:
47    liveins: $sgpr0
48
49    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align2
50    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
51    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
52    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
53    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
54    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
55    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
56    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align2
57    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
58    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
59    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
60    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
61    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
62    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
63    %0:_(s32) = COPY $sgpr0
64    %1:_(p5) = G_DYN_STACKALLOC %0, 2
65    S_ENDPGM 0, implicit %1
66...
67
68---
69name: test_dyn_stackalloc_sgpr_align4
70legalized:       true
71frameInfo:
72  maxAlignment: 4
73stack:
74  - { id: 0, type: variable-sized, alignment: 4 }
75body: |
76  bb.0:
77    liveins: $sgpr0
78
79    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align4
80    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
81    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
82    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
83    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
84    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
85    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
86    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align4
87    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
88    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
89    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
90    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
91    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
92    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
93    %0:_(s32) = COPY $sgpr0
94    %1:_(p5) = G_DYN_STACKALLOC %0, 4
95    S_ENDPGM 0, implicit %1
96...
97
98---
99name: test_dyn_stackalloc_sgpr_align8
100legalized:       true
101frameInfo:
102  maxAlignment: 8
103stack:
104  - { id: 0, type: variable-sized, alignment: 8 }
105body: |
106  bb.0:
107    liveins: $sgpr0
108
109    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align8
110    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
111    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
112    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
113    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
114    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
115    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
116    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align8
117    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
118    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
119    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
120    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
121    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
122    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
123    %0:_(s32) = COPY $sgpr0
124    %1:_(p5) = G_DYN_STACKALLOC %0, 8
125    S_ENDPGM 0, implicit %1
126...
127
128---
129name: test_dyn_stackalloc_sgpr_align16
130legalized:       true
131frameInfo:
132  maxAlignment: 16
133stack:
134  - { id: 0, type: variable-sized, alignment: 16 }
135body: |
136  bb.0:
137    liveins: $sgpr0
138
139    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align16
140    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
141    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
142    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
143    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
144    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
145    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
146    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align16
147    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
148    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
149    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
150    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
151    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
152    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
153    %0:_(s32) = COPY $sgpr0
154    %1:_(p5) = G_DYN_STACKALLOC %0, 16
155    S_ENDPGM 0, implicit %1
156...
157
158---
159name: test_dyn_stackalloc_sgpr_align32
160legalized:       true
161frameInfo:
162  maxAlignment: 32
163stack:
164  - { id: 0, type: variable-sized, alignment: 32 }
165body: |
166  bb.0:
167    liveins: $sgpr0
168
169    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align32
170    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
171    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
172    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
173    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
174    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
175    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
176    ; WAVE64: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
177    ; WAVE64: S_ENDPGM 0, implicit [[PTRMASK]](p5)
178    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align32
179    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
180    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
181    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
182    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
183    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
184    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1024
185    ; WAVE32: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
186    ; WAVE32: S_ENDPGM 0, implicit [[PTRMASK]](p5)
187    %0:_(s32) = COPY $sgpr0
188    %1:_(p5) = G_DYN_STACKALLOC %0, 32
189    S_ENDPGM 0, implicit %1
190...
191
192---
193name: test_dyn_stackalloc_sgpr_align64
194legalized:       true
195frameInfo:
196  maxAlignment: 64
197stack:
198  - { id: 0, type: variable-sized, alignment: 64 }
199body: |
200  bb.0:
201    liveins: $sgpr0
202
203    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align64
204    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
205    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
206    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
207    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
208    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
209    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -4096
210    ; WAVE64: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
211    ; WAVE64: S_ENDPGM 0, implicit [[PTRMASK]](p5)
212    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align64
213    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
214    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
215    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
216    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
217    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
218    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
219    ; WAVE32: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
220    ; WAVE32: S_ENDPGM 0, implicit [[PTRMASK]](p5)
221    %0:_(s32) = COPY $sgpr0
222    %1:_(p5) = G_DYN_STACKALLOC %0, 64
223    S_ENDPGM 0, implicit %1
224...
225
226---
227name: test_dyn_stackalloc_sgpr_align128
228legalized:       true
229frameInfo:
230  maxAlignment: 64
231stack:
232  - { id: 0, type: variable-sized, alignment: 128 }
233body: |
234  bb.0:
235    liveins: $sgpr0
236
237    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_align128
238    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
239    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
240    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
241    ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
242    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
243    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -8192
244    ; WAVE64: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
245    ; WAVE64: S_ENDPGM 0, implicit [[PTRMASK]](p5)
246    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_align128
247    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
248    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
249    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[C]](s32)
250    ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
251    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY1]], [[SHL]](s32)
252    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -4096
253    ; WAVE32: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
254    ; WAVE32: S_ENDPGM 0, implicit [[PTRMASK]](p5)
255    %0:_(s32) = COPY $sgpr0
256    %1:_(p5) = G_DYN_STACKALLOC %0, 128
257    S_ENDPGM 0, implicit %1
258...
259
260---
261name: test_dyn_stackalloc_sgpr_constant_align4
262legalized:       true
263frameInfo:
264  maxAlignment: 4
265stack:
266  - { id: 0, type: variable-sized, alignment: 4 }
267body: |
268  bb.0:
269
270    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align4
271    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
272    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
273    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
274    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
275    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
276    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
277    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align4
278    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
279    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
280    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
281    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
282    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
283    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
284    %0:_(s32) = G_CONSTANT i32 32
285    %1:_(p5) = G_DYN_STACKALLOC %0, 4
286    S_ENDPGM 0, implicit %1
287...
288
289---
290name: test_dyn_stackalloc_sgpr_constant_align8
291legalized:       true
292frameInfo:
293  maxAlignment: 8
294stack:
295  - { id: 0, type: variable-sized, alignment: 8 }
296body: |
297  bb.0:
298    liveins: $sgpr0
299
300    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align8
301    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
302    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
303    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
304    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
305    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
306    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
307    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align8
308    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
309    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
310    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
311    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
312    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
313    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
314    %0:_(s32) = G_CONSTANT i32 32
315    %1:_(p5) = G_DYN_STACKALLOC %0, 8
316    S_ENDPGM 0, implicit %1
317...
318
319---
320name: test_dyn_stackalloc_sgpr_constant_align16
321legalized:       true
322frameInfo:
323  maxAlignment: 16
324stack:
325  - { id: 0, type: variable-sized, alignment: 16 }
326body: |
327  bb.0:
328    liveins: $sgpr0
329
330    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align16
331    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
332    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
333    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
334    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
335    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
336    ; WAVE64: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
337    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align16
338    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
339    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
340    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
341    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
342    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
343    ; WAVE32: S_ENDPGM 0, implicit [[PTR_ADD]](p5)
344    %0:_(s32) = G_CONSTANT i32 32
345    %1:_(p5) = G_DYN_STACKALLOC %0, 16
346    S_ENDPGM 0, implicit %1
347...
348
349---
350name: test_dyn_stackalloc_sgpr_constant_align32
351legalized:       true
352frameInfo:
353  maxAlignment: 32
354stack:
355  - { id: 0, type: variable-sized, alignment: 32 }
356body: |
357  bb.0:
358    liveins: $sgpr0
359
360    ; WAVE64-LABEL: name: test_dyn_stackalloc_sgpr_constant_align32
361    ; WAVE64: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
362    ; WAVE64: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 6
363    ; WAVE64: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
364    ; WAVE64: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
365    ; WAVE64: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
366    ; WAVE64: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -2048
367    ; WAVE64: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C2]](s32)
368    ; WAVE64: S_ENDPGM 0, implicit [[PTRMASK]](p5)
369    ; WAVE32-LABEL: name: test_dyn_stackalloc_sgpr_constant_align32
370    ; WAVE32: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 32
371    ; WAVE32: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 5
372    ; WAVE32: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[C]], [[C1]](s32)
373    ; WAVE32: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sp_reg
374    ; WAVE32: [[PTR_ADD:%[0-9]+]]:sgpr(p5) = G_PTR_ADD [[COPY]], [[SHL]](s32)
375    ; WAVE32: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1024
376    ; WAVE32: [[PTRMASK:%[0-9]+]]:sgpr(p5) = G_PTRMASK [[PTR_ADD]], [[C2]](s32)
377    ; WAVE32: S_ENDPGM 0, implicit [[PTRMASK]](p5)
378    %0:_(s32) = G_CONSTANT i32 32
379    %1:_(p5) = G_DYN_STACKALLOC %0, 32
380    S_ENDPGM 0, implicit %1
381...
382