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[[OFF:[0-9]+]], s3
7 ; ALL: s_mov_b32 s[[HI:[0-9]+]], 0xe80000
9 ; Make sure we are handling hazards correctly.
10 ; SGPR: buffer_load_dword [[VHI:v[0-9]+]], off, s[{{[0-9]+:[0-9]+}}], s{{[0-9]+}} offset:16
11 ; SGPR-NEXT: s_waitcnt vmcnt(0)
12 ; SGPR-NEXT: v_readfirstlane_b32 s[[HI:[0-9]+]], [[VHI]]
14 ; SGPR-NEXT: buffer_store_dword v0, off, s[0:[[HI]]{{\]}}, 0
17 define amdgpu_kernel void @test(i32 addrspace(1)* %out, i32 %in) {
18 call void asm sideeffect "", "~{s[0:7]}" ()
19 call void asm sideeffect "", "~{s[8:15]}" ()
20 call void asm sideeffect "", "~{s[16:23]}" ()
21 call void asm sideeffect "", "~{s[24:31]}" ()
22 call void asm sideeffect "", "~{s[32:39]}" ()
23 call void asm sideeffect "", "~{s[40:47]}" ()
24 call void asm sideeffect "", "~{s[48:55]}" ()
25 call void asm sideeffect "", "~{s[56:63]}" ()
26 call void asm sideeffect "", "~{s[64:71]}" ()
27 call void asm sideeffect "", "~{s[72:79]}" ()
28 call void asm sideeffect "", "~{s[80:87]}" ()
29 call void asm sideeffect "", "~{s[88:95]}" ()
30 call void asm sideeffect "", "~{v[0:7]}" ()
31 call void asm sideeffect "", "~{v[8:15]}" ()
32 call void asm sideeffect "", "~{v[16:23]}" ()
33 call void asm sideeffect "", "~{v[24:31]}" ()
34 call void asm sideeffect "", "~{v[32:39]}" ()
35 call void asm sideeffect "", "~{v[40:47]}" ()
36 call void asm sideeffect "", "~{v[48:55]}" ()
37 call void asm sideeffect "", "~{v[56:63]}" ()
38 call void asm sideeffect "", "~{v[64:71]}" ()
39 call void asm sideeffect "", "~{v[72:79]}" ()
40 call void asm sideeffect "", "~{v[80:87]}" ()
41 call void asm sideeffect "", "~{v[88:95]}" ()
42 call void asm sideeffect "", "~{v[96:103]}" ()
43 call void asm sideeffect "", "~{v[104:111]}" ()
44 call void asm sideeffect "", "~{v[112:119]}" ()
45 call void asm sideeffect "", "~{v[120:127]}" ()
46 call void asm sideeffect "", "~{v[128:135]}" ()
47 call void asm sideeffect "", "~{v[136:143]}" ()
48 call void asm sideeffect "", "~{v[144:151]}" ()
49 call void asm sideeffect "", "~{v[152:159]}" ()
50 call void asm sideeffect "", "~{v[160:167]}" ()
51 call void asm sideeffect "", "~{v[168:175]}" ()
52 call void asm sideeffect "", "~{v[176:183]}" ()
53 call void asm sideeffect "", "~{v[184:191]}" ()
54 call void asm sideeffect "", "~{v[192:199]}" ()
55 call void asm sideeffect "", "~{v[200:207]}" ()
56 call void asm sideeffect "", "~{v[208:215]}" ()
57 call void asm sideeffect "", "~{v[216:223]}" ()
58 call void asm sideeffect "", "~{v[224:231]}" ()
59 call void asm sideeffect "", "~{v[232:239]}" ()
60 call void asm sideeffect "", "~{v[240:247]}" ()
61 call void asm sideeffect "", "~{v[248:255]}" ()
63 store i32 %in, i32 addrspace(1)* %out