1 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: hazard_lds_branch_buf
4 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
5 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
7 name: hazard_lds_branch_buf
11 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
15 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
19 # GCN-LABEL: name: hazard_buf_branch_lds
20 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
21 # GCN-NEXT: DS_READ_B32
23 name: hazard_buf_branch_lds
27 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
31 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
35 # GCN-LABEL: name: no_hazard_lds_branch_lds
37 # GCN-NEXT: DS_READ_B32
39 name: no_hazard_lds_branch_lds
43 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
47 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
51 # GCN-LABEL: name: no_hazard_buf_branch_buf
53 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
55 name: no_hazard_buf_branch_buf
59 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
63 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
67 # GCN-LABEL: name: no_hazard_lds_branch_buf_fallthrough
69 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
71 name: no_hazard_lds_branch_buf_fallthrough
75 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
78 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
82 # GCN-LABEL: name: no_hazard_lds_branch_buf_samebb
84 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
86 name: no_hazard_lds_branch_buf_samebb
89 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
90 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
94 # GCN-LABEL: name: hazard_lds_branch_buf_loop
95 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
96 # GCN-NEXT: DS_READ_B32
97 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
99 name: hazard_lds_branch_buf_loop
103 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
104 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
108 # GCN-LABEL: name: single_hazard_lds_branch_buf
109 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
110 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
111 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
113 name: single_hazard_lds_branch_buf
117 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
121 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
122 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
126 # GCN-LABEL: name: no_hazard_lds_branch_lds_buf
128 # GCN-NEXT: DS_READ_B32
129 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
131 name: no_hazard_lds_branch_lds_buf
135 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
139 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
140 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
144 # GCN-LABEL: name: no_hazard_lds_buf_branch_buf
146 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
148 name: no_hazard_lds_buf_branch_buf
152 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
153 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
157 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
161 # GCN-LABEL: name: hazard_lds_branch_vscnt_1_buf
162 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
163 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
165 name: hazard_lds_branch_vscnt_1_buf
169 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
173 S_WAITCNT_VSCNT undef $sgpr_null, 1
174 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
178 # GCN-LABEL: name: no_hazard_lds_branch_vscnt_0_buf
180 # GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
181 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
183 name: no_hazard_lds_branch_vscnt_0_buf
187 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
191 S_WAITCNT_VSCNT undef $sgpr_null, 0
192 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
196 # GCN-LABEL: name: hazard_lds_branch_vscnt_s0_buf
197 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
198 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
200 name: hazard_lds_branch_vscnt_s0_buf
204 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
208 S_WAITCNT_VSCNT undef $sgpr0, 0
209 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
213 # GCN-LABEL: name: no_hazard_lds_vscnt_0_branch_buf
215 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
217 name: no_hazard_lds_vscnt_0_branch_buf
221 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
222 S_WAITCNT_VSCNT undef $sgpr_null, 0
226 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
230 # GCN-LABEL: name: hazard_lds_branch_global
231 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
232 # GCN-NEXT: GLOBAL_LOAD_DWORD
234 name: hazard_lds_branch_global
238 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
242 $vgpr1 = GLOBAL_LOAD_DWORD undef $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec
246 # GCN-LABEL: name: hazard_lds_branch_scratch
247 # GCN: S_WAITCNT_VSCNT undef $sgpr_null, 0
248 # GCN-NEXT: SCRATCH_LOAD_DWORD
250 name: hazard_lds_branch_scratch
254 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
258 $vgpr1 = SCRATCH_LOAD_DWORD undef $vgpr0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
262 # GCN-LABEL: name: no_hazard_lds_branch_flat
264 # GCN-NEXT: FLAT_LOAD_DWORD
266 name: no_hazard_lds_branch_flat
270 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
274 $vgpr1 = FLAT_LOAD_DWORD undef $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr