1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefix=GCN %s
5 name: trans_use_1_hazard
8 ; GCN-LABEL: name: trans_use_1_hazard
9 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
10 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
11 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
12 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
13 ; GCN-NEXT: S_ENDPGM 0
14 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
15 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
16 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
21 name: trans_use_1_no_hazard_1
24 ; GCN-LABEL: name: trans_use_1_no_hazard_1
25 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
26 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
27 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
28 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
29 ; GCN-NEXT: S_ENDPGM 0
30 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
32 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
33 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
38 name: trans_use_2_hazard
41 ; GCN-LABEL: name: trans_use_2_hazard
42 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
43 ; GCN-NEXT: $sgpr0 = S_MOV_B32 0
44 ; GCN-NEXT: $sgpr1 = S_MOV_B32 0
45 ; GCN-NEXT: $sgpr2 = S_MOV_B32 0
46 ; GCN-NEXT: $sgpr3 = S_MOV_B32 0
47 ; GCN-NEXT: $sgpr4 = S_MOV_B32 0
48 ; GCN-NEXT: $sgpr5 = S_MOV_B32 0
49 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
50 ; GCN-NEXT: $sgpr6 = S_MOV_B32 0
51 ; GCN-NEXT: $sgpr7 = S_MOV_B32 0
52 ; GCN-NEXT: $sgpr8 = S_MOV_B32 0
53 ; GCN-NEXT: $sgpr9 = S_MOV_B32 0
54 ; GCN-NEXT: $sgpr10 = S_MOV_B32 0
55 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
56 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
57 ; GCN-NEXT: S_ENDPGM 0
58 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
65 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
71 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
76 name: trans_use_3_hazard
79 ; GCN-LABEL: name: trans_use_3_hazard
80 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
81 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
82 ; GCN-NEXT: $vgpr10 = V_MOV_B32_e32 0, implicit $exec
83 ; GCN-NEXT: $vgpr11 = V_MOV_B32_e32 0, implicit $exec
84 ; GCN-NEXT: $vgpr12 = V_MOV_B32_e32 0, implicit $exec
85 ; GCN-NEXT: $vgpr13 = V_MOV_B32_e32 0, implicit $exec
86 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
87 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
88 ; GCN-NEXT: S_ENDPGM 0
89 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
90 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
91 $vgpr10 = V_MOV_B32_e32 0, implicit $exec
92 $vgpr11 = V_MOV_B32_e32 0, implicit $exec
93 $vgpr12 = V_MOV_B32_e32 0, implicit $exec
94 $vgpr13 = V_MOV_B32_e32 0, implicit $exec
95 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
100 name: trans_use_3_no_hazard_1
103 ; GCN-LABEL: name: trans_use_3_no_hazard_1
104 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
105 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
106 ; GCN-NEXT: $vgpr10 = V_MOV_B32_e32 0, implicit $exec
107 ; GCN-NEXT: $vgpr11 = V_MOV_B32_e32 0, implicit $exec
108 ; GCN-NEXT: $vgpr12 = V_MOV_B32_e32 0, implicit $exec
109 ; GCN-NEXT: $vgpr13 = V_MOV_B32_e32 0, implicit $exec
110 ; GCN-NEXT: $vgpr14 = V_MOV_B32_e32 0, implicit $exec
111 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
112 ; GCN-NEXT: S_ENDPGM 0
113 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
114 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
115 $vgpr10 = V_MOV_B32_e32 0, implicit $exec
116 $vgpr11 = V_MOV_B32_e32 0, implicit $exec
117 $vgpr12 = V_MOV_B32_e32 0, implicit $exec
118 $vgpr13 = V_MOV_B32_e32 0, implicit $exec
119 $vgpr14 = V_MOV_B32_e32 0, implicit $exec
120 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
125 name: trans_use_3_no_hazard_2
128 ; GCN-LABEL: name: trans_use_3_no_hazard_2
129 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
130 ; GCN-NEXT: $vgpr10 = V_MOV_B32_e32 0, implicit $exec
131 ; GCN-NEXT: $vgpr11 = V_MOV_B32_e32 0, implicit $exec
132 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
133 ; GCN-NEXT: $vgpr12 = V_MOV_B32_e32 0, implicit $exec
134 ; GCN-NEXT: $vgpr13 = V_MOV_B32_e32 0, implicit $exec
135 ; GCN-NEXT: $vgpr14 = V_MOV_B32_e32 0, implicit $exec
136 ; GCN-NEXT: $vgpr15 = V_MOV_B32_e32 0, implicit $exec
137 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
138 ; GCN-NEXT: S_ENDPGM 0
139 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
140 $vgpr10 = V_MOV_B32_e32 0, implicit $exec
141 $vgpr11 = V_MOV_B32_e32 0, implicit $exec
142 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
143 $vgpr12 = V_MOV_B32_e32 0, implicit $exec
144 $vgpr13 = V_MOV_B32_e32 0, implicit $exec
145 $vgpr14 = V_MOV_B32_e32 0, implicit $exec
146 $vgpr15 = V_MOV_B32_e32 0, implicit $exec
147 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
152 name: trans_use_3_no_hazard_3
155 ; GCN-LABEL: name: trans_use_3_no_hazard_3
156 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
157 ; GCN-NEXT: $vgpr10 = V_SQRT_F32_e32 $vgpr11, implicit $mode, implicit $exec
158 ; GCN-NEXT: $vgpr12 = V_SQRT_F32_e32 $vgpr13, implicit $mode, implicit $exec
159 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
160 ; GCN-NEXT: S_ENDPGM 0
161 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
162 $vgpr10 = V_SQRT_F32_e32 $vgpr11, implicit $mode, implicit $exec
163 $vgpr12 = V_SQRT_F32_e32 $vgpr13, implicit $mode, implicit $exec
164 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
169 name: trans_use_4_one_depctr_1
172 ; GCN-LABEL: name: trans_use_4_one_depctr_1
173 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
174 ; GCN-NEXT: $vgpr3 = V_SQRT_F32_e32 $vgpr2, implicit $mode, implicit $exec
175 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
176 ; GCN-NEXT: $vgpr5 = V_ADD_F32_e32 $vgpr1, $vgpr4, implicit $mode, implicit $exec
177 ; GCN-NEXT: $vgpr7 = V_ADD_F32_e32 $vgpr3, $vgpr6, implicit $mode, implicit $exec
178 ; GCN-NEXT: S_ENDPGM 0
179 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
180 $vgpr3 = V_SQRT_F32_e32 $vgpr2, implicit $mode, implicit $exec
181 $vgpr5 = V_ADD_F32_e32 $vgpr1, $vgpr4, implicit $mode, implicit $exec
182 $vgpr7 = V_ADD_F32_e32 $vgpr3, $vgpr6, implicit $mode, implicit $exec
187 name: trans_use_4_one_depctr_2
190 ; GCN-LABEL: name: trans_use_4_one_depctr_2
191 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
192 ; GCN-NEXT: $vgpr3 = V_SQRT_F32_e32 $vgpr2, implicit $mode, implicit $exec
193 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
194 ; GCN-NEXT: $vgpr5 = V_ADD_F32_e32 $vgpr3, $vgpr4, implicit $mode, implicit $exec
195 ; GCN-NEXT: $vgpr7 = V_ADD_F32_e32 $vgpr1, $vgpr6, implicit $mode, implicit $exec
196 ; GCN-NEXT: S_ENDPGM 0
197 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
198 $vgpr3 = V_SQRT_F32_e32 $vgpr2, implicit $mode, implicit $exec
199 $vgpr5 = V_ADD_F32_e32 $vgpr3, $vgpr4, implicit $mode, implicit $exec
200 $vgpr7 = V_ADD_F32_e32 $vgpr1, $vgpr6, implicit $mode, implicit $exec
208 ; GCN-LABEL: name: trans_use_4
209 ; GCN: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
210 ; GCN-NEXT: $vgpr10 = V_SQRT_F32_e32 $vgpr11, implicit $mode, implicit $exec
211 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
212 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
213 ; GCN-NEXT: $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
214 ; GCN-NEXT: S_ENDPGM 0
215 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
216 $vgpr10 = V_SQRT_F32_e32 $vgpr11, implicit $mode, implicit $exec
217 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
218 $vgpr3 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
223 name: trans_use_branching_1a
225 ; GCN-LABEL: name: trans_use_branching_1a
227 ; GCN-NEXT: successors: %bb.2(0x80000000)
229 ; GCN-NEXT: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
230 ; GCN-NEXT: S_BRANCH %bb.2
233 ; GCN-NEXT: successors: %bb.2(0x80000000)
235 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
236 ; GCN-NEXT: $vgpr30 = V_MOV_B32_e32 0, implicit $exec
237 ; GCN-NEXT: $vgpr31 = V_MOV_B32_e32 0, implicit $exec
238 ; GCN-NEXT: $vgpr32 = V_MOV_B32_e32 0, implicit $exec
239 ; GCN-NEXT: $vgpr33 = V_MOV_B32_e32 0, implicit $exec
240 ; GCN-NEXT: S_BRANCH %bb.2
243 ; GCN-NEXT: $vgpr3 = V_MOV_B32_e32 0, implicit $exec
244 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
245 ; GCN-NEXT: $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
246 ; GCN-NEXT: S_ENDPGM 0
248 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
251 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
252 $vgpr30 = V_MOV_B32_e32 0, implicit $exec
253 $vgpr31 = V_MOV_B32_e32 0, implicit $exec
254 $vgpr32 = V_MOV_B32_e32 0, implicit $exec
255 $vgpr33 = V_MOV_B32_e32 0, implicit $exec
258 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
259 $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
264 name: trans_use_branching_1b
266 ; GCN-LABEL: name: trans_use_branching_1b
268 ; GCN-NEXT: successors: %bb.2(0x80000000)
270 ; GCN-NEXT: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
271 ; GCN-NEXT: S_BRANCH %bb.2
274 ; GCN-NEXT: successors: %bb.2(0x80000000)
276 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
277 ; GCN-NEXT: $vgpr30 = V_MOV_B32_e32 0, implicit $exec
278 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
279 ; GCN-NEXT: S_BRANCH %bb.2
282 ; GCN-NEXT: $vgpr3 = V_MOV_B32_e32 0, implicit $exec
283 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
284 ; GCN-NEXT: $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
285 ; GCN-NEXT: S_ENDPGM 0
287 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
290 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
291 $vgpr30 = V_MOV_B32_e32 0, implicit $exec
292 S_WAITCNT_DEPCTR 4095
295 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
296 $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
301 name: trans_use_branching_1c_no_hazard_1
303 ; GCN-LABEL: name: trans_use_branching_1c_no_hazard_1
305 ; GCN-NEXT: successors: %bb.2(0x80000000)
307 ; GCN-NEXT: $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
308 ; GCN-NEXT: S_WAITCNT_DEPCTR 4095
309 ; GCN-NEXT: S_BRANCH %bb.2
312 ; GCN-NEXT: successors: %bb.2(0x80000000)
314 ; GCN-NEXT: $vgpr2 = V_MOV_B32_e32 0, implicit $exec
315 ; GCN-NEXT: $vgpr30 = V_MOV_B32_e32 0, implicit $exec
316 ; GCN-NEXT: S_BRANCH %bb.2
319 ; GCN-NEXT: $vgpr3 = V_MOV_B32_e32 0, implicit $exec
320 ; GCN-NEXT: $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
321 ; GCN-NEXT: S_ENDPGM 0
323 $vgpr1 = V_SQRT_F32_e32 $vgpr0, implicit $mode, implicit $exec
324 S_WAITCNT_DEPCTR 4095
327 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
328 $vgpr30 = V_MOV_B32_e32 0, implicit $exec
331 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
332 $vgpr4 = V_ADD_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec