1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 --mattr=+enable-flat-scratch < %s | FileCheck -check-prefixes=GCN,FLAT_SCR_OPT %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 --mattr=+architected-flat-scratch < %s | FileCheck -check-prefixes=GCN,FLAT_SCR_ARCH %s
5 declare void @extern_func() #0
7 define amdgpu_kernel void @stack_object_addrspacecast_in_kernel_no_calls() {
8 ; FLAT_SCR_OPT-LABEL: stack_object_addrspacecast_in_kernel_no_calls:
9 ; FLAT_SCR_OPT: ; %bb.0:
10 ; FLAT_SCR_OPT-NEXT: s_add_u32 s0, s0, s3
11 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s1, s1, 0
12 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s0
13 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s1
14 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[0:1], src_private_base
15 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v0, 4
16 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v1, s1
17 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v2, 0
18 ; FLAT_SCR_OPT-NEXT: flat_store_dword v[0:1], v2
19 ; FLAT_SCR_OPT-NEXT: s_waitcnt_vscnt null, 0x0
20 ; FLAT_SCR_OPT-NEXT: s_endpgm
22 ; FLAT_SCR_ARCH-LABEL: stack_object_addrspacecast_in_kernel_no_calls:
23 ; FLAT_SCR_ARCH: ; %bb.0:
24 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[0:1], src_private_base
25 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v0, 4
26 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v1, s1
27 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v2, 0
28 ; FLAT_SCR_ARCH-NEXT: flat_store_dword v[0:1], v2
29 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_vscnt null, 0x0
30 ; FLAT_SCR_ARCH-NEXT: s_endpgm
31 %alloca = alloca i32, addrspace(5)
32 %cast = addrspacecast ptr addrspace(5) %alloca to ptr
33 store volatile i32 0, ptr %cast
37 define amdgpu_kernel void @stack_object_in_kernel_no_calls() {
38 ; FLAT_SCR_OPT-LABEL: stack_object_in_kernel_no_calls:
39 ; FLAT_SCR_OPT: ; %bb.0:
40 ; FLAT_SCR_OPT-NEXT: s_add_u32 s0, s0, s3
41 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s1, s1, 0
42 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s0
43 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s1
44 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v0, 0
45 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s0, 0
46 ; FLAT_SCR_OPT-NEXT: scratch_store_dword off, v0, s0 offset:4
47 ; FLAT_SCR_OPT-NEXT: s_waitcnt_vscnt null, 0x0
48 ; FLAT_SCR_OPT-NEXT: s_endpgm
50 ; FLAT_SCR_ARCH-LABEL: stack_object_in_kernel_no_calls:
51 ; FLAT_SCR_ARCH: ; %bb.0:
52 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v0, 0
53 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s0, 0
54 ; FLAT_SCR_ARCH-NEXT: scratch_store_dword off, v0, s0 offset:4
55 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_vscnt null, 0x0
56 ; FLAT_SCR_ARCH-NEXT: s_endpgm
57 %alloca = alloca i32, addrspace(5)
58 store volatile i32 0, ptr addrspace(5) %alloca
62 define amdgpu_kernel void @kernel_calls_no_stack() {
63 ; FLAT_SCR_OPT-LABEL: kernel_calls_no_stack:
64 ; FLAT_SCR_OPT: ; %bb.0:
65 ; FLAT_SCR_OPT-NEXT: s_add_u32 s8, s8, s13
66 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s32, 0
67 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s9, s9, 0
68 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8
69 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9
70 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[8:9], s[4:5]
71 ; FLAT_SCR_OPT-NEXT: s_getpc_b64 s[4:5]
72 ; FLAT_SCR_OPT-NEXT: s_add_u32 s4, s4, extern_func@gotpcrel32@lo+4
73 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s5, s5, extern_func@gotpcrel32@hi+12
74 ; FLAT_SCR_OPT-NEXT: v_lshlrev_b32_e32 v2, 20, v2
75 ; FLAT_SCR_OPT-NEXT: s_load_dwordx2 s[16:17], s[4:5], 0x0
76 ; FLAT_SCR_OPT-NEXT: v_lshlrev_b32_e32 v1, 10, v1
77 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s14, s12
78 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s13, s11
79 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s12, s10
80 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[10:11], s[6:7]
81 ; FLAT_SCR_OPT-NEXT: v_or3_b32 v31, v0, v1, v2
82 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[4:5], s[0:1]
83 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[6:7], s[2:3]
84 ; FLAT_SCR_OPT-NEXT: s_waitcnt lgkmcnt(0)
85 ; FLAT_SCR_OPT-NEXT: s_swappc_b64 s[30:31], s[16:17]
86 ; FLAT_SCR_OPT-NEXT: s_endpgm
88 ; FLAT_SCR_ARCH-LABEL: kernel_calls_no_stack:
89 ; FLAT_SCR_ARCH: ; %bb.0:
90 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s13, s9
91 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s12, s8
92 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[8:9], s[4:5]
93 ; FLAT_SCR_ARCH-NEXT: s_getpc_b64 s[4:5]
94 ; FLAT_SCR_ARCH-NEXT: s_add_u32 s4, s4, extern_func@gotpcrel32@lo+4
95 ; FLAT_SCR_ARCH-NEXT: s_addc_u32 s5, s5, extern_func@gotpcrel32@hi+12
96 ; FLAT_SCR_ARCH-NEXT: v_lshlrev_b32_e32 v2, 20, v2
97 ; FLAT_SCR_ARCH-NEXT: s_load_dwordx2 s[16:17], s[4:5], 0x0
98 ; FLAT_SCR_ARCH-NEXT: v_lshlrev_b32_e32 v1, 10, v1
99 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s14, s10
100 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[10:11], s[6:7]
101 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[4:5], s[0:1]
102 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[6:7], s[2:3]
103 ; FLAT_SCR_ARCH-NEXT: v_or3_b32 v31, v0, v1, v2
104 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s32, 0
105 ; FLAT_SCR_ARCH-NEXT: s_waitcnt lgkmcnt(0)
106 ; FLAT_SCR_ARCH-NEXT: s_swappc_b64 s[30:31], s[16:17]
107 ; FLAT_SCR_ARCH-NEXT: s_endpgm
108 call void @extern_func()
112 define amdgpu_kernel void @test(ptr addrspace(1) %out, i32 %in) {
113 ; FLAT_SCR_OPT-LABEL: test:
114 ; FLAT_SCR_OPT: ; %bb.0:
115 ; FLAT_SCR_OPT-NEXT: s_add_u32 s2, s2, s5
116 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s3, s3, 0
117 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s2
118 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s3
119 ; FLAT_SCR_OPT-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x0
120 ; FLAT_SCR_OPT-NEXT: ; implicit-def: $vgpr0 : SGPR spill to VGPR lane
121 ; FLAT_SCR_OPT-NEXT: s_waitcnt lgkmcnt(0)
122 ; FLAT_SCR_OPT-NEXT: v_writelane_b32 v0, s2, 0
123 ; FLAT_SCR_OPT-NEXT: v_writelane_b32 v0, s3, 1
124 ; FLAT_SCR_OPT-NEXT: s_or_saveexec_b32 s105, -1
125 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s2, 4
126 ; FLAT_SCR_OPT-NEXT: scratch_store_dword off, v0, s2 ; 4-byte Folded Spill
127 ; FLAT_SCR_OPT-NEXT: s_waitcnt_depctr 0xffe3
128 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
129 ; FLAT_SCR_OPT-NEXT: s_load_dword vcc_lo, s[0:1], 0x8
130 ; FLAT_SCR_OPT-NEXT: ; kill: killed $sgpr0_sgpr1
131 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
132 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
133 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
134 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
135 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
136 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
137 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
138 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
139 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
140 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
141 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
142 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
143 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
144 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
145 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
146 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
147 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
148 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
149 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
150 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
151 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
152 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
153 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
154 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
155 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
156 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
157 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
158 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
159 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
160 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
161 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
162 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
163 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
164 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
165 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
166 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
167 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
168 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
169 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
170 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
171 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
172 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
173 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
174 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
175 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
176 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
177 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
178 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
179 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
180 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
181 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
182 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
183 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
184 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
185 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
186 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
187 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
188 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
189 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
190 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
191 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
192 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
193 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
194 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
195 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
196 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
197 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
198 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
199 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
200 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
201 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
202 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
203 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
204 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
205 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
206 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
207 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
208 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
209 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
210 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
211 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
212 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
213 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
214 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
215 ; FLAT_SCR_OPT-NEXT: s_waitcnt lgkmcnt(0)
216 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v0, vcc_lo
217 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
218 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
219 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
220 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
221 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
222 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
223 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
224 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
225 ; FLAT_SCR_OPT-NEXT: s_or_saveexec_b32 s105, -1
226 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s0, 4
227 ; FLAT_SCR_OPT-NEXT: scratch_load_dword v1, off, s0 ; 4-byte Folded Reload
228 ; FLAT_SCR_OPT-NEXT: s_waitcnt_depctr 0xffe3
229 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
230 ; FLAT_SCR_OPT-NEXT: s_waitcnt vmcnt(0)
231 ; FLAT_SCR_OPT-NEXT: v_readlane_b32 s0, v1, 0
232 ; FLAT_SCR_OPT-NEXT: v_readlane_b32 s1, v1, 1
233 ; FLAT_SCR_OPT-NEXT: s_or_saveexec_b32 s105, -1
234 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
235 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v2, 0
236 ; FLAT_SCR_OPT-NEXT: ; kill: killed $vgpr1
237 ; FLAT_SCR_OPT-NEXT: global_store_dword v2, v0, s[0:1]
238 ; FLAT_SCR_OPT-NEXT: s_endpgm
240 ; FLAT_SCR_ARCH-LABEL: test:
241 ; FLAT_SCR_ARCH: ; %bb.0:
242 ; FLAT_SCR_ARCH-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x0
243 ; FLAT_SCR_ARCH-NEXT: ; implicit-def: $vgpr0 : SGPR spill to VGPR lane
244 ; FLAT_SCR_ARCH-NEXT: s_waitcnt lgkmcnt(0)
245 ; FLAT_SCR_ARCH-NEXT: v_writelane_b32 v0, s2, 0
246 ; FLAT_SCR_ARCH-NEXT: v_writelane_b32 v0, s3, 1
247 ; FLAT_SCR_ARCH-NEXT: s_or_saveexec_b32 s105, -1
248 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s2, 4
249 ; FLAT_SCR_ARCH-NEXT: scratch_store_dword off, v0, s2 ; 4-byte Folded Spill
250 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_depctr 0xffe3
251 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
252 ; FLAT_SCR_ARCH-NEXT: s_load_dword vcc_lo, s[0:1], 0x8
253 ; FLAT_SCR_ARCH-NEXT: ; kill: killed $sgpr0_sgpr1
254 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
255 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
256 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
257 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
258 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
259 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
260 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
261 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
262 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
263 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
264 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
265 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
266 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
267 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
268 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
269 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
270 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
271 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
272 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
273 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
274 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
275 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
276 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
277 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
278 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
279 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
280 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
281 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
282 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
283 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
284 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
285 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
286 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
287 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
288 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
289 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
290 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
291 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
292 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
293 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
294 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
295 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
296 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
297 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
298 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
299 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
300 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
301 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
302 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
303 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
304 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
305 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
306 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
307 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
308 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
309 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
310 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
311 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
312 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
313 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
314 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
315 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
316 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
317 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
318 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
319 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
320 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
321 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
322 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
323 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
324 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
325 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
326 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
327 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
328 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
329 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
330 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
331 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
332 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
333 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
334 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
335 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
336 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
337 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
338 ; FLAT_SCR_ARCH-NEXT: s_waitcnt lgkmcnt(0)
339 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v0, vcc_lo
340 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
341 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
342 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
343 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
344 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
345 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
346 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
347 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
348 ; FLAT_SCR_ARCH-NEXT: s_or_saveexec_b32 s105, -1
349 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s0, 4
350 ; FLAT_SCR_ARCH-NEXT: scratch_load_dword v1, off, s0 ; 4-byte Folded Reload
351 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_depctr 0xffe3
352 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
353 ; FLAT_SCR_ARCH-NEXT: s_waitcnt vmcnt(0)
354 ; FLAT_SCR_ARCH-NEXT: v_readlane_b32 s0, v1, 0
355 ; FLAT_SCR_ARCH-NEXT: v_readlane_b32 s1, v1, 1
356 ; FLAT_SCR_ARCH-NEXT: s_or_saveexec_b32 s105, -1
357 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
358 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v2, 0
359 ; FLAT_SCR_ARCH-NEXT: ; kill: killed $vgpr1
360 ; FLAT_SCR_ARCH-NEXT: global_store_dword v2, v0, s[0:1]
361 ; FLAT_SCR_ARCH-NEXT: s_endpgm
362 call void asm sideeffect "", "~{s[0:7]}" ()
363 call void asm sideeffect "", "~{s[8:15]}" ()
364 call void asm sideeffect "", "~{s[16:23]}" ()
365 call void asm sideeffect "", "~{s[24:31]}" ()
366 call void asm sideeffect "", "~{s[32:39]}" ()
367 call void asm sideeffect "", "~{s[40:47]}" ()
368 call void asm sideeffect "", "~{s[48:55]}" ()
369 call void asm sideeffect "", "~{s[56:63]}" ()
370 call void asm sideeffect "", "~{s[64:71]}" ()
371 call void asm sideeffect "", "~{s[72:79]}" ()
372 call void asm sideeffect "", "~{s[80:87]}" ()
373 call void asm sideeffect "", "~{s[88:95]}" ()
374 call void asm sideeffect "", "~{s[96:103]}" ()
375 call void asm sideeffect "", "~{s[104:105]}" ()
376 call void asm sideeffect "", "~{v[0:7]}" ()
377 call void asm sideeffect "", "~{v[8:15]}" ()
378 call void asm sideeffect "", "~{v[16:23]}" ()
379 call void asm sideeffect "", "~{v[24:31]}" ()
380 call void asm sideeffect "", "~{v[32:39]}" ()
381 call void asm sideeffect "", "~{v[40:47]}" ()
382 call void asm sideeffect "", "~{v[48:55]}" ()
383 call void asm sideeffect "", "~{v[56:63]}" ()
384 call void asm sideeffect "", "~{v[64:71]}" ()
385 call void asm sideeffect "", "~{v[72:79]}" ()
386 call void asm sideeffect "", "~{v[80:87]}" ()
387 call void asm sideeffect "", "~{v[88:95]}" ()
388 call void asm sideeffect "", "~{v[96:103]}" ()
389 call void asm sideeffect "", "~{v[104:111]}" ()
390 call void asm sideeffect "", "~{v[112:119]}" ()
391 call void asm sideeffect "", "~{v[120:127]}" ()
392 call void asm sideeffect "", "~{v[128:135]}" ()
393 call void asm sideeffect "", "~{v[136:143]}" ()
394 call void asm sideeffect "", "~{v[144:151]}" ()
395 call void asm sideeffect "", "~{v[152:159]}" ()
396 call void asm sideeffect "", "~{v[160:167]}" ()
397 call void asm sideeffect "", "~{v[168:175]}" ()
398 call void asm sideeffect "", "~{v[176:183]}" ()
399 call void asm sideeffect "", "~{v[184:191]}" ()
400 call void asm sideeffect "", "~{v[192:199]}" ()
401 call void asm sideeffect "", "~{v[200:207]}" ()
402 call void asm sideeffect "", "~{v[208:215]}" ()
403 call void asm sideeffect "", "~{v[216:223]}" ()
404 call void asm sideeffect "", "~{v[224:231]}" ()
405 call void asm sideeffect "", "~{v[232:239]}" ()
406 call void asm sideeffect "", "~{v[240:247]}" ()
407 call void asm sideeffect "", "~{v[248:255]}" ()
409 store i32 %in, ptr addrspace(1) %out
413 define amdgpu_kernel void @kernel_no_calls_no_stack() {
414 ; GCN-LABEL: kernel_no_calls_no_stack:
420 attributes #0 = { nounwind }