1 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=gcn-dpp-combine -verify-machineinstrs -o - %s | FileCheck %s -check-prefix=GCN
4 # old is undefined: only combine when masks are fully enabled and
5 # bound_ctrl:1 is set, otherwise the result of DPP VALU op can be undefined.
6 # GCN-LABEL: name: old_is_undef
7 # GCN: %2:vgpr_32 = IMPLICIT_DEF
9 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %2, %0, %1, 1, 15, 15, 1, implicit $exec
10 # GCN: %6:vgpr_32 = V_ADD_U32_e32 %5, %1, implicit $exec
11 # GCN: %8:vgpr_32 = V_ADD_U32_e32 %7, %1, implicit $exec
12 # GCN: %10:vgpr_32 = V_ADD_U32_e32 %9, %1, implicit $exec
14 # GCN: %12:vgpr_32 = V_NOT_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
15 # GCN: %14:vgpr_32 = V_NOT_B32_e32 %13, implicit $exec
16 # GCN: %16:vgpr_32 = V_NOT_B32_e32 %15, implicit $exec
17 # GCN: %18:vgpr_32 = V_NOT_B32_e32 %17, implicit $exec
19 tracksRegLiveness: true
22 liveins: $vgpr0, $vgpr1
23 %0:vgpr_32 = COPY $vgpr0
24 %1:vgpr_32 = COPY $vgpr1
25 %2:vgpr_32 = IMPLICIT_DEF
28 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
29 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
31 %5:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 0, implicit $exec
32 %6:vgpr_32 = V_ADD_U32_e32 %5, %1, implicit $exec
34 %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 1, implicit $exec
35 %8:vgpr_32 = V_ADD_U32_e32 %7, %1, implicit $exec
37 %9:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
38 %10:vgpr_32 = V_ADD_U32_e32 %9, %1, implicit $exec
41 %11:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
42 %12:vgpr_32 = V_NOT_B32_e32 %11, implicit $exec
44 %13:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 0, implicit $exec
45 %14:vgpr_32 = V_NOT_B32_e32 %13, implicit $exec
47 %15:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 1, implicit $exec
48 %16:vgpr_32 = V_NOT_B32_e32 %15, implicit $exec
50 %17:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
51 %18:vgpr_32 = V_NOT_B32_e32 %17, implicit $exec
56 # GCN-LABEL: name: old_is_0
59 # case 1: old is zero, masks are fully enabled, bound_ctrl:1 is on:
60 # the DPP mov result would be either zero ({src lane disabled}|{src lane is
61 # out of range}) or active src lane result - can combine with old = undef.
62 # undef is preffered as it makes life easier for the regalloc.
63 # GCN: [[U1:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
64 # GCN: %4:vgpr_32 = V_ADD_U32_dpp [[U1]], %0, %1, 1, 15, 15, 1, implicit $exec
66 # case 2: old is zero, masks are fully enabled, bound_ctrl:1 is off:
67 # as the DPP mov old is zero this case is no different from case 1 - combine it
68 # setting bound_ctrl:1 on for the combined DPP VALU op to make old undefined
69 # GCN: [[U2:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
70 # GCN: %6:vgpr_32 = V_ADD_U32_dpp [[U2]], %0, %1, 1, 15, 15, 1, implicit $exec
72 # case 3: masks are partialy disabled, bound_ctrl:1 is on:
73 # the DPP mov result would be either zero ({src lane disabled}|{src lane is
74 # out of range} or {the DPP mov's dest VGPR write is disabled by masks}) or
75 # active src lane result - can combine with old = src1 of the VALU op.
76 # The VALU op should have the same masks as DPP mov as they select lanes
77 # with identity value.
78 # Special case: the bound_ctrl for the combined DPP VALU op isn't important
79 # here but let's make it off to keep the combiner's logic simpler.
80 # GCN: %8:vgpr_32 = V_ADD_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
82 # case 4: masks are partialy disabled, bound_ctrl:1 is off:
83 # the DPP mov result would be either zero ({src lane disabled}|{src lane is
84 # out of range} or {the DPP mov's dest VGPR write is disabled by masks}) or
85 # active src lane result - can combine with old = src1 of the VALU op.
86 # The VALU op should have the same masks as DPP mov as they select
87 # lanes with identity value
88 # GCN: %10:vgpr_32 = V_ADD_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
92 # GCN: [[U3:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
93 # GCN: %12:vgpr_32 = V_NOT_B32_dpp [[U3]], %0, 1, 15, 15, 1, implicit $exec
95 # GCN: [[U4:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
96 # GCN: %14:vgpr_32 = V_NOT_B32_dpp [[U4]], %0, 1, 15, 15, 1, implicit $exec
97 # case 3 and 4 not appliable as there is no way to specify unchanged result
98 # for the unary VALU op
99 # GCN: %16:vgpr_32 = V_NOT_B32_e32 %15, implicit $exec
100 # GCN: %18:vgpr_32 = V_NOT_B32_e32 %17, implicit $exec
103 tracksRegLiveness: true
106 liveins: $vgpr0, $vgpr1
107 %0:vgpr_32 = COPY $vgpr0
108 %1:vgpr_32 = COPY $vgpr1
109 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
112 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
113 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
115 %5:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 0, implicit $exec
116 %6:vgpr_32 = V_ADD_U32_e32 %5, %1, implicit $exec
118 %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 1, implicit $exec
119 %8:vgpr_32 = V_ADD_U32_e32 %7, %1, implicit $exec
121 %9:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
122 %10:vgpr_32 = V_ADD_U32_e32 %9, %1, implicit $exec
125 %11:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
126 %12:vgpr_32 = V_NOT_B32_e32 %11, implicit $exec
128 %13:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 0, implicit $exec
129 %14:vgpr_32 = V_NOT_B32_e32 %13, implicit $exec
131 %15:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 1, implicit $exec
132 %16:vgpr_32 = V_NOT_B32_e32 %15, implicit $exec
134 %17:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
135 %18:vgpr_32 = V_NOT_B32_e32 %17, implicit $exec
138 # old is nonzero identity cases:
140 # old is nonzero identity, masks are fully enabled, bound_ctrl:1 is off:
141 # the DPP mov result would be either identity ({src lane disabled}|{out of
142 # range}) or src lane result - can combine with old = src1 of the VALU op
143 # The DPP VALU op should have the same masks (and bctrl) as DPP mov as they
144 # select lanes with identity value
146 # GCN-LABEL: name: nonzero_old_is_identity_masks_enabled_bctl_off
147 # GCN: %4:vgpr_32 = V_MUL_U32_U24_dpp %1, %0, %1, 1, 15, 15, 0, implicit $exec
148 # GCN: %7:vgpr_32 = V_AND_B32_dpp %1, %0, %1, 1, 15, 15, 0, implicit $exec
149 # GCN: %10:vgpr_32 = V_MAX_I32_dpp %1, %0, %1, 1, 15, 15, 0, implicit $exec
150 # GCN: %13:vgpr_32 = V_MIN_I32_dpp %1, %0, %1, 1, 15, 15, 0, implicit $exec
152 name: nonzero_old_is_identity_masks_enabled_bctl_off
153 tracksRegLiveness: true
156 liveins: $vgpr0, $vgpr1
157 %0:vgpr_32 = COPY $vgpr0
158 %1:vgpr_32 = COPY $vgpr1
160 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
161 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 0, implicit $exec
162 %4:vgpr_32 = V_MUL_U32_U24_e32 %3, %1, implicit $exec
164 %5:vgpr_32 = V_MOV_B32_e32 4294967295, implicit $exec
165 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 15, 0, implicit $exec
166 %7:vgpr_32 = V_AND_B32_e32 %6, %1, implicit $exec
168 %8:vgpr_32 = V_MOV_B32_e32 -2147483648, implicit $exec
169 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 15, 15, 0, implicit $exec
170 %10:vgpr_32 = V_MAX_I32_e32 %9, %1, implicit $exec
172 %11:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
173 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 15, 15, 0, implicit $exec
174 %13:vgpr_32 = V_MIN_I32_e32 %12, %1, implicit $exec
177 # old is nonzero identity, masks are partially enabled, bound_ctrl:1 is off:
178 # the DPP mov result would be either identity ({src lane disabled}|{src lane is
179 # out of range} or {the DPP mov's dest VGPR write is disabled by masks}) or
180 # active src lane result - can combine with old = src1 of the VALU op.
181 # The DPP VALU op should have the same masks (and bctrl) as DPP mov as they
182 # select lanes with identity value
184 # GCN-LABEL: name: nonzero_old_is_identity_masks_partially_disabled_bctl_off
185 # GCN: %4:vgpr_32 = V_MUL_U32_U24_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
186 # GCN: %7:vgpr_32 = V_AND_B32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
187 # GCN: %10:vgpr_32 = V_MAX_I32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
188 # GCN: %13:vgpr_32 = V_MIN_I32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
190 name: nonzero_old_is_identity_masks_partially_disabled_bctl_off
191 tracksRegLiveness: true
194 liveins: $vgpr0, $vgpr1
195 %0:vgpr_32 = COPY $vgpr0
196 %1:vgpr_32 = COPY $vgpr1
198 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
199 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
200 %4:vgpr_32 = V_MUL_U32_U24_e32 %3, %1, implicit $exec
202 %5:vgpr_32 = V_MOV_B32_e32 4294967295, implicit $exec
203 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 14, 0, implicit $exec
204 %7:vgpr_32 = V_AND_B32_e32 %6, %1, implicit $exec
206 %8:vgpr_32 = V_MOV_B32_e32 -2147483648, implicit $exec
207 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 14, 15, 0, implicit $exec
208 %10:vgpr_32 = V_MAX_I32_e32 %9, %1, implicit $exec
210 %11:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
211 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 15, 14, 0, implicit $exec
212 %13:vgpr_32 = V_MIN_I32_e32 %12, %1, implicit $exec
215 # old is nonzero identity, masks are partially enabled, bound_ctrl:1 is on:
216 # the DPP mov result may have 3 different values:
217 # 1. the active src lane result
218 # 2. 0 if the src lane is disabled|out of range
219 # 3. DPP mov's old value if the mov's dest VGPR write is disabled by masks
222 # GCN-LABEL: name: nonzero_old_is_identity_masks_partially_disabled_bctl0
223 # GCN: %4:vgpr_32 = V_MUL_U32_U24_e32 %3, %1, implicit $exec
224 # GCN: %7:vgpr_32 = V_AND_B32_e32 %6, %1, implicit $exec
225 # GCN: %10:vgpr_32 = V_MAX_I32_e32 %9, %1, implicit $exec
226 # GCN: %13:vgpr_32 = V_MIN_I32_e32 %12, %1, implicit $exec
228 name: nonzero_old_is_identity_masks_partially_disabled_bctl0
229 tracksRegLiveness: true
232 liveins: $vgpr0, $vgpr1
233 %0:vgpr_32 = COPY $vgpr0
234 %1:vgpr_32 = COPY $vgpr1
236 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
237 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 1, implicit $exec
238 %4:vgpr_32 = V_MUL_U32_U24_e32 %3, %1, implicit $exec
240 %5:vgpr_32 = V_MOV_B32_e32 4294967295, implicit $exec
241 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 14, 1, implicit $exec
242 %7:vgpr_32 = V_AND_B32_e32 %6, %1, implicit $exec
244 %8:vgpr_32 = V_MOV_B32_e32 -2147483648, implicit $exec
245 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 14, 15, 1, implicit $exec
246 %10:vgpr_32 = V_MAX_I32_e32 %9, %1, implicit $exec
248 %11:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
249 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 15, 14, 1, implicit $exec
250 %13:vgpr_32 = V_MIN_I32_e32 %12, %1, implicit $exec
253 # when the DPP source isn't a src0 operand the operation should be commuted if possible
254 # GCN-LABEL: name: dpp_commute
255 # GCN: %4:vgpr_32 = V_MUL_U32_U24_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
256 # GCN: %7:vgpr_32 = V_AND_B32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
257 # GCN: %10:vgpr_32 = V_MAX_I32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
258 # GCN: %13:vgpr_32 = V_MIN_I32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
259 # GCN: %16:vgpr_32 = V_SUBREV_CO_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit-def $vcc, implicit $exec
260 # GCN: %19:vgpr_32 = V_ADD_CO_U32_e32 5, %18, implicit-def $vcc, implicit $exec
262 tracksRegLiveness: true
265 liveins: $vgpr0, $vgpr1
267 %0:vgpr_32 = COPY $vgpr0
268 %1:vgpr_32 = COPY $vgpr1
270 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
271 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
272 %4:vgpr_32 = V_MUL_U32_U24_e32 %1, %3, implicit $exec
274 %5:vgpr_32 = V_MOV_B32_e32 4294967295, implicit $exec
275 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 14, 0, implicit $exec
276 %7:vgpr_32 = V_AND_B32_e32 %1, %6, implicit $exec
278 %8:vgpr_32 = V_MOV_B32_e32 -2147483648, implicit $exec
279 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 14, 15, 0, implicit $exec
280 %10:vgpr_32 = V_MAX_I32_e32 %1, %9, implicit $exec
282 %11:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
283 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 15, 14, 0, implicit $exec
284 %13:vgpr_32 = V_MIN_I32_e32 %1, %12, implicit $exec
286 %14:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
287 %15:vgpr_32 = V_MOV_B32_dpp %14, %0, 1, 14, 15, 0, implicit $exec
288 %16:vgpr_32 = V_SUB_CO_U32_e32 %1, %15, implicit-def $vcc, implicit $exec
290 ; this cannot be combined because immediate as src0 isn't commutable
291 %17:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
292 %18:vgpr_32 = V_MOV_B32_dpp %17, %0, 1, 14, 15, 0, implicit $exec
293 %19:vgpr_32 = V_ADD_CO_U32_e32 5, %18, implicit-def $vcc, implicit $exec
298 # check for floating point modifiers
299 # GCN-LABEL: name: add_f32_e64
300 # GCN: %3:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
301 # GCN: %4:vgpr_32 = V_ADD_F32_e64 0, %3, 0, %0, 0, 1, implicit $mode, implicit $exec
302 # GCN: %6:vgpr_32 = V_ADD_F32_dpp %2, 0, %1, 0, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
303 # GCN: %8:vgpr_32 = V_ADD_F32_dpp %2, 1, %1, 2, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
304 # GCN: %10:vgpr_32 = V_ADD_F32_e64 4, %9, 8, %0, 0, 0, implicit $mode, implicit $exec
307 tracksRegLiveness: true
310 liveins: $vgpr0, $vgpr1
312 %0:vgpr_32 = COPY $vgpr0
313 %1:vgpr_32 = COPY $vgpr1
314 %2:vgpr_32 = IMPLICIT_DEF
316 ; this shouldn't be combined as omod is set
317 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
318 %4:vgpr_32 = V_ADD_F32_e64 0, %3, 0, %0, 0, 1, implicit $mode, implicit $exec
320 ; this should be combined as all modifiers are default
321 %5:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
322 %6:vgpr_32 = V_ADD_F32_e64 0, %5, 0, %0, 0, 0, implicit $mode, implicit $exec
324 ; this should be combined as modifiers other than abs|neg are default
325 %7:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
326 %8:vgpr_32 = V_ADD_F32_e64 1, %7, 2, %0, 0, 0, implicit $mode, implicit $exec
328 ; this shouldn't be combined as modifiers aren't abs|neg
329 %9:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
330 %10:vgpr_32 = V_ADD_F32_e64 4, %9, 8, %0, 0, 0, implicit $mode, implicit $exec
333 # check for e64 modifiers
334 # GCN-LABEL: name: add_u32_e64
335 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %2, %0, %1, 1, 15, 15, 1, implicit $exec
336 # GCN: %6:vgpr_32 = V_ADD_U32_e64 %5, %1, 1, implicit $exec
339 tracksRegLiveness: true
342 liveins: $vgpr0, $vgpr1
344 %0:vgpr_32 = COPY $vgpr0
345 %1:vgpr_32 = COPY $vgpr1
346 %2:vgpr_32 = IMPLICIT_DEF
348 ; this should be combined as all modifiers are default
349 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %0, 1, 15, 15, 1, implicit $exec
350 %4:vgpr_32 = V_ADD_U32_e64 %3, %1, 0, implicit $exec
352 ; this shouldn't be combined as clamp is set
353 %5:vgpr_32 = V_MOV_B32_dpp undef %2, %0, 1, 15, 15, 1, implicit $exec
354 %6:vgpr_32 = V_ADD_U32_e64 %5, %1, 1, implicit $exec
357 # GCN-LABEL: name: add_co_u32_e64
358 # GCN: %4:vgpr_32, %5:sreg_64_xexec = V_ADD_CO_U32_e64 %3, %1, 0, implicit $exec
361 tracksRegLiveness: true
364 liveins: $vgpr0, $vgpr1
366 %0:vgpr_32 = COPY $vgpr0
367 %1:vgpr_32 = COPY $vgpr1
368 %2:vgpr_32 = IMPLICIT_DEF
370 ; this shouldn't be combined as the carry-out is used
371 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %0, 1, 15, 15, 1, implicit $exec
372 %4:vgpr_32, %5:sreg_64_xexec = V_ADD_CO_U32_e64 %3, %1, 0, implicit $exec
377 # tests on sequences of dpp consumers
378 # GCN-LABEL: name: dpp_seq
379 # GCN: %4:vgpr_32 = V_ADD_CO_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit-def $vcc, implicit $exec
380 # GCN: %5:vgpr_32 = V_SUBREV_CO_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit-def $vcc, implicit $exec
381 # GCN: %6:vgpr_32 = V_OR_B32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
383 # GCN: %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
386 tracksRegLiveness: true
389 liveins: $vgpr0, $vgpr1
390 %0:vgpr_32 = COPY $vgpr0
391 %1:vgpr_32 = COPY $vgpr1
392 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
394 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
395 %4:vgpr_32 = V_ADD_CO_U32_e32 %3, %1, implicit-def $vcc, implicit $exec
396 %5:vgpr_32 = V_SUB_CO_U32_e32 %1, %3, implicit-def $vcc, implicit $exec
397 %6:vgpr_32 = V_OR_B32_e32 %3, %1, implicit $exec
399 %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
400 %8:vgpr_32 = V_ADD_CO_U32_e32 %7, %1, implicit-def $vcc, implicit $exec
401 ; this breaks the sequence
402 %9:vgpr_32 = V_SUB_CO_U32_e32 5, %7, implicit-def $vcc, implicit $exec
405 # tests on sequences of dpp consumers followed by control flow
406 # GCN-LABEL: name: dpp_seq_cf
407 # GCN: %4:vgpr_32 = V_ADD_CO_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit-def $vcc, implicit $exec
408 # GCN: %5:vgpr_32 = V_SUBREV_CO_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit-def $vcc, implicit $exec
409 # GCN: %6:vgpr_32 = V_OR_B32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
412 tracksRegLiveness: true
415 successors: %bb.1, %bb.2
416 liveins: $vgpr0, $vgpr1
417 %0:vgpr_32 = COPY $vgpr0
418 %1:vgpr_32 = COPY $vgpr1
419 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
421 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
422 %4:vgpr_32 = V_ADD_CO_U32_e32 %3, %1, implicit-def $vcc, implicit $exec
423 %5:vgpr_32 = V_SUB_CO_U32_e32 %1, %3, implicit-def $vcc, implicit $exec
424 %6:vgpr_32 = V_OR_B32_e32 %3, %1, implicit $exec
426 %7:sreg_64 = V_CMP_EQ_U32_e64 %5, %6, implicit $exec
427 %8:sreg_64 = SI_IF %7, %bb.2, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
434 SI_END_CF %8, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
437 # old reg def is in diff BB - cannot combine
438 # GCN-LABEL: name: old_in_diff_bb
439 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %2, %1, 1, 1, 1, 0, implicit $exec
442 tracksRegLiveness: true
446 liveins: $vgpr0, $vgpr1
448 %0:vgpr_32 = COPY $vgpr0
449 %1:vgpr_32 = COPY $vgpr1
450 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
454 %3:vgpr_32 = V_MOV_B32_dpp %2, %1, 1, 1, 1, 0, implicit $exec
455 %4:vgpr_32 = V_ADD_U32_e32 %3, %0, implicit $exec
458 # old reg def is in diff BB but bound_ctrl:1 - can combine
459 # GCN-LABEL: name: old_in_diff_bb_bctrl_zero
460 # GCN: %4:vgpr_32 = V_ADD_U32_dpp {{%[0-9]}}, %0, %1, 1, 15, 15, 1, implicit $exec
462 name: old_in_diff_bb_bctrl_zero
463 tracksRegLiveness: true
467 liveins: $vgpr0, $vgpr1
469 %0:vgpr_32 = COPY $vgpr0
470 %1:vgpr_32 = COPY $vgpr1
471 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
475 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
476 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
479 # EXEC mask changed between def and use - cannot combine
480 # GCN-LABEL: name: exec_changed
481 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
484 tracksRegLiveness: true
487 liveins: $vgpr0, $vgpr1
489 %0:vgpr_32 = COPY $vgpr0
490 %1:vgpr_32 = COPY $vgpr1
491 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
492 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
493 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
494 %5:sreg_64 = COPY $exec, implicit-def $exec
495 %6:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
498 # test if $old definition is correctly tracked through subreg manipulation pseudos
500 # GCN-LABEL: name: mul_old_subreg
501 # GCN: %7:vgpr_32 = V_MUL_I32_I24_dpp %0.sub1, %1, %0.sub1, 1, 1, 1, 0, implicit $exec
504 tracksRegLiveness: true
507 liveins: $vgpr0, $vgpr1
509 %0:vreg_64 = COPY $vgpr0
510 %1:vgpr_32 = COPY $vgpr1
511 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
512 %3:vgpr_32 = V_MOV_B32_e32 42, implicit $exec
513 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
514 %5:vreg_64 = INSERT_SUBREG %4, %1, %subreg.sub1 ; %5.sub0 is taken from %4
515 %6:vgpr_32 = V_MOV_B32_dpp %5.sub0, %1, 1, 1, 1, 0, implicit $exec
516 %7:vgpr_32 = V_MUL_I32_I24_e32 %6, %0.sub1, implicit $exec
519 # GCN-LABEL: name: add_old_subreg
520 # GCN: %5:vgpr_32 = V_ADD_U32_dpp %0.sub1, %1, %0.sub1, 1, 1, 1, 0, implicit $exec
523 tracksRegLiveness: true
526 liveins: $vgpr0, $vgpr1
528 %0:vreg_64 = COPY $vgpr0
529 %1:vgpr_32 = COPY $vgpr1
530 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
531 %3:vreg_64 = INSERT_SUBREG %0, %2, %subreg.sub1 ; %3.sub1 is inserted
532 %4:vgpr_32 = V_MOV_B32_dpp %3.sub1, %1, 1, 1, 1, 0, implicit $exec
533 %5:vgpr_32 = V_ADD_U32_e32 %4, %0.sub1, implicit $exec
536 # GCN-LABEL: name: add_old_subreg_undef
537 # GCN: %5:vgpr_32 = V_ADD_U32_dpp undef %3.sub1, %1, %0.sub1, 1, 15, 15, 1, implicit $exec
539 name: add_old_subreg_undef
540 tracksRegLiveness: true
543 liveins: $vgpr0, $vgpr1
545 %0:vreg_64 = COPY $vgpr0
546 %1:vgpr_32 = COPY $vgpr1
547 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
548 %3:vreg_64 = REG_SEQUENCE %2, %subreg.sub0 ; %3.sub1 is undef
549 %4:vgpr_32 = V_MOV_B32_dpp %3.sub1, %1, 1, 15, 15, 1, implicit $exec
550 %5:vgpr_32 = V_ADD_U32_e32 %4, %0.sub1, implicit $exec
553 # Test instruction which does not have modifiers in VOP1 form but does in DPP form.
554 # GCN-LABEL: name: dpp_vop1
555 # GCN: %3:vgpr_32 = V_CEIL_F32_dpp %0, 0, undef %2:vgpr_32, 1, 15, 15, 1, implicit $mode, implicit $exec
557 tracksRegLiveness: true
560 %1:vgpr_32 = IMPLICIT_DEF
561 %2:vgpr_32 = V_MOV_B32_dpp %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
562 %3:vgpr_32 = V_CEIL_F32_e32 %2, implicit $mode, implicit $exec
565 # Test instruction which does not have modifiers in VOP2 form but does in DPP form.
566 # GCN-LABEL: name: dpp_min
567 # GCN: %3:vgpr_32 = V_MIN_F32_dpp %0, 0, undef %2:vgpr_32, 0, undef %4:vgpr_32, 1, 15, 15, 1, implicit $mode, implicit $exec
569 tracksRegLiveness: true
572 %1:vgpr_32 = IMPLICIT_DEF
573 %2:vgpr_32 = V_MOV_B32_dpp %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
574 %4:vgpr_32 = V_MIN_F32_e32 %2, undef %3:vgpr_32, implicit $mode, implicit $exec
577 # Test an undef old operand
578 # GCN-LABEL: name: dpp_undef_old
579 # GCN: %3:vgpr_32 = V_CEIL_F32_dpp undef %1:vgpr_32, 0, undef %2:vgpr_32, 1, 15, 15, 1, implicit $mode, implicit $exec
581 tracksRegLiveness: true
584 %2:vgpr_32 = V_MOV_B32_dpp undef %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
585 %3:vgpr_32 = V_CEIL_F32_e32 %2, implicit $mode, implicit $exec
588 # Do not combine a dpp mov which writes a physreg.
589 # GCN-LABEL: name: phys_dpp_mov_dst
590 # GCN: $vgpr0 = V_MOV_B32_dpp undef %0:vgpr_32, undef %1:vgpr_32, 1, 15, 15, 1, implicit $exec
591 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 $vgpr0, implicit $mode, implicit $exec
592 name: phys_dpp_mov_dst
593 tracksRegLiveness: true
596 $vgpr0 = V_MOV_B32_dpp undef %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
597 %2:vgpr_32 = V_CEIL_F32_e32 $vgpr0, implicit $mode, implicit $exec
600 # Do not combine a dpp mov which reads a physreg.
601 # GCN-LABEL: name: phys_dpp_mov_old_src
602 # GCN: %0:vgpr_32 = V_MOV_B32_dpp undef $vgpr0, undef %1:vgpr_32, 1, 15, 15, 1, implicit $exec
603 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 %0, implicit $mode, implicit $exec
604 name: phys_dpp_mov_old_src
605 tracksRegLiveness: true
608 %1:vgpr_32 = V_MOV_B32_dpp undef $vgpr0, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
609 %2:vgpr_32 = V_CEIL_F32_e32 %1, implicit $mode, implicit $exec
612 # Do not combine a dpp mov which reads a physreg.
613 # GCN-LABEL: name: phys_dpp_mov_src
614 # GCN: %0:vgpr_32 = V_MOV_B32_dpp undef %1:vgpr_32, undef $vgpr0, 1, 15, 15, 1, implicit $exec
615 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 %0, implicit $mode, implicit $exec
616 name: phys_dpp_mov_src
617 tracksRegLiveness: true
620 %1:vgpr_32 = V_MOV_B32_dpp undef %0:vgpr_32, undef $vgpr0, 1, 15, 15, 1, implicit $exec
621 %2:vgpr_32 = V_CEIL_F32_e32 %1, implicit $mode, implicit $exec
624 # GCN-LABEL: name: dpp_reg_sequence_both_combined
625 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
626 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
627 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
628 # GCN: %9:vgpr_32 = IMPLICIT_DEF
629 # GCN: %8:vgpr_32 = IMPLICIT_DEF
630 # GCN: %6:vgpr_32 = V_ADD_CO_U32_dpp %9, %1.sub0, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $exec
631 # GCN: %7:vgpr_32 = V_ADDC_U32_dpp %8, %1.sub1, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
632 name: dpp_reg_sequence_both_combined
633 tracksRegLiveness: true
636 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
638 %0:vreg_64 = COPY $vgpr0_vgpr1
639 %1:vreg_64 = COPY $vgpr2_vgpr3
640 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
641 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
642 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
643 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
644 %6:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %5, implicit-def $vcc, implicit $exec
645 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
648 # GCN-LABEL: name: dpp_reg_sequence_first_combined
649 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
650 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
651 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
652 # GCN: %8:vgpr_32 = IMPLICIT_DEF
653 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
654 # GCN: %5:vreg_64 = REG_SEQUENCE undef %3:vgpr_32, %subreg.sub0, %4, %subreg.sub1
655 # GCN: %6:vgpr_32 = V_ADD_CO_U32_dpp %8, %1.sub0, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $exec
656 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
657 name: dpp_reg_sequence_first_combined
658 tracksRegLiveness: true
661 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
663 %0:vreg_64 = COPY $vgpr0_vgpr1
664 %1:vreg_64 = COPY $vgpr2_vgpr3
665 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
666 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
667 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
668 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
669 %6:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %5, implicit-def $vcc, implicit $exec
670 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
673 # GCN-LABEL: name: dpp_reg_sequence_second_combined
674 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
675 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
676 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
677 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
678 # GCN: %8:vgpr_32 = IMPLICIT_DEF
679 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, undef %4:vgpr_32, %subreg.sub1
680 # GCN: %6:vgpr_32 = V_ADD_CO_U32_e32 %5.sub0, %2, implicit-def $vcc, implicit $exec
681 # GCN: %7:vgpr_32 = V_ADDC_U32_dpp %8, %1.sub1, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
682 name: dpp_reg_sequence_second_combined
683 tracksRegLiveness: true
686 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
688 %0:vreg_64 = COPY $vgpr0_vgpr1
689 %1:vreg_64 = COPY $vgpr2_vgpr3
690 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
691 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
692 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
693 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
694 %6:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %5, implicit-def $vcc, implicit $exec
695 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
698 # GCN-LABEL: name: dpp_reg_sequence_none_combined
699 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
700 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
701 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
702 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
703 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
704 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
705 # GCN: %6:vgpr_32 = V_ADD_CO_U32_e32 %5.sub0, %2, implicit-def $vcc, implicit $exec
706 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
707 name: dpp_reg_sequence_none_combined
708 tracksRegLiveness: true
711 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
713 %0:vreg_64 = COPY $vgpr0_vgpr1
714 %1:vreg_64 = COPY $vgpr2_vgpr3
715 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
716 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
717 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
718 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
719 %6:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %5, implicit-def $vcc, implicit $exec
720 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
723 # GCN-LABEL: name: dpp_reg_sequence_exec_changed
724 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
725 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
726 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
727 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
728 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
729 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
730 # GCN: S_BRANCH %bb.1
732 # GCN: %6:vgpr_32 = V_ADD_CO_U32_e32 %5.sub0, %2, implicit-def $vcc, implicit $exec
733 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
734 name: dpp_reg_sequence_exec_changed
735 tracksRegLiveness: true
738 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
740 %0:vreg_64 = COPY $vgpr0_vgpr1
741 %1:vreg_64 = COPY $vgpr2_vgpr3
742 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
743 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
744 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
745 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
749 %6:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %5, implicit-def $vcc, implicit $exec
750 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
753 # GCN-LABEL: name: dpp_reg_sequence_subreg
754 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
755 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
756 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
757 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
758 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
759 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
760 # GCN: %6:vreg_64 = REG_SEQUENCE %5.sub0, %subreg.sub0, %5.sub1, %subreg.sub1
761 # GCN: %7:vgpr_32 = V_ADD_CO_U32_e32 %6.sub0, %2, implicit-def $vcc, implicit $exec
762 # GCN: %8:vgpr_32 = V_ADDC_U32_e32 %6.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
763 name: dpp_reg_sequence_subreg
764 tracksRegLiveness: true
767 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
769 %0:vreg_64 = COPY $vgpr0_vgpr1
770 %1:vreg_64 = COPY $vgpr2_vgpr3
771 %8:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
772 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
773 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
774 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
775 %5:vreg_64 = REG_SEQUENCE %4.sub0, %subreg.sub0, %4.sub1, %subreg.sub1
776 %6:vgpr_32 = V_ADD_CO_U32_e32 %5.sub0, %8, implicit-def $vcc, implicit $exec
777 %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %8, implicit-def $vcc, implicit $vcc, implicit $exec
780 # GCN-LABEL: name: dpp64_add64_impdef
781 # GCN: %3:vgpr_32 = V_ADD_CO_U32_dpp %1.sub0, %0.sub0, undef %4:vgpr_32, 1, 15, 15, 1, implicit-def $vcc, implicit $exec
782 # GCN: %5:vgpr_32 = V_ADDC_U32_dpp %1.sub1, %0.sub1, undef %4:vgpr_32, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
783 name: dpp64_add64_impdef
784 tracksRegLiveness: true
787 %0:vreg_64 = IMPLICIT_DEF
788 %1:vreg_64 = IMPLICIT_DEF
789 %2:vreg_64 = V_MOV_B64_DPP_PSEUDO %1:vreg_64, %0:vreg_64, 1, 15, 15, 1, implicit $exec
790 %5:vgpr_32 = V_ADD_CO_U32_e32 %2.sub0, undef %4:vgpr_32, implicit-def $vcc, implicit $exec
791 %6:vgpr_32 = V_ADDC_U32_e32 %2.sub1, undef %4, implicit-def $vcc, implicit $vcc, implicit $exec
794 # GCN-LABEL: name: dpp64_add64_undef
795 # GCN: %3:vgpr_32 = V_ADD_CO_U32_dpp undef %1.sub0:vreg_64, undef %2.sub0:vreg_64, undef %4:vgpr_32, 1, 15, 15, 1, implicit-def $vcc, implicit $exec
796 # GCN: %5:vgpr_32 = V_ADDC_U32_dpp undef %1.sub1:vreg_64, undef %2.sub1:vreg_64, undef %4:vgpr_32, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
797 name: dpp64_add64_undef
798 tracksRegLiveness: true
801 %2:vreg_64 = V_MOV_B64_DPP_PSEUDO undef %1:vreg_64, undef %0:vreg_64, 1, 15, 15, 1, implicit $exec
802 %5:vgpr_32 = V_ADD_CO_U32_e32 %2.sub0, undef %4:vgpr_32, implicit-def $vcc, implicit $exec
803 %6:vgpr_32 = V_ADDC_U32_e32 %2.sub1, undef %4, implicit-def $vcc, implicit $vcc, implicit $exec
806 # GCN-LABEL: name: dpp64_add64_first_combined
807 # GCN: %8:vgpr_32 = V_MOV_B32_dpp undef %1.sub1:vreg_64, undef %2.sub1:vreg_64, 1, 15, 15, 1, implicit $exec
808 # GCN: %0:vreg_64 = REG_SEQUENCE undef %7:vgpr_32, %subreg.sub0, %8, %subreg.sub1
809 # GCN: %3:vgpr_32 = V_ADD_CO_U32_dpp undef %1.sub0:vreg_64, undef %2.sub0:vreg_64, undef %4:vgpr_32, 1, 15, 15, 1, implicit-def $vcc, implicit $exec
810 # GCN: %5:vgpr_32, dead %6:sreg_64_xexec = V_ADDC_U32_e64 1, %0.sub1, undef $vcc, 0, implicit $exec
811 name: dpp64_add64_first_combined
812 tracksRegLiveness: true
815 %2:vreg_64 = V_MOV_B64_DPP_PSEUDO undef %1:vreg_64, undef %0:vreg_64, 1, 15, 15, 1, implicit $exec
816 %4:vgpr_32 = V_ADD_CO_U32_e32 %2.sub0, undef %3:vgpr_32, implicit-def $vcc, implicit $exec
817 %5:vgpr_32, dead %6:sreg_64_xexec = V_ADDC_U32_e64 1, %2.sub1, undef $vcc, 0, implicit $exec
820 # GCN-LABEL: name: dont_combine_cndmask_with_src2
821 # GCN: %5:vgpr_32 = V_CNDMASK_B32_e64 0, %3, 0, %1, %4, implicit $exec
822 name: dont_combine_cndmask_with_src2
823 tracksRegLiveness: true
826 liveins: $vgpr0, $vgpr1
827 %0:vgpr_32 = COPY $vgpr0
828 %1:vgpr_32 = COPY $vgpr1
829 %2:vgpr_32 = IMPLICIT_DEF
831 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
832 %4:sreg_64_xexec = IMPLICIT_DEF
833 %5:vgpr_32 = V_CNDMASK_B32_e64 0, %3, 0, %1, %4, implicit $exec
838 # Make sure flags aren't dropped
839 # GCN-LABEL: name: flags_add_f32_e64
840 # GCN: %4:vgpr_32 = nnan nofpexcept V_ADD_F32_dpp %2, 0, %1, 0, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
841 name: flags_add_f32_e64
842 tracksRegLiveness: true
845 liveins: $vgpr0, $vgpr1
847 %0:vgpr_32 = COPY $vgpr0
848 %1:vgpr_32 = COPY $vgpr1
849 %2:vgpr_32 = IMPLICIT_DEF
851 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
852 %4:vgpr_32 = nofpexcept nnan V_ADD_F32_e64 0, %3, 0, %0, 0, 0, implicit $mode, implicit $exec
853 S_ENDPGM 0, implicit %4
857 # GCN-LABEL: name: dont_combine_more_than_one_operand
858 # GCN: %3:vgpr_32 = V_MAX_F32_e64 0, %2, 0, %2, 0, 0, implicit $mode, implicit $exec
859 name: dont_combine_more_than_one_operand
860 tracksRegLiveness: true
863 liveins: $vgpr0, $vgpr1
864 %0:vgpr_32 = COPY $vgpr0
865 %1:vgpr_32 = COPY $vgpr1
866 %2:vgpr_32 = V_MOV_B32_dpp %0, %1, 1, 15, 15, 1, implicit $exec
867 %3:vgpr_32 = V_MAX_F32_e64 0, %2, 0, %2, 0, 0, implicit $mode, implicit $exec
870 # GCN-LABEL: name: dont_combine_more_than_one_operand_dpp_reg_sequence
871 # GCN: %5:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %4.sub0, implicit-def $vcc, implicit $exec
872 # GCN: %6:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %4.sub1, implicit-def $vcc, implicit $vcc, implicit $exec
873 name: dont_combine_more_than_one_operand_dpp_reg_sequence
874 tracksRegLiveness: true
877 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
878 %0:vreg_64 = COPY $vgpr0_vgpr1
879 %1:vreg_64 = COPY $vgpr2_vgpr3
880 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
881 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
882 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
883 %5:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %4.sub0, implicit-def $vcc, implicit $exec
884 %6:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %4.sub1, implicit-def $vcc, implicit $vcc, implicit $exec