1 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN,GFX10 %s
2 # RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN %s
4 # GCN-LABEL: name: hazard_lds_branch_buf
6 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
7 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
9 name: hazard_lds_branch_buf
13 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
17 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
21 # GCN-LABEL: name: hazard_buf_branch_lds
23 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
24 # GCN-NEXT: DS_READ_B32
26 name: hazard_buf_branch_lds
30 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
34 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
38 # GCN-LABEL: name: no_hazard_lds_branch_lds
40 # GCN-NEXT: DS_READ_B32
42 name: no_hazard_lds_branch_lds
46 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
50 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
54 # GCN-LABEL: name: no_hazard_buf_branch_buf
56 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
58 name: no_hazard_buf_branch_buf
62 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
66 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
70 # GCN-LABEL: name: no_hazard_lds_branch_buf_fallthrough
72 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
74 name: no_hazard_lds_branch_buf_fallthrough
78 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
81 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
85 # GCN-LABEL: name: no_hazard_lds_branch_buf_samebb
87 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
89 name: no_hazard_lds_branch_buf_samebb
92 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
93 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
97 # GCN-LABEL: name: hazard_lds_branch_buf_loop
98 # GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
100 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
102 name: hazard_lds_branch_buf_loop
106 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
107 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
111 # GCN-LABEL: name: single_hazard_lds_branch_buf
113 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
114 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
115 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
117 name: single_hazard_lds_branch_buf
121 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
125 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
126 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
130 # GCN-LABEL: name: no_hazard_lds_branch_lds_buf
132 # GCN-NEXT: DS_READ_B32
133 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
135 name: no_hazard_lds_branch_lds_buf
139 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
143 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
144 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
148 # GCN-LABEL: name: no_hazard_lds_buf_branch_buf
150 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
152 name: no_hazard_lds_buf_branch_buf
156 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
157 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
161 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
165 # GCN-LABEL: name: hazard_lds_branch_vscnt_1_buf
167 # GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 1
168 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
169 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
171 name: hazard_lds_branch_vscnt_1_buf
175 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
179 S_WAITCNT_VSCNT undef $sgpr_null, 1
180 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
184 # GCN-LABEL: name: no_hazard_lds_branch_vscnt_0_buf
186 # GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
187 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
189 name: no_hazard_lds_branch_vscnt_0_buf
193 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
197 S_WAITCNT_VSCNT undef $sgpr_null, 0
198 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
202 # GCN-LABEL: name: hazard_lds_branch_vscnt_s0_buf
204 # GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr0, 0
205 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
206 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
208 name: hazard_lds_branch_vscnt_s0_buf
212 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
216 S_WAITCNT_VSCNT undef $sgpr0, 0
217 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
221 # GCN-LABEL: name: no_hazard_lds_vscnt_0_branch_buf
223 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
225 name: no_hazard_lds_vscnt_0_branch_buf
229 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
230 S_WAITCNT_VSCNT undef $sgpr_null, 0
234 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 0, 0, 0, implicit $exec
238 # GCN-LABEL: name: hazard_lds_branch_global
240 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
241 # GCN-NEXT: GLOBAL_LOAD_DWORD
243 name: hazard_lds_branch_global
247 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
251 $vgpr1 = GLOBAL_LOAD_DWORD undef $vgpr0_vgpr1, 0, 0, implicit $exec
255 # GCN-LABEL: name: hazard_lds_branch_scratch
257 # GFX10-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
258 # GCN-NEXT: SCRATCH_LOAD_DWORD
260 name: hazard_lds_branch_scratch
264 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
268 $vgpr1 = SCRATCH_LOAD_DWORD undef $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
272 # GCN-LABEL: name: no_hazard_lds_branch_flat
274 # GCN-NEXT: FLAT_LOAD_DWORD
276 name: no_hazard_lds_branch_flat
280 $vgpr1 = DS_READ_B32 undef $vgpr0, 0, 0, implicit $m0, implicit $exec
284 $vgpr1 = FLAT_LOAD_DWORD undef $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr