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 s6, s6, s11
11 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s7, s7, 0
12 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s6
13 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s7
14 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[0:1], src_private_base
15 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v0, 0
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, 0
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 s6, s6, s11
41 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s7, s7, 0
42 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s6
43 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s7
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
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
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 s6, s6, s11
66 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s32, 0
67 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s7, s7, 0
68 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s6
69 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s7
70 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s14, s10
71 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[10:11], s[4:5]
72 ; FLAT_SCR_OPT-NEXT: s_getpc_b64 s[4:5]
73 ; FLAT_SCR_OPT-NEXT: s_add_u32 s4, s4, extern_func@gotpcrel32@lo+4
74 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s5, s5, extern_func@gotpcrel32@hi+12
75 ; FLAT_SCR_OPT-NEXT: v_lshlrev_b32_e32 v2, 20, v2
76 ; FLAT_SCR_OPT-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x0
77 ; FLAT_SCR_OPT-NEXT: v_lshlrev_b32_e32 v1, 10, v1
78 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s13, s9
79 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s12, s8
80 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[4:5], s[0:1]
81 ; FLAT_SCR_OPT-NEXT: s_mov_b64 s[8:9], s[2:3]
82 ; FLAT_SCR_OPT-NEXT: v_or3_b32 v31, v0, v1, v2
83 ; FLAT_SCR_OPT-NEXT: s_waitcnt lgkmcnt(0)
84 ; FLAT_SCR_OPT-NEXT: s_swappc_b64 s[30:31], s[6:7]
85 ; FLAT_SCR_OPT-NEXT: s_endpgm
87 ; FLAT_SCR_ARCH-LABEL: kernel_calls_no_stack:
88 ; FLAT_SCR_ARCH: ; %bb.0:
89 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[10:11], s[4:5]
90 ; FLAT_SCR_ARCH-NEXT: s_getpc_b64 s[4:5]
91 ; FLAT_SCR_ARCH-NEXT: s_add_u32 s4, s4, extern_func@gotpcrel32@lo+4
92 ; FLAT_SCR_ARCH-NEXT: s_addc_u32 s5, s5, extern_func@gotpcrel32@hi+12
93 ; FLAT_SCR_ARCH-NEXT: v_lshlrev_b32_e32 v2, 20, v2
94 ; FLAT_SCR_ARCH-NEXT: s_load_dwordx2 s[16:17], s[4:5], 0x0
95 ; FLAT_SCR_ARCH-NEXT: v_lshlrev_b32_e32 v1, 10, v1
96 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s14, s8
97 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[4:5], s[0:1]
98 ; FLAT_SCR_ARCH-NEXT: s_mov_b64 s[8:9], s[2:3]
99 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s12, s6
100 ; FLAT_SCR_ARCH-NEXT: v_or3_b32 v31, v0, v1, v2
101 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s13, s7
102 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s32, 0
103 ; FLAT_SCR_ARCH-NEXT: s_waitcnt lgkmcnt(0)
104 ; FLAT_SCR_ARCH-NEXT: s_swappc_b64 s[30:31], s[16:17]
105 ; FLAT_SCR_ARCH-NEXT: s_endpgm
106 call void @extern_func()
110 define amdgpu_kernel void @test(ptr addrspace(1) %out, i32 %in) {
111 ; FLAT_SCR_OPT-LABEL: test:
112 ; FLAT_SCR_OPT: ; %bb.0:
113 ; FLAT_SCR_OPT-NEXT: s_add_u32 s6, s6, s11
114 ; FLAT_SCR_OPT-NEXT: s_addc_u32 s7, s7, 0
115 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s6
116 ; FLAT_SCR_OPT-NEXT: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s7
117 ; FLAT_SCR_OPT-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x0
118 ; FLAT_SCR_OPT-NEXT: ; implicit-def: $vgpr0 : SGPR spill to VGPR lane
119 ; FLAT_SCR_OPT-NEXT: s_waitcnt lgkmcnt(0)
120 ; FLAT_SCR_OPT-NEXT: v_writelane_b32 v0, s0, 0
121 ; FLAT_SCR_OPT-NEXT: v_writelane_b32 v0, s1, 1
122 ; FLAT_SCR_OPT-NEXT: s_or_saveexec_b32 s105, -1
123 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s0, 0
124 ; FLAT_SCR_OPT-NEXT: scratch_store_dword off, v0, s0 ; 4-byte Folded Spill
125 ; FLAT_SCR_OPT-NEXT: s_waitcnt_depctr 0xffe3
126 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
127 ; FLAT_SCR_OPT-NEXT: s_load_dword vcc_lo, s[2:3], 0x8
128 ; FLAT_SCR_OPT-NEXT: ; kill: killed $sgpr2_sgpr3
129 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
130 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
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: s_waitcnt lgkmcnt(0)
214 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v0, vcc_lo
215 ; FLAT_SCR_OPT-NEXT: ;;#ASMSTART
216 ; FLAT_SCR_OPT-NEXT: ;;#ASMEND
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: s_or_saveexec_b32 s105, -1
224 ; FLAT_SCR_OPT-NEXT: s_mov_b32 s0, 0
225 ; FLAT_SCR_OPT-NEXT: scratch_load_dword v1, off, s0 ; 4-byte Folded Reload
226 ; FLAT_SCR_OPT-NEXT: s_waitcnt_depctr 0xffe3
227 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
228 ; FLAT_SCR_OPT-NEXT: s_waitcnt vmcnt(0)
229 ; FLAT_SCR_OPT-NEXT: v_readlane_b32 s0, v1, 0
230 ; FLAT_SCR_OPT-NEXT: v_readlane_b32 s1, v1, 1
231 ; FLAT_SCR_OPT-NEXT: s_or_saveexec_b32 s105, -1
232 ; FLAT_SCR_OPT-NEXT: s_mov_b32 exec_lo, s105
233 ; FLAT_SCR_OPT-NEXT: v_mov_b32_e32 v2, 0
234 ; FLAT_SCR_OPT-NEXT: ; kill: killed $vgpr1
235 ; FLAT_SCR_OPT-NEXT: global_store_dword v2, v0, s[0:1]
236 ; FLAT_SCR_OPT-NEXT: s_endpgm
238 ; FLAT_SCR_ARCH-LABEL: test:
239 ; FLAT_SCR_ARCH: ; %bb.0:
240 ; FLAT_SCR_ARCH-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x0
241 ; FLAT_SCR_ARCH-NEXT: ; implicit-def: $vgpr0 : SGPR spill to VGPR lane
242 ; FLAT_SCR_ARCH-NEXT: s_waitcnt lgkmcnt(0)
243 ; FLAT_SCR_ARCH-NEXT: v_writelane_b32 v0, s0, 0
244 ; FLAT_SCR_ARCH-NEXT: v_writelane_b32 v0, s1, 1
245 ; FLAT_SCR_ARCH-NEXT: s_or_saveexec_b32 s105, -1
246 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s0, 0
247 ; FLAT_SCR_ARCH-NEXT: scratch_store_dword off, v0, s0 ; 4-byte Folded Spill
248 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_depctr 0xffe3
249 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
250 ; FLAT_SCR_ARCH-NEXT: s_load_dword vcc_lo, s[2:3], 0x8
251 ; FLAT_SCR_ARCH-NEXT: ; kill: killed $sgpr2_sgpr3
252 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
253 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
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: s_waitcnt lgkmcnt(0)
337 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v0, vcc_lo
338 ; FLAT_SCR_ARCH-NEXT: ;;#ASMSTART
339 ; FLAT_SCR_ARCH-NEXT: ;;#ASMEND
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: s_or_saveexec_b32 s105, -1
347 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 s0, 0
348 ; FLAT_SCR_ARCH-NEXT: scratch_load_dword v1, off, s0 ; 4-byte Folded Reload
349 ; FLAT_SCR_ARCH-NEXT: s_waitcnt_depctr 0xffe3
350 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
351 ; FLAT_SCR_ARCH-NEXT: s_waitcnt vmcnt(0)
352 ; FLAT_SCR_ARCH-NEXT: v_readlane_b32 s0, v1, 0
353 ; FLAT_SCR_ARCH-NEXT: v_readlane_b32 s1, v1, 1
354 ; FLAT_SCR_ARCH-NEXT: s_or_saveexec_b32 s105, -1
355 ; FLAT_SCR_ARCH-NEXT: s_mov_b32 exec_lo, s105
356 ; FLAT_SCR_ARCH-NEXT: v_mov_b32_e32 v2, 0
357 ; FLAT_SCR_ARCH-NEXT: ; kill: killed $vgpr1
358 ; FLAT_SCR_ARCH-NEXT: global_store_dword v2, v0, s[0:1]
359 ; FLAT_SCR_ARCH-NEXT: s_endpgm
360 call void asm sideeffect "", "~{s[0:7]}" ()
361 call void asm sideeffect "", "~{s[8:15]}" ()
362 call void asm sideeffect "", "~{s[16:23]}" ()
363 call void asm sideeffect "", "~{s[24:31]}" ()
364 call void asm sideeffect "", "~{s[32:39]}" ()
365 call void asm sideeffect "", "~{s[40:47]}" ()
366 call void asm sideeffect "", "~{s[48:55]}" ()
367 call void asm sideeffect "", "~{s[56:63]}" ()
368 call void asm sideeffect "", "~{s[64:71]}" ()
369 call void asm sideeffect "", "~{s[72:79]}" ()
370 call void asm sideeffect "", "~{s[80:87]}" ()
371 call void asm sideeffect "", "~{s[88:95]}" ()
372 call void asm sideeffect "", "~{s[96:103]}" ()
373 call void asm sideeffect "", "~{s[104:105]}" ()
374 call void asm sideeffect "", "~{v[0:7]}" ()
375 call void asm sideeffect "", "~{v[8:15]}" ()
376 call void asm sideeffect "", "~{v[16:23]}" ()
377 call void asm sideeffect "", "~{v[24:31]}" ()
378 call void asm sideeffect "", "~{v[32:39]}" ()
379 call void asm sideeffect "", "~{v[40:47]}" ()
380 call void asm sideeffect "", "~{v[48:55]}" ()
381 call void asm sideeffect "", "~{v[56:63]}" ()
382 call void asm sideeffect "", "~{v[64:71]}" ()
383 call void asm sideeffect "", "~{v[72:79]}" ()
384 call void asm sideeffect "", "~{v[80:87]}" ()
385 call void asm sideeffect "", "~{v[88:95]}" ()
386 call void asm sideeffect "", "~{v[96:103]}" ()
387 call void asm sideeffect "", "~{v[104:111]}" ()
388 call void asm sideeffect "", "~{v[112:119]}" ()
389 call void asm sideeffect "", "~{v[120:127]}" ()
390 call void asm sideeffect "", "~{v[128:135]}" ()
391 call void asm sideeffect "", "~{v[136:143]}" ()
392 call void asm sideeffect "", "~{v[144:151]}" ()
393 call void asm sideeffect "", "~{v[152:159]}" ()
394 call void asm sideeffect "", "~{v[160:167]}" ()
395 call void asm sideeffect "", "~{v[168:175]}" ()
396 call void asm sideeffect "", "~{v[176:183]}" ()
397 call void asm sideeffect "", "~{v[184:191]}" ()
398 call void asm sideeffect "", "~{v[192:199]}" ()
399 call void asm sideeffect "", "~{v[200:207]}" ()
400 call void asm sideeffect "", "~{v[208:215]}" ()
401 call void asm sideeffect "", "~{v[216:223]}" ()
402 call void asm sideeffect "", "~{v[224:231]}" ()
403 call void asm sideeffect "", "~{v[232:239]}" ()
404 call void asm sideeffect "", "~{v[240:247]}" ()
405 call void asm sideeffect "", "~{v[248:255]}" ()
407 store i32 %in, ptr addrspace(1) %out
411 define amdgpu_kernel void @kernel_no_calls_no_stack() {
412 ; GCN-LABEL: kernel_no_calls_no_stack:
418 attributes #0 = { nounwind }
420 !llvm.module.flags = !{!0}
421 !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}