1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx902 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GFX9 %s
5 define amdgpu_kernel void @add1(i32 addrspace(1)* nocapture %arg) {
8 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
9 ; GCN-NEXT: s_mov_b32 s3, 0xf000
10 ; GCN-NEXT: s_mov_b32 s2, 0
11 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
12 ; GCN-NEXT: v_mov_b32_e32 v3, 0
13 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
14 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[0:3], 0 addr64
15 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
16 ; GCN-NEXT: s_waitcnt vmcnt(0)
17 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, 0, v4, vcc
18 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[0:3], 0 addr64
22 ; GFX9: ; %bb.0: ; %bb
23 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
24 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
25 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
26 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
27 ; GFX9-NEXT: global_load_dword v3, v2, s[0:1]
28 ; GFX9-NEXT: s_waitcnt vmcnt(0)
29 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, 0, v3, vcc
30 ; GFX9-NEXT: global_store_dword v2, v0, s[0:1]
33 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
34 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
35 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
36 %v = load i32, i32 addrspace(1)* %gep, align 4
37 %cmp = icmp ugt i32 %x, %y
38 %ext = zext i1 %cmp to i32
39 %add = add i32 %v, %ext
40 store i32 %add, i32 addrspace(1)* %gep, align 4
44 define i16 @add1_i16(i32 addrspace(1)* nocapture %arg, i16 addrspace(1)* nocapture %dst) {
45 ; GCN-LABEL: add1_i16:
47 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
48 ; GCN-NEXT: v_and_b32_e32 v2, 0x3ff, v31
49 ; GCN-NEXT: s_mov_b32 s6, 0
50 ; GCN-NEXT: v_lshlrev_b32_e32 v3, 2, v2
51 ; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v3
52 ; GCN-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
53 ; GCN-NEXT: s_mov_b32 s7, 0xf000
54 ; GCN-NEXT: s_mov_b32 s4, s6
55 ; GCN-NEXT: s_mov_b32 s5, s6
56 ; GCN-NEXT: buffer_load_dword v0, v[0:1], s[4:7], 0 addr64
57 ; GCN-NEXT: v_bfe_u32 v1, v31, 10, 10
58 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v2, v1
59 ; GCN-NEXT: s_waitcnt vmcnt(0)
60 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, 0, v0, vcc
61 ; GCN-NEXT: s_setpc_b64 s[30:31]
63 ; GFX9-LABEL: add1_i16:
64 ; GFX9: ; %bb.0: ; %bb
65 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
66 ; GFX9-NEXT: v_and_b32_e32 v2, 0x3ff, v31
67 ; GFX9-NEXT: v_lshlrev_b32_e32 v3, 2, v2
68 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, v0, v3
69 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
70 ; GFX9-NEXT: global_load_dword v0, v[0:1], off
71 ; GFX9-NEXT: v_bfe_u32 v1, v31, 10, 10
72 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v2, v1
73 ; GFX9-NEXT: s_waitcnt vmcnt(0)
74 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, 0, v0, vcc
75 ; GFX9-NEXT: s_setpc_b64 s[30:31]
77 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
78 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
79 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
80 %v = load i32, i32 addrspace(1)* %gep, align 4
81 %cmp = icmp ugt i32 %x, %y
82 %ext = zext i1 %cmp to i32
83 %add = add i32 %v, %ext
84 %trunc = trunc i32 %add to i16
88 define amdgpu_kernel void @sub1(i32 addrspace(1)* nocapture %arg) {
91 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
92 ; GCN-NEXT: s_mov_b32 s3, 0xf000
93 ; GCN-NEXT: s_mov_b32 s2, 0
94 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
95 ; GCN-NEXT: v_mov_b32_e32 v3, 0
96 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
97 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[0:3], 0 addr64
98 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
99 ; GCN-NEXT: s_waitcnt vmcnt(0)
100 ; GCN-NEXT: v_subbrev_u32_e32 v0, vcc, 0, v4, vcc
101 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[0:3], 0 addr64
105 ; GFX9: ; %bb.0: ; %bb
106 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
107 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
108 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
109 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
110 ; GFX9-NEXT: global_load_dword v3, v2, s[0:1]
111 ; GFX9-NEXT: s_waitcnt vmcnt(0)
112 ; GFX9-NEXT: v_subbrev_co_u32_e32 v0, vcc, 0, v3, vcc
113 ; GFX9-NEXT: global_store_dword v2, v0, s[0:1]
114 ; GFX9-NEXT: s_endpgm
116 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
117 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
118 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
119 %v = load i32, i32 addrspace(1)* %gep, align 4
120 %cmp = icmp ugt i32 %x, %y
121 %ext = sext i1 %cmp to i32
122 %add = add i32 %v, %ext
123 store i32 %add, i32 addrspace(1)* %gep, align 4
127 define amdgpu_kernel void @add_adde(i32 addrspace(1)* nocapture %arg, i32 %a) {
128 ; GCN-LABEL: add_adde:
129 ; GCN: ; %bb.0: ; %bb
130 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
131 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
132 ; GCN-NEXT: s_mov_b32 s7, 0xf000
133 ; GCN-NEXT: s_mov_b32 s6, 0
134 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
135 ; GCN-NEXT: v_mov_b32_e32 v3, 0
136 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
137 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
138 ; GCN-NEXT: v_mov_b32_e32 v5, s0
139 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
140 ; GCN-NEXT: s_waitcnt vmcnt(0)
141 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, v5, v4, vcc
142 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
145 ; GFX9-LABEL: add_adde:
146 ; GFX9: ; %bb.0: ; %bb
147 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
148 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
149 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
150 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
151 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
152 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
153 ; GFX9-NEXT: v_mov_b32_e32 v4, s4
154 ; GFX9-NEXT: s_waitcnt vmcnt(0)
155 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, v4, v3, vcc
156 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
157 ; GFX9-NEXT: s_endpgm
159 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
160 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
161 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
162 %v = load i32, i32 addrspace(1)* %gep, align 4
163 %cmp = icmp ugt i32 %x, %y
164 %ext = zext i1 %cmp to i32
165 %adde = add i32 %v, %ext
166 %add2 = add i32 %adde, %a
167 store i32 %add2, i32 addrspace(1)* %gep, align 4
171 define amdgpu_kernel void @adde_add(i32 addrspace(1)* nocapture %arg, i32 %a) {
172 ; GCN-LABEL: adde_add:
173 ; GCN: ; %bb.0: ; %bb
174 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
175 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
176 ; GCN-NEXT: s_mov_b32 s7, 0xf000
177 ; GCN-NEXT: s_mov_b32 s6, 0
178 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
179 ; GCN-NEXT: v_mov_b32_e32 v3, 0
180 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
181 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
182 ; GCN-NEXT: v_mov_b32_e32 v5, s0
183 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
184 ; GCN-NEXT: s_waitcnt vmcnt(0)
185 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, v4, v5, vcc
186 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
189 ; GFX9-LABEL: adde_add:
190 ; GFX9: ; %bb.0: ; %bb
191 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
192 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
193 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
194 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
195 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
196 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
197 ; GFX9-NEXT: v_mov_b32_e32 v4, s4
198 ; GFX9-NEXT: s_waitcnt vmcnt(0)
199 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, v3, v4, vcc
200 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
201 ; GFX9-NEXT: s_endpgm
203 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
204 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
205 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
206 %v = load i32, i32 addrspace(1)* %gep, align 4
207 %cmp = icmp ugt i32 %x, %y
208 %ext = zext i1 %cmp to i32
209 %add = add i32 %v, %a
210 %adde = add i32 %add, %ext
211 store i32 %adde, i32 addrspace(1)* %gep, align 4
215 define amdgpu_kernel void @sub_sube(i32 addrspace(1)* nocapture %arg, i32 %a) {
216 ; GCN-LABEL: sub_sube:
217 ; GCN: ; %bb.0: ; %bb
218 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
219 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
220 ; GCN-NEXT: s_mov_b32 s7, 0xf000
221 ; GCN-NEXT: s_mov_b32 s6, 0
222 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
223 ; GCN-NEXT: v_mov_b32_e32 v3, 0
224 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
225 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
226 ; GCN-NEXT: v_mov_b32_e32 v5, s0
227 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
228 ; GCN-NEXT: s_waitcnt vmcnt(0)
229 ; GCN-NEXT: v_subb_u32_e32 v0, vcc, v4, v5, vcc
230 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
233 ; GFX9-LABEL: sub_sube:
234 ; GFX9: ; %bb.0: ; %bb
235 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
236 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
237 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
238 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
239 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
240 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
241 ; GFX9-NEXT: v_mov_b32_e32 v4, s4
242 ; GFX9-NEXT: s_waitcnt vmcnt(0)
243 ; GFX9-NEXT: v_subb_co_u32_e32 v0, vcc, v3, v4, vcc
244 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
245 ; GFX9-NEXT: s_endpgm
247 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
248 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
249 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
250 %v = load i32, i32 addrspace(1)* %gep, align 4
251 %cmp = icmp ugt i32 %x, %y
252 %ext = sext i1 %cmp to i32
253 %adde = add i32 %v, %ext
254 %sub = sub i32 %adde, %a
255 store i32 %sub, i32 addrspace(1)* %gep, align 4
259 define amdgpu_kernel void @sub_sube_commuted(i32 addrspace(1)* nocapture %arg, i32 %a) {
260 ; GCN-LABEL: sub_sube_commuted:
261 ; GCN: ; %bb.0: ; %bb
262 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
263 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
264 ; GCN-NEXT: s_mov_b32 s7, 0xf000
265 ; GCN-NEXT: s_mov_b32 s6, 0
266 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
267 ; GCN-NEXT: v_mov_b32_e32 v3, 0
268 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
269 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
270 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
271 ; GCN-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
272 ; GCN-NEXT: s_waitcnt vmcnt(0)
273 ; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
274 ; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v0
275 ; GCN-NEXT: v_add_i32_e32 v0, vcc, 0x64, v0
276 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
279 ; GFX9-LABEL: sub_sube_commuted:
280 ; GFX9: ; %bb.0: ; %bb
281 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
282 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
283 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
284 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
285 ; GFX9-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
286 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
287 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
288 ; GFX9-NEXT: s_waitcnt vmcnt(0)
289 ; GFX9-NEXT: v_sub_u32_e32 v0, v0, v3
290 ; GFX9-NEXT: v_add_u32_e32 v0, s4, v0
291 ; GFX9-NEXT: v_add_u32_e32 v0, 0x64, v0
292 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
293 ; GFX9-NEXT: s_endpgm
295 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
296 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
297 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
298 %v = load i32, i32 addrspace(1)* %gep, align 4
299 %cmp = icmp ugt i32 %x, %y
300 %ext = sext i1 %cmp to i32
301 %adde = add i32 %v, %ext
302 %sub = sub i32 %adde, %a
303 %sub2 = sub i32 100, %sub
304 store i32 %sub2, i32 addrspace(1)* %gep, align 4
308 define amdgpu_kernel void @sube_sub(i32 addrspace(1)* nocapture %arg, i32 %a) {
309 ; GCN-LABEL: sube_sub:
310 ; GCN: ; %bb.0: ; %bb
311 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
312 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
313 ; GCN-NEXT: s_mov_b32 s7, 0xf000
314 ; GCN-NEXT: s_mov_b32 s6, 0
315 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
316 ; GCN-NEXT: v_mov_b32_e32 v3, 0
317 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
318 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
319 ; GCN-NEXT: v_mov_b32_e32 v5, s0
320 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
321 ; GCN-NEXT: s_waitcnt vmcnt(0)
322 ; GCN-NEXT: v_subb_u32_e32 v0, vcc, v4, v5, vcc
323 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
326 ; GFX9-LABEL: sube_sub:
327 ; GFX9: ; %bb.0: ; %bb
328 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
329 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
330 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
331 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
332 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
333 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
334 ; GFX9-NEXT: v_mov_b32_e32 v4, s4
335 ; GFX9-NEXT: s_waitcnt vmcnt(0)
336 ; GFX9-NEXT: v_subb_co_u32_e32 v0, vcc, v3, v4, vcc
337 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
338 ; GFX9-NEXT: s_endpgm
340 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
341 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
342 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
343 %v = load i32, i32 addrspace(1)* %gep, align 4
344 %cmp = icmp ugt i32 %x, %y
345 %ext = sext i1 %cmp to i32
346 %sub = sub i32 %v, %a
347 %adde = add i32 %sub, %ext
348 store i32 %adde, i32 addrspace(1)* %gep, align 4
352 define amdgpu_kernel void @zext_flclass(i32 addrspace(1)* nocapture %arg, float %x) {
353 ; GCN-LABEL: zext_flclass:
354 ; GCN: ; %bb.0: ; %bb
355 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
356 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
357 ; GCN-NEXT: s_mov_b32 s7, 0xf000
358 ; GCN-NEXT: s_mov_b32 s6, 0
359 ; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
360 ; GCN-NEXT: v_mov_b32_e32 v1, 0
361 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
362 ; GCN-NEXT: buffer_load_dword v2, v[0:1], s[4:7], 0 addr64
363 ; GCN-NEXT: v_mov_b32_e32 v3, 0x260
364 ; GCN-NEXT: v_cmp_class_f32_e32 vcc, s0, v3
365 ; GCN-NEXT: s_waitcnt vmcnt(0)
366 ; GCN-NEXT: v_addc_u32_e32 v2, vcc, 0, v2, vcc
367 ; GCN-NEXT: buffer_store_dword v2, v[0:1], s[4:7], 0 addr64
370 ; GFX9-LABEL: zext_flclass:
371 ; GFX9: ; %bb.0: ; %bb
372 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
373 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
374 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
375 ; GFX9-NEXT: v_mov_b32_e32 v2, 0x260
376 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
377 ; GFX9-NEXT: global_load_dword v1, v0, s[2:3]
378 ; GFX9-NEXT: v_cmp_class_f32_e32 vcc, s4, v2
379 ; GFX9-NEXT: s_waitcnt vmcnt(0)
380 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
381 ; GFX9-NEXT: global_store_dword v0, v1, s[2:3]
382 ; GFX9-NEXT: s_endpgm
384 %id = tail call i32 @llvm.amdgcn.workitem.id.x()
385 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %id
386 %v = load i32, i32 addrspace(1)* %gep, align 4
387 %cmp = tail call zeroext i1 @llvm.amdgcn.class.f32(float %x, i32 608)
388 %ext = zext i1 %cmp to i32
389 %add = add i32 %v, %ext
390 store i32 %add, i32 addrspace(1)* %gep, align 4
394 define amdgpu_kernel void @sext_flclass(i32 addrspace(1)* nocapture %arg, float %x) {
395 ; GCN-LABEL: sext_flclass:
396 ; GCN: ; %bb.0: ; %bb
397 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
398 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
399 ; GCN-NEXT: s_mov_b32 s7, 0xf000
400 ; GCN-NEXT: s_mov_b32 s6, 0
401 ; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
402 ; GCN-NEXT: v_mov_b32_e32 v1, 0
403 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
404 ; GCN-NEXT: buffer_load_dword v2, v[0:1], s[4:7], 0 addr64
405 ; GCN-NEXT: v_mov_b32_e32 v3, 0x260
406 ; GCN-NEXT: v_cmp_class_f32_e32 vcc, s0, v3
407 ; GCN-NEXT: s_waitcnt vmcnt(0)
408 ; GCN-NEXT: v_subbrev_u32_e32 v2, vcc, 0, v2, vcc
409 ; GCN-NEXT: buffer_store_dword v2, v[0:1], s[4:7], 0 addr64
412 ; GFX9-LABEL: sext_flclass:
413 ; GFX9: ; %bb.0: ; %bb
414 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
415 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
416 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
417 ; GFX9-NEXT: v_mov_b32_e32 v2, 0x260
418 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
419 ; GFX9-NEXT: global_load_dword v1, v0, s[2:3]
420 ; GFX9-NEXT: v_cmp_class_f32_e32 vcc, s4, v2
421 ; GFX9-NEXT: s_waitcnt vmcnt(0)
422 ; GFX9-NEXT: v_subbrev_co_u32_e32 v1, vcc, 0, v1, vcc
423 ; GFX9-NEXT: global_store_dword v0, v1, s[2:3]
424 ; GFX9-NEXT: s_endpgm
426 %id = tail call i32 @llvm.amdgcn.workitem.id.x()
427 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %id
428 %v = load i32, i32 addrspace(1)* %gep, align 4
429 %cmp = tail call zeroext i1 @llvm.amdgcn.class.f32(float %x, i32 608)
430 %ext = sext i1 %cmp to i32
431 %add = add i32 %v, %ext
432 store i32 %add, i32 addrspace(1)* %gep, align 4
436 define amdgpu_kernel void @add_and(i32 addrspace(1)* nocapture %arg) {
437 ; GCN-LABEL: add_and:
438 ; GCN: ; %bb.0: ; %bb
439 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
440 ; GCN-NEXT: s_mov_b32 s7, 0xf000
441 ; GCN-NEXT: s_mov_b32 s6, 0
442 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
443 ; GCN-NEXT: v_mov_b32_e32 v3, 0
444 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
445 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
446 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
447 ; GCN-NEXT: v_cmp_lt_u32_e64 s[0:1], 1, v0
448 ; GCN-NEXT: s_and_b64 vcc, vcc, s[0:1]
449 ; GCN-NEXT: s_waitcnt vmcnt(0)
450 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, 0, v4, vcc
451 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
454 ; GFX9-LABEL: add_and:
455 ; GFX9: ; %bb.0: ; %bb
456 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
457 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
458 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
459 ; GFX9-NEXT: v_cmp_lt_u32_e64 s[0:1], 1, v0
460 ; GFX9-NEXT: s_and_b64 vcc, vcc, s[0:1]
461 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
462 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
463 ; GFX9-NEXT: s_waitcnt vmcnt(0)
464 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, 0, v3, vcc
465 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
466 ; GFX9-NEXT: s_endpgm
468 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
469 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
470 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
471 %v = load i32, i32 addrspace(1)* %gep, align 4
472 %cmp1 = icmp ugt i32 %x, %y
473 %cmp2 = icmp ugt i32 %x, 1
474 %cmp = and i1 %cmp1, %cmp2
475 %ext = zext i1 %cmp to i32
476 %add = add i32 %v, %ext
477 store i32 %add, i32 addrspace(1)* %gep, align 4
481 ; sub x, sext (setcc) => addcarry x, 0, setcc
482 define amdgpu_kernel void @cmp_sub_sext(i32 addrspace(1)* nocapture %arg) {
483 ; GCN-LABEL: cmp_sub_sext:
484 ; GCN: ; %bb.0: ; %bb
485 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
486 ; GCN-NEXT: s_mov_b32 s3, 0xf000
487 ; GCN-NEXT: s_mov_b32 s2, 0
488 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
489 ; GCN-NEXT: v_mov_b32_e32 v3, 0
490 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
491 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[0:3], 0 addr64
492 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
493 ; GCN-NEXT: s_waitcnt vmcnt(0)
494 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, 0, v4, vcc
495 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[0:3], 0 addr64
498 ; GFX9-LABEL: cmp_sub_sext:
499 ; GFX9: ; %bb.0: ; %bb
500 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
501 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
502 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
503 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
504 ; GFX9-NEXT: global_load_dword v3, v2, s[0:1]
505 ; GFX9-NEXT: s_waitcnt vmcnt(0)
506 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, 0, v3, vcc
507 ; GFX9-NEXT: global_store_dword v2, v0, s[0:1]
508 ; GFX9-NEXT: s_endpgm
510 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
511 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
512 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
513 %v = load i32, i32 addrspace(1)* %gep, align 4
514 %cmp = icmp ugt i32 %x, %y
515 %ext = sext i1 %cmp to i32
516 %add = sub i32 %v, %ext
517 store i32 %add, i32 addrspace(1)* %gep, align 4
521 ; sub x, zext (setcc) => subcarry x, 0, setcc
522 define amdgpu_kernel void @cmp_sub_zext(i32 addrspace(1)* nocapture %arg) {
523 ; GCN-LABEL: cmp_sub_zext:
524 ; GCN: ; %bb.0: ; %bb
525 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
526 ; GCN-NEXT: s_mov_b32 s3, 0xf000
527 ; GCN-NEXT: s_mov_b32 s2, 0
528 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
529 ; GCN-NEXT: v_mov_b32_e32 v3, 0
530 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
531 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[0:3], 0 addr64
532 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
533 ; GCN-NEXT: s_waitcnt vmcnt(0)
534 ; GCN-NEXT: v_subbrev_u32_e32 v0, vcc, 0, v4, vcc
535 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[0:3], 0 addr64
538 ; GFX9-LABEL: cmp_sub_zext:
539 ; GFX9: ; %bb.0: ; %bb
540 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
541 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
542 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
543 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
544 ; GFX9-NEXT: global_load_dword v3, v2, s[0:1]
545 ; GFX9-NEXT: s_waitcnt vmcnt(0)
546 ; GFX9-NEXT: v_subbrev_co_u32_e32 v0, vcc, 0, v3, vcc
547 ; GFX9-NEXT: global_store_dword v2, v0, s[0:1]
548 ; GFX9-NEXT: s_endpgm
550 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
551 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
552 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
553 %v = load i32, i32 addrspace(1)* %gep, align 4
554 %cmp = icmp ugt i32 %x, %y
555 %ext = zext i1 %cmp to i32
556 %add = sub i32 %v, %ext
557 store i32 %add, i32 addrspace(1)* %gep, align 4
561 define amdgpu_kernel void @sub_addcarry(i32 addrspace(1)* nocapture %arg, i32 %a) {
562 ; GCN-LABEL: sub_addcarry:
563 ; GCN: ; %bb.0: ; %bb
564 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
565 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
566 ; GCN-NEXT: s_mov_b32 s7, 0xf000
567 ; GCN-NEXT: s_mov_b32 s6, 0
568 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
569 ; GCN-NEXT: v_mov_b32_e32 v3, 0
570 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
571 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
572 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
573 ; GCN-NEXT: s_waitcnt vmcnt(0)
574 ; GCN-NEXT: v_addc_u32_e32 v0, vcc, 0, v4, vcc
575 ; GCN-NEXT: v_subrev_i32_e32 v0, vcc, s0, v0
576 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
579 ; GFX9-LABEL: sub_addcarry:
580 ; GFX9: ; %bb.0: ; %bb
581 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
582 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
583 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
584 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
585 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
586 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
587 ; GFX9-NEXT: s_waitcnt vmcnt(0)
588 ; GFX9-NEXT: v_addc_co_u32_e32 v0, vcc, 0, v3, vcc
589 ; GFX9-NEXT: v_subrev_u32_e32 v0, s4, v0
590 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
591 ; GFX9-NEXT: s_endpgm
593 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
594 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
595 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
596 %v = load i32, i32 addrspace(1)* %gep, align 4
597 %cmp = icmp ugt i32 %x, %y
598 %ext = zext i1 %cmp to i32
599 %adde = add i32 %v, %ext
600 %add2 = sub i32 %adde, %a
601 store i32 %add2, i32 addrspace(1)* %gep, align 4
605 define amdgpu_kernel void @sub_subcarry(i32 addrspace(1)* nocapture %arg, i32 %a) {
606 ; GCN-LABEL: sub_subcarry:
607 ; GCN: ; %bb.0: ; %bb
608 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
609 ; GCN-NEXT: s_load_dword s0, s[0:1], 0xb
610 ; GCN-NEXT: s_mov_b32 s7, 0xf000
611 ; GCN-NEXT: s_mov_b32 s6, 0
612 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
613 ; GCN-NEXT: v_mov_b32_e32 v3, 0
614 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
615 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
616 ; GCN-NEXT: v_mov_b32_e32 v5, s0
617 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
618 ; GCN-NEXT: s_waitcnt vmcnt(0)
619 ; GCN-NEXT: v_subb_u32_e32 v0, vcc, v4, v5, vcc
620 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
623 ; GFX9-LABEL: sub_subcarry:
624 ; GFX9: ; %bb.0: ; %bb
625 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
626 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
627 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
628 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
629 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
630 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
631 ; GFX9-NEXT: v_mov_b32_e32 v4, s4
632 ; GFX9-NEXT: s_waitcnt vmcnt(0)
633 ; GFX9-NEXT: v_subb_co_u32_e32 v0, vcc, v3, v4, vcc
634 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
635 ; GFX9-NEXT: s_endpgm
637 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
638 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
639 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
640 %v = load i32, i32 addrspace(1)* %gep, align 4
641 %cmp = icmp ugt i32 %x, %y
642 %ext = zext i1 %cmp to i32
643 %adde = sub i32 %v, %ext
644 %add2 = sub i32 %adde, %a
645 store i32 %add2, i32 addrspace(1)* %gep, align 4
649 ; Check case where sub is commuted with zext
650 define amdgpu_kernel void @sub_zext_setcc_commute(i32 addrspace(1)* nocapture %arg, i32 %a, i32%b) {
651 ; GCN-LABEL: sub_zext_setcc_commute:
652 ; GCN: ; %bb.0: ; %bb
653 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
654 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
655 ; GCN-NEXT: s_mov_b32 s7, 0xf000
656 ; GCN-NEXT: s_mov_b32 s6, 0
657 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
658 ; GCN-NEXT: v_mov_b32_e32 v3, 0
659 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
660 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
661 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
662 ; GCN-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
663 ; GCN-NEXT: s_waitcnt vmcnt(0)
664 ; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
665 ; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v0
666 ; GCN-NEXT: v_subrev_i32_e32 v0, vcc, s1, v0
667 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
670 ; GFX9-LABEL: sub_zext_setcc_commute:
671 ; GFX9: ; %bb.0: ; %bb
672 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
673 ; GFX9-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x2c
674 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
675 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
676 ; GFX9-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
677 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
678 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
679 ; GFX9-NEXT: s_waitcnt vmcnt(0)
680 ; GFX9-NEXT: v_sub_u32_e32 v0, v0, v3
681 ; GFX9-NEXT: v_add_u32_e32 v0, s4, v0
682 ; GFX9-NEXT: v_subrev_u32_e32 v0, s5, v0
683 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
684 ; GFX9-NEXT: s_endpgm
686 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
687 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
688 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
689 %v = load i32, i32 addrspace(1)* %gep, align 4
690 %cmp = icmp ugt i32 %x, %y
691 %ext = zext i1 %cmp to i32
692 %adde = sub i32 %v, %ext
693 %sub = sub i32 %a, %adde
694 %sub2 = sub i32 %sub, %b
695 store i32 %sub2, i32 addrspace(1)* %gep, align 4
699 ; Check case where sub is commuted with sext
700 define amdgpu_kernel void @sub_sext_setcc_commute(i32 addrspace(1)* nocapture %arg, i32 %a, i32%b) {
701 ; GCN-LABEL: sub_sext_setcc_commute:
702 ; GCN: ; %bb.0: ; %bb
703 ; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
704 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
705 ; GCN-NEXT: s_mov_b32 s7, 0xf000
706 ; GCN-NEXT: s_mov_b32 s6, 0
707 ; GCN-NEXT: v_lshlrev_b32_e32 v2, 2, v0
708 ; GCN-NEXT: v_mov_b32_e32 v3, 0
709 ; GCN-NEXT: s_waitcnt lgkmcnt(0)
710 ; GCN-NEXT: buffer_load_dword v4, v[2:3], s[4:7], 0 addr64
711 ; GCN-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
712 ; GCN-NEXT: v_cndmask_b32_e64 v0, 0, -1, vcc
713 ; GCN-NEXT: s_waitcnt vmcnt(0)
714 ; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
715 ; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v0
716 ; GCN-NEXT: v_subrev_i32_e32 v0, vcc, s1, v0
717 ; GCN-NEXT: buffer_store_dword v0, v[2:3], s[4:7], 0 addr64
720 ; GFX9-LABEL: sub_sext_setcc_commute:
721 ; GFX9: ; %bb.0: ; %bb
722 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
723 ; GFX9-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x2c
724 ; GFX9-NEXT: v_lshlrev_b32_e32 v2, 2, v0
725 ; GFX9-NEXT: v_cmp_gt_u32_e32 vcc, v0, v1
726 ; GFX9-NEXT: v_cndmask_b32_e64 v0, 0, -1, vcc
727 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
728 ; GFX9-NEXT: global_load_dword v3, v2, s[2:3]
729 ; GFX9-NEXT: s_waitcnt vmcnt(0)
730 ; GFX9-NEXT: v_sub_u32_e32 v0, v0, v3
731 ; GFX9-NEXT: v_add_u32_e32 v0, s4, v0
732 ; GFX9-NEXT: v_subrev_u32_e32 v0, s5, v0
733 ; GFX9-NEXT: global_store_dword v2, v0, s[2:3]
734 ; GFX9-NEXT: s_endpgm
736 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
737 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
738 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %x
739 %v = load i32, i32 addrspace(1)* %gep, align 4
740 %cmp = icmp ugt i32 %x, %y
741 %ext = sext i1 %cmp to i32
742 %adde = sub i32 %v, %ext
743 %sub = sub i32 %a, %adde
744 %sub2 = sub i32 %sub, %b
745 store i32 %sub2, i32 addrspace(1)* %gep, align 4
749 declare i1 @llvm.amdgcn.class.f32(float, i32) #0
751 declare i32 @llvm.amdgcn.workitem.id.x() #0
753 declare i32 @llvm.amdgcn.workitem.id.y() #0
755 attributes #0 = { nounwind readnone speculatable }