1 ; RUN: llc -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=ALL -check-prefix=SGPR %s
3 ; Make sure this doesn't crash.
4 ; ALL-LABEL: {{^}}test:
5 ; ALL: s_mov_b32 s[[LO:[0-9]+]], SCRATCH_RSRC_DWORD0
6 ; ALL: s_mov_b32 s[[HI:[0-9]+]], 0xe80000
8 ; Make sure we are handling hazards correctly.
9 ; SGPR: v_mov_b32_e32 v0, vcc_lo
10 ; SGPR-NEXT: s_or_saveexec_b64 [[EXEC_COPY:s\[[0-9]+:[0-9]+\]]], -1
11 ; SGPR-NEXT: buffer_load_dword [[VHI:v[0-9]+]], off, s[{{[0-9]+:[0-9]+}}], 0 offset:4 ; 4-byte Folded Reload
12 ; SGPR-NEXT: s_mov_b64 exec, [[EXEC_COPY]]
13 ; SGPR-NEXT: s_waitcnt vmcnt(0)
14 ; SGPR-NEXT: v_readlane_b32 s{{[0-9]+}}, [[VHI]], 0
15 ; SGPR-NEXT: v_readlane_b32 s{{[0-9]+}}, [[VHI]], 1
16 ; SGPR-NEXT: v_readlane_b32 s{{[0-9]+}}, [[VHI]], 2
17 ; SGPR-NEXT: v_readlane_b32 s[[HI:[0-9]+]], [[VHI]], 3
18 ; SGPR-NEXT: s_or_saveexec_b64 s[100:101], -1
19 ; SGPR-NEXT: s_mov_b64 exec, s[100:101]
21 ; SGPR-NEXT: buffer_store_dword v0, off, s[{{[0-9]+}}:[[HI]]], 0
22 ; SGPR-NEXT: ; kill: killed $vgpr1
25 define amdgpu_kernel void @test(ptr addrspace(1) %out, i32 %in) {
26 call void asm sideeffect "", "~{s[0:7]}" ()
27 call void asm sideeffect "", "~{s[8:15]}" ()
28 call void asm sideeffect "", "~{s[16:23]}" ()
29 call void asm sideeffect "", "~{s[24:31]}" ()
30 call void asm sideeffect "", "~{s[32:39]}" ()
31 call void asm sideeffect "", "~{s[40:47]}" ()
32 call void asm sideeffect "", "~{s[48:55]}" ()
33 call void asm sideeffect "", "~{s[56:63]}" ()
34 call void asm sideeffect "", "~{s[64:71]}" ()
35 call void asm sideeffect "", "~{s[72:79]}" ()
36 call void asm sideeffect "", "~{s[80:87]}" ()
37 call void asm sideeffect "", "~{s[88:95]}" ()
38 call void asm sideeffect "", "~{v[0:7]}" ()
39 call void asm sideeffect "", "~{v[8:15]}" ()
40 call void asm sideeffect "", "~{v[16:23]}" ()
41 call void asm sideeffect "", "~{v[24:31]}" ()
42 call void asm sideeffect "", "~{v[32:39]}" ()
43 call void asm sideeffect "", "~{v[40:47]}" ()
44 call void asm sideeffect "", "~{v[48:55]}" ()
45 call void asm sideeffect "", "~{v[56:63]}" ()
46 call void asm sideeffect "", "~{v[64:71]}" ()
47 call void asm sideeffect "", "~{v[72:79]}" ()
48 call void asm sideeffect "", "~{v[80:87]}" ()
49 call void asm sideeffect "", "~{v[88:95]}" ()
50 call void asm sideeffect "", "~{v[96:103]}" ()
51 call void asm sideeffect "", "~{v[104:111]}" ()
52 call void asm sideeffect "", "~{v[112:119]}" ()
53 call void asm sideeffect "", "~{v[120:127]}" ()
54 call void asm sideeffect "", "~{v[128:135]}" ()
55 call void asm sideeffect "", "~{v[136:143]}" ()
56 call void asm sideeffect "", "~{v[144:151]}" ()
57 call void asm sideeffect "", "~{v[152:159]}" ()
58 call void asm sideeffect "", "~{v[160:167]}" ()
59 call void asm sideeffect "", "~{v[168:175]}" ()
60 call void asm sideeffect "", "~{v[176:183]}" ()
61 call void asm sideeffect "", "~{v[184:191]}" ()
62 call void asm sideeffect "", "~{v[192:199]}" ()
63 call void asm sideeffect "", "~{v[200:207]}" ()
64 call void asm sideeffect "", "~{v[208:215]}" ()
65 call void asm sideeffect "", "~{v[216:223]}" ()
66 call void asm sideeffect "", "~{v[224:231]}" ()
67 call void asm sideeffect "", "~{v[232:239]}" ()
68 call void asm sideeffect "", "~{v[240:247]}" ()
69 call void asm sideeffect "", "~{v[248:255]}" ()
71 store i32 %in, ptr addrspace(1) %out