1 # RUN: llc -march=amdgcn -mcpu=gfx1100 -run-pass=gcn-dpp-combine -verify-machineinstrs -o - %s | FileCheck %s -check-prefixes=GCN,GFX1100
2 # RUN: llc -march=amdgcn -mcpu=gfx1150 -run-pass=gcn-dpp-combine -verify-machineinstrs -o - %s | FileCheck %s -check-prefixes=GCN,GFX1150
6 # GCN-label: name: vop3
7 # GCN: %6:vgpr_32, %7:sreg_32_xm0_xexec = V_SUBBREV_U32_e64_dpp %3, %0, %1, %5, 1, 1, 15, 15, 1, implicit $exec
8 # GCN: %8:vgpr_32 = V_CVT_PK_U8_F32_e64_dpp %3, 4, %0, 2, %2, 2, %1, 1, 1, 15, 15, 1, implicit $mode, implicit $exec
9 # GCN: %10:vgpr_32 = V_MED3_F32_e64 0, %9, 0, %0, 0, 12345678, 0, 0, implicit $mode, implicit $exec
10 # GFX1100: %12:vgpr_32 = V_MED3_F32_e64 0, %11, 0, 2, 0, %7, 0, 0, implicit $mode, implicit $exec
11 # GFX1150: %12:vgpr_32 = V_MED3_F32_e64_dpp %3, 0, %1, 0, 2, 0, %7, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
13 tracksRegLiveness: true
16 liveins: $vgpr0, $vgpr1, $vgpr2
18 %0:vgpr_32 = COPY $vgpr0
19 %1:vgpr_32 = COPY $vgpr1
20 %2:vgpr_32 = COPY $vgpr2
21 %3:vgpr_32 = IMPLICIT_DEF
22 %4:vgpr_32 = V_MOV_B32_dpp %3, %0, 1, 15, 15, 1, implicit $exec
24 %5:sreg_32_xm0_xexec = IMPLICIT_DEF
25 %6:vgpr_32, %7:sreg_32_xm0_xexec = V_SUBBREV_U32_e64 %4, %1, %5, 1, implicit $exec
27 %8:vgpr_32 = V_CVT_PK_U8_F32_e64 4, %4, 2, %2, 2, %1, 1, implicit $mode, implicit $exec
29 ; should not be combined because src2 literal is illegal
30 %9:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
31 %10:vgpr_32 = V_MED3_F32_e64 0, %9, 0, %0, 0, 12345678, 0, 0, implicit $mode, implicit $exec
33 ; should not be combined on subtargets where src1 imm is illegal
34 %11:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
35 %12:vgpr_32 = V_MED3_F32_e64 0, %11, 0, 2, 0, %7, 0, 0, implicit $mode, implicit $exec
39 # GCN-label: name: vop3_sgpr_src1
40 # GCN: %6:vgpr_32 = V_MED3_F32_e64_dpp %4, 0, %0, 0, %1, 0, %2, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
41 # GFX1100: %8:vgpr_32 = V_MED3_F32_e64 0, %7, 0, %2, 0, %1, 0, 0, implicit $mode, implicit $exec
42 # GFX1150: %8:vgpr_32 = V_MED3_F32_e64_dpp %4, 0, %0, 0, %2, 0, %1, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
43 # GFX1100: %10:vgpr_32 = V_MED3_F32_e64 0, %9, 0, %2, 0, %3, 0, 0, implicit $mode, implicit $exec
44 # GFX1150: %10:vgpr_32 = V_MED3_F32_e64_dpp %4, 0, %0, 0, %2, 0, %3, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
45 # GFX1100: %12:vgpr_32 = V_MED3_F32_e64 0, %11, 0, 42, 0, %2, 0, 0, implicit $mode, implicit $exec
46 # GFX1150: %12:vgpr_32 = V_MED3_F32_e64_dpp %4, 0, %0, 0, 42, 0, %2, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
47 # GCN: %14:vgpr_32 = V_MED3_F32_e64 0, %13, 0, 4242, 0, %2, 0, 0, implicit $mode, implicit $exec
49 tracksRegLiveness: true
52 liveins: $vgpr0, $vgpr1, $sgpr0, $sgpr1
54 %0:vgpr_32 = COPY $vgpr0
55 %1:vgpr_32 = COPY $vgpr1
56 %2:sgpr_32 = COPY $sgpr0
57 %3:sgpr_32 = COPY $sgpr1
58 %4:vgpr_32 = IMPLICIT_DEF
60 ; should be combined because src2 allows sgpr
61 %5:vgpr_32 = V_MOV_B32_dpp %4, %0, 1, 15, 15, 1, implicit $exec
62 %6:vgpr_32 = V_MED3_F32_e64 0, %5, 0, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
64 ; should be combined only on subtargets that allow sgpr for src1
65 %7:vgpr_32 = V_MOV_B32_dpp %4, %0, 1, 15, 15, 1, implicit $exec
66 %8:vgpr_32 = V_MED3_F32_e64 0, %7, 0, %2, 0, %1, 0, 0, implicit $mode, implicit $exec
68 ; should be combined only on subtargets that allow sgpr for src1
69 %9:vgpr_32 = V_MOV_B32_dpp %4, %0, 1, 15, 15, 1, implicit $exec
70 %10:vgpr_32 = V_MED3_F32_e64 0, %9, 0, %2, 0, %3, 0, 0, implicit $mode, implicit $exec
72 ; should be combined only on subtargets that allow inlinable constants for src1
73 %11:vgpr_32 = V_MOV_B32_dpp %4, %0, 1, 15, 15, 1, implicit $exec
74 %12:vgpr_32 = V_MED3_F32_e64 0, %11, 0, 42, 0, %2, 0, 0, implicit $mode, implicit $exec
76 ; should not be combined when literal constants are used
77 %13:vgpr_32 = V_MOV_B32_dpp %4, %0, 1, 15, 15, 1, implicit $exec
78 %14:vgpr_32 = V_MED3_F32_e64 0, %13, 0, 4242, 0, %2, 0, 0, implicit $mode, implicit $exec
82 # Regression test for src_modifiers on base u16 opcode
83 # GCN-label: name: vop3_u16
84 # GCN: %5:vgpr_32 = V_ADD_NC_U16_e64_dpp %3, 0, %1, 0, %3, 0, 0, 1, 15, 15, 1, implicit $exec
85 # GCN: %7:vgpr_32 = V_ADD_NC_U16_e64_dpp %3, 4, %5, 8, %5, 0, 0, 1, 15, 15, 1, implicit $exec
87 tracksRegLiveness: true
90 liveins: $vgpr0, $vgpr1, $vgpr2
92 %0:vgpr_32 = COPY $vgpr0
93 %1:vgpr_32 = COPY $vgpr1
94 %2:vgpr_32 = COPY $vgpr2
95 %3:vgpr_32 = IMPLICIT_DEF
96 %4:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
97 %5:vgpr_32 = V_ADD_NC_U16_e64 0, %4, 0, %3, 0, 0, implicit $exec
98 %6:vgpr_32 = V_MOV_B32_dpp %3, %5, 1, 15, 15, 1, implicit $exec
99 %7:vgpr_32 = V_ADD_NC_U16_e64 4, %6, 8, %5, 0, 0, implicit $exec
103 tracksRegLiveness: true
106 liveins: $vgpr0, $vgpr1, $vgpr2
108 ; GCN-LABEL: name: vop3p
109 ; GCN: liveins: $vgpr0, $vgpr1, $vgpr2
110 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
111 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
112 ; GCN: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
113 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
114 ; GCN: [[V_MOV_B32_dpp:%[0-9]+]]:vgpr_32 = V_MOV_B32_dpp [[DEF]], [[COPY1]], 1, 15, 15, 1, implicit $exec
115 ; GCN: [[V_DOT2_F32_F16_:%[0-9]+]]:vgpr_32 = V_DOT2_F32_F16 0, [[V_MOV_B32_dpp]], 0, [[COPY]], 0, [[COPY2]], 0, 5, 0, 0, 0, implicit $mode, implicit $exec
116 ; GCN: [[V_MOV_B32_dpp1:%[0-9]+]]:vgpr_32 = V_MOV_B32_dpp [[DEF]], [[COPY1]], 1, 15, 15, 1, implicit $exec
117 ; GCN: [[V_DOT2_F32_F16_1:%[0-9]+]]:vgpr_32 = V_DOT2_F32_F16 0, [[V_MOV_B32_dpp1]], 0, [[COPY]], 0, [[COPY2]], 0, 0, 4, 0, 0, implicit $mode, implicit $exec
118 ; GCN: [[V_DOT2_F32_F16_dpp:%[0-9]+]]:vgpr_32 = V_DOT2_F32_F16_dpp [[DEF]], 10, [[COPY1]], 8, [[COPY]], 13, [[COPY2]], 1, 0, 7, 4, 5, 1, 15, 15, 1, implicit $mode, implicit $exec
119 ; GCN: [[V_FMA_MIX_F32_dpp:%[0-9]+]]:vgpr_32 = V_FMA_MIX_F32_dpp [[DEF]], 8, [[COPY1]], 8, [[COPY]], 8, [[COPY2]], 1, 0, 7, 1, 15, 15, 1, implicit $mode, implicit $exec
120 ; GCN: [[V_FMA_MIXLO_F16_dpp:%[0-9]+]]:vgpr_32 = V_FMA_MIXLO_F16_dpp [[DEF]], 8, [[COPY1]], 8, [[COPY]], 8, [[COPY2]], 0, [[COPY2]], 0, 7, 1, 15, 15, 1, implicit $mode, implicit $exec
121 ; GCN: [[V_FMA_MIXHI_F16_dpp:%[0-9]+]]:vgpr_32 = V_FMA_MIXHI_F16_dpp [[DEF]], 8, [[COPY1]], 8, [[COPY]], 8, [[COPY2]], 1, [[COPY]], 0, 7, 1, 15, 15, 1, implicit $mode, implicit $exec
122 %0:vgpr_32 = COPY $vgpr0
123 %1:vgpr_32 = COPY $vgpr1
124 %2:vgpr_32 = COPY $vgpr2
125 %3:vgpr_32 = IMPLICIT_DEF
127 ; this should not be combined because op_sel is not zero
128 %4:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
129 %5:vgpr_32 = V_DOT2_F32_F16 0, %4, 0, %0, 0, %2, 0, 5, 0, 0, 0, implicit $mode, implicit $exec
131 ; this should not be combined because op_sel_hi is not all set
132 %6:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
133 %7:vgpr_32 = V_DOT2_F32_F16 0, %6, 0, %0, 0, %2, 0, 0, 4, 0, 0, implicit $mode, implicit $exec
135 %8:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
136 %9:vgpr_32 = V_DOT2_F32_F16 10, %8, 8, %0, 13, %2, 1, 0, 7, 4, 5, implicit $mode, implicit $exec
138 %10:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
139 %11:vgpr_32 = V_FMA_MIX_F32 8, %10, 8, %0, 8, %2, 1, 0, 7, implicit $mode, implicit $exec
141 %12:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
142 %13:vgpr_32 = V_FMA_MIXLO_F16 8, %12, 8, %0, 8, %2, 0, %2, 0, 7, implicit $mode, implicit $exec
144 %14:vgpr_32 = V_MOV_B32_dpp %3, %1, 1, 15, 15, 1, implicit $exec
145 %15:vgpr_32 = V_FMA_MIXHI_F16 8, %14, 8, %0, 8, %2, 1, %0, 0, 7, implicit $mode, implicit $exec
149 # GCN-LABEL: name: fmac_e64
150 # GCN: %5:vgpr_32 = V_FMAC_F32_e64_dpp %3, 2, %0, 2, %1, 2, %2, 1, 2, 1, 15, 15, 1, implicit $mode, implicit $exec
152 tracksRegLiveness: true
155 liveins: $vgpr0, $vgpr1, $vgpr2
157 %0:vgpr_32 = COPY $vgpr0
158 %1:vgpr_32 = COPY $vgpr1
159 %2:vgpr_32 = COPY $vgpr2
160 %3:vgpr_32 = IMPLICIT_DEF
161 %4:vgpr_32 = V_MOV_B32_dpp %3, %0, 1, 15, 15, 1, implicit $exec
162 %6:vgpr_32 = V_FMAC_F32_e64 2, %4, 2, %1, 2, %2, 1, 2, implicit $mode, implicit $exec
165 # when the DPP source isn't a src0 operand the operation should be commuted if possible
166 # GCN-LABEL: name: dpp_commute_shrink
167 # GCN: %4:vgpr_32 = V_MUL_U32_U24_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
168 # GCN: %7:vgpr_32 = V_AND_B32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
169 # GCN: %10:vgpr_32 = V_MAX_I32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
170 # GCN: %13:vgpr_32 = V_MIN_I32_dpp %1, %0, %1, 1, 15, 14, 0, implicit $exec
171 # GCN: %16:vgpr_32 = V_SUBREV_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
172 name: dpp_commute_shrink
173 tracksRegLiveness: true
176 liveins: $vgpr0, $vgpr1
178 %0:vgpr_32 = COPY $vgpr0
179 %1:vgpr_32 = COPY $vgpr1
181 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
182 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
183 %4:vgpr_32 = V_MUL_U32_U24_e64 %1, %3, 0, implicit $exec
185 %5:vgpr_32 = V_MOV_B32_e32 4294967295, implicit $exec
186 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 14, 0, implicit $exec
187 %7:vgpr_32 = V_AND_B32_e64 %1, %6, implicit $exec
189 %8:vgpr_32 = V_MOV_B32_e32 -2147483648, implicit $exec
190 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 14, 15, 0, implicit $exec
191 %10:vgpr_32 = V_MAX_I32_e64 %1, %9, implicit $exec
193 %11:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
194 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 15, 14, 0, implicit $exec
195 %13:vgpr_32 = V_MIN_I32_e64 %1, %12, implicit $exec
197 %14:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
198 %15:vgpr_32 = V_MOV_B32_dpp %14, %0, 1, 14, 15, 0, implicit $exec
199 %16:vgpr_32 = V_SUB_U32_e64 %1, %15, 0, implicit $exec
203 # do not combine, dpp arg used twice
204 # GCN-label: name: dpp_arg_twice
205 # GCN: %4:vgpr_32 = V_FMA_F32_e64 1, %1, 2, %3, 2, %3, 1, 2, implicit $mode, implicit $exec
206 # GCN: %6:vgpr_32 = V_FMA_F32_e64 2, %5, 2, %1, 2, %5, 1, 2, implicit $mode, implicit $exec
207 # GCN: %8:vgpr_32 = V_FMA_F32_e64 2, %7, 2, %7, 2, %1, 1, 2, implicit $mode, implicit $exec
209 tracksRegLiveness: true
212 liveins: $vgpr0, $vgpr1
214 %0:vgpr_32 = COPY $vgpr0
215 %1:vgpr_32 = COPY $vgpr1
216 %2:vgpr_32 = IMPLICIT_DEF
218 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
219 %4:vgpr_32 = V_FMA_F32_e64 1, %1, 2, %3, 2, %3, 1, 2, implicit $mode, implicit $exec
221 %5:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
222 %6:vgpr_32 = V_FMA_F32_e64 2, %5, 2, %1, 2, %5, 1, 2, implicit $mode, implicit $exec
224 %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
225 %8:vgpr_32 = V_FMA_F32_e64 2, %7, 2, %7, 2, %1, 1, 2, implicit $mode, implicit $exec
229 # when the dpp source isn't a src0 operand the operation should be commuted if possible
230 # GCN-label: name: dpp_commute_e64
231 # GCN: %4:vgpr_32 = V_MUL_U32_U24_e64_dpp %1, %0, %1, 1, 1, 14, 15, 0, implicit $exec
232 # GCN: %7:vgpr_32 = V_FMA_F32_e64_dpp %5, 2, %0, 1, %1, 2, %1, 1, 2, 1, 15, 15, 1, implicit $mode, implicit $exec
233 # GCN: %10:vgpr_32 = V_SUBREV_U32_e64_dpp %1, %0, %1, 1, 1, 14, 15, 0, implicit $exec
234 # GCN: %13:vgpr_32, %14:sreg_32_xm0_xexec = V_ADD_CO_U32_e64_dpp %1, %0, %1, 0, 1, 14, 15, 0, implicit $exec
235 # GCN: %17:vgpr_32, %18:sreg_32_xm0_xexec = V_ADD_CO_U32_e64 5, %16, 0, implicit $exec
236 name: dpp_commute_e64
237 tracksRegLiveness: true
240 liveins: $vgpr0, $vgpr1
242 %0:vgpr_32 = COPY $vgpr0
243 %1:vgpr_32 = COPY $vgpr1
245 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
246 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
247 %4:vgpr_32 = V_MUL_U32_U24_e64 %1, %3, 1, implicit $exec
249 %5:vgpr_32 = IMPLICIT_DEF
250 %6:vgpr_32 = V_MOV_B32_dpp %5, %0, 1, 15, 15, 1, implicit $exec
251 %7:vgpr_32 = V_FMA_F32_e64 1, %1, 2, %6, 2, %1, 1, 2, implicit $mode, implicit $exec
253 %8:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
254 %9:vgpr_32 = V_MOV_B32_dpp %8, %0, 1, 14, 15, 0, implicit $exec
255 %10:vgpr_32 = V_SUB_U32_e64 %1, %9, 1, implicit $exec
257 %11:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
258 %12:vgpr_32 = V_MOV_B32_dpp %11, %0, 1, 14, 15, 0, implicit $exec
259 %13:vgpr_32, %14:sreg_32_xm0_xexec = V_ADD_CO_U32_e64 %1, %12, 0, implicit $exec
261 ; this cannot be combined because immediate as src0 isn't commutable
262 %15:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
263 %16:vgpr_32 = V_MOV_B32_dpp %15, %0, 1, 14, 15, 0, implicit $exec
264 %17:vgpr_32, %18:sreg_32_xm0_xexec = V_ADD_CO_U32_e64 5, %16, 0, implicit $exec
269 # check for floating point modifiers
270 # GCN-LABEL: name: add_f32_e64
271 # GCN: %4:vgpr_32 = V_ADD_F32_e64_dpp %2, 0, %1, 0, %0, 0, 1, 1, 15, 15, 1, implicit $mode, implicit $exec
272 # GCN: %6:vgpr_32 = V_ADD_F32_dpp %2, 0, %1, 0, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
273 # GCN: %8:vgpr_32 = V_ADD_F32_dpp %2, 1, %1, 2, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
274 # GCN: %10:vgpr_32 = V_ADD_F32_e64_dpp %2, 4, %1, 8, %0, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec
277 tracksRegLiveness: true
280 liveins: $vgpr0, $vgpr1
282 %0:vgpr_32 = COPY $vgpr0
283 %1:vgpr_32 = COPY $vgpr1
284 %2:vgpr_32 = IMPLICIT_DEF
286 ; this should be combined as e64
287 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
288 %4:vgpr_32 = V_ADD_F32_e64 0, %3, 0, %0, 0, 1, implicit $mode, implicit $exec
290 ; this should be combined and shrunk as all modifiers are default
291 %5:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
292 %6:vgpr_32 = V_ADD_F32_e64 0, %5, 0, %0, 0, 0, implicit $mode, implicit $exec
294 ; this should be combined and shrunk as modifiers other than abs|neg are default
295 %7:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
296 %8:vgpr_32 = V_ADD_F32_e64 1, %7, 2, %0, 0, 0, implicit $mode, implicit $exec
298 ; this should be combined as e64
299 %9:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
300 %10:vgpr_32 = V_ADD_F32_e64 4, %9, 8, %0, 0, 0, implicit $mode, implicit $exec
303 # check for e64 modifiers
304 # GCN-LABEL: name: add_u32_e64
305 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %2, %0, %1, 1, 15, 15, 1, implicit $exec
306 # GCN: %6:vgpr_32 = V_ADD_U32_e64_dpp %2, %0, %1, 1, 1, 15, 15, 1, implicit $exec
309 tracksRegLiveness: true
312 liveins: $vgpr0, $vgpr1
314 %0:vgpr_32 = COPY $vgpr0
315 %1:vgpr_32 = COPY $vgpr1
316 %2:vgpr_32 = IMPLICIT_DEF
318 ; this should be combined and shrunk as all modifiers are default
319 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %0, 1, 15, 15, 1, implicit $exec
320 %4:vgpr_32 = V_ADD_U32_e64 %3, %1, 0, implicit $exec
322 ; this should be combined as _e64
323 %5:vgpr_32 = V_MOV_B32_dpp undef %2, %0, 1, 15, 15, 1, implicit $exec
324 %6:vgpr_32 = V_ADD_U32_e64 %5, %1, 1, implicit $exec
327 # tests on sequences of dpp consumers
328 # GCN-LABEL: name: dpp_seq
329 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
330 # GCN: %5:vgpr_32 = V_SUBREV_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
331 # GCN: %6:vgpr_32 = V_OR_B32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
333 # GCN: %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
336 tracksRegLiveness: true
339 liveins: $vgpr0, $vgpr1
340 %0:vgpr_32 = COPY $vgpr0
341 %1:vgpr_32 = COPY $vgpr1
342 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
344 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
345 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
346 %5:vgpr_32 = V_SUB_U32_e32 %1, %3, implicit $exec
347 %6:vgpr_32 = V_OR_B32_e32 %3, %1, implicit $exec
349 %7:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
350 %8:vgpr_32 = V_ADD_U32_e32 %7, %1, implicit $exec
351 ; this breaks the sequence
352 %9:vgpr_32 = V_SUB_U32_e32 5, %7, implicit $exec
355 # tests on sequences of dpp consumers followed by control flow
356 # GCN-LABEL: name: dpp_seq_cf
357 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
358 # GCN: %5:vgpr_32 = V_SUBREV_U32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
359 # GCN: %6:vgpr_32 = V_OR_B32_dpp %1, %0, %1, 1, 14, 15, 0, implicit $exec
362 tracksRegLiveness: true
365 successors: %bb.1, %bb.2
366 liveins: $vgpr0, $vgpr1
367 %0:vgpr_32 = COPY $vgpr0
368 %1:vgpr_32 = COPY $vgpr1
369 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
371 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 14, 15, 0, implicit $exec
372 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
373 %5:vgpr_32 = V_SUB_U32_e32 %1, %3, implicit $exec
374 %6:vgpr_32 = V_OR_B32_e32 %3, %1, implicit $exec
376 %7:sreg_32 = V_CMP_EQ_U32_e64 %5, %6, implicit $exec
377 %8:sreg_32 = SI_IF %7, %bb.2, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
384 SI_END_CF %8, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
387 # GCN-LABEL: name: old_in_diff_bb
388 # GCN: %4:vgpr_32 = V_ADD_U32_dpp %0, %1, %0, 1, 1, 1, 0, implicit $exec
391 tracksRegLiveness: true
395 liveins: $vgpr0, $vgpr1
397 %0:vgpr_32 = COPY $vgpr0
398 %1:vgpr_32 = COPY $vgpr1
399 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
403 %3:vgpr_32 = V_MOV_B32_dpp %2, %1, 1, 1, 1, 0, implicit $exec
404 %4:vgpr_32 = V_ADD_U32_e32 %3, %0, implicit $exec
407 # old reg def is in diff BB but bound_ctrl:1 - can combine
408 # GCN-LABEL: name: old_in_diff_bb_bctrl_zero
409 # GCN: %4:vgpr_32 = V_ADD_U32_dpp {{%[0-9]}}, %0, %1, 1, 15, 15, 1, implicit $exec
411 name: old_in_diff_bb_bctrl_zero
412 tracksRegLiveness: true
416 liveins: $vgpr0, $vgpr1
418 %0:vgpr_32 = COPY $vgpr0
419 %1:vgpr_32 = COPY $vgpr1
420 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
424 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
425 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
428 # EXEC mask changed between def and use - cannot combine
429 # GCN-LABEL: name: exec_changed
430 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
433 tracksRegLiveness: true
436 liveins: $vgpr0, $vgpr1
438 %0:vgpr_32 = COPY $vgpr0
439 %1:vgpr_32 = COPY $vgpr1
440 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
441 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
442 %4:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
443 %5:sreg_64 = COPY $exec, implicit-def $exec
444 %6:vgpr_32 = V_ADD_U32_e32 %3, %1, implicit $exec
447 # test if $old definition is correctly tracked through subreg manipulation pseudos
449 # GCN-LABEL: name: mul_old_subreg
450 # GCN: %7:vgpr_32 = V_MUL_I32_I24_dpp %0.sub1, %1, %0.sub1, 1, 1, 1, 0, implicit $exec
453 tracksRegLiveness: true
456 liveins: $vgpr0, $vgpr1
458 %0:vreg_64 = COPY $vgpr0
459 %1:vgpr_32 = COPY $vgpr1
460 %2:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
461 %3:vgpr_32 = V_MOV_B32_e32 42, implicit $exec
462 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
463 %5:vreg_64 = INSERT_SUBREG %4, %1, %subreg.sub1 ; %5.sub0 is taken from %4
464 %6:vgpr_32 = V_MOV_B32_dpp %5.sub0, %1, 1, 1, 1, 0, implicit $exec
465 %7:vgpr_32 = V_MUL_I32_I24_e32 %6, %0.sub1, implicit $exec
468 # GCN-LABEL: name: add_old_subreg
469 # GCN: %5:vgpr_32 = V_ADD_U32_dpp %0.sub1, %1, %0.sub1, 1, 1, 1, 0, implicit $exec
472 tracksRegLiveness: true
475 liveins: $vgpr0, $vgpr1
477 %0:vreg_64 = COPY $vgpr0
478 %1:vgpr_32 = COPY $vgpr1
479 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
480 %3:vreg_64 = INSERT_SUBREG %0, %2, %subreg.sub1 ; %3.sub1 is inserted
481 %4:vgpr_32 = V_MOV_B32_dpp %3.sub1, %1, 1, 1, 1, 0, implicit $exec
482 %5:vgpr_32 = V_ADD_U32_e32 %4, %0.sub1, implicit $exec
485 # GCN-LABEL: name: add_old_subreg_undef
486 # GCN: %5:vgpr_32 = V_ADD_U32_dpp undef %3.sub1, %1, %0.sub1, 1, 15, 15, 1, implicit $exec
488 name: add_old_subreg_undef
489 tracksRegLiveness: true
492 liveins: $vgpr0, $vgpr1
494 %0:vreg_64 = COPY $vgpr0
495 %1:vgpr_32 = COPY $vgpr1
496 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
497 %3:vreg_64 = REG_SEQUENCE %2, %subreg.sub0 ; %3.sub1 is undef
498 %4:vgpr_32 = V_MOV_B32_dpp %3.sub1, %1, 1, 15, 15, 1, implicit $exec
499 %5:vgpr_32 = V_ADD_U32_e32 %4, %0.sub1, implicit $exec
502 # Test instruction which does not have modifiers in VOP1 form but does in DPP form.
503 # GCN-LABEL: name: dpp_vop1
504 # GCN: %3:vgpr_32 = V_CEIL_F32_dpp %0, 0, undef %2:vgpr_32, 1, 15, 15, 1, implicit $mode, implicit $exec
506 tracksRegLiveness: true
509 %1:vgpr_32 = IMPLICIT_DEF
510 %2:vgpr_32 = V_MOV_B32_dpp %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
511 %3:vgpr_32 = V_CEIL_F32_e32 %2, implicit $mode, implicit $exec
514 # Test instruction which does not have modifiers in VOP2 form but does in DPP form.
515 # GCN-LABEL: name: dpp_min
516 # 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
518 tracksRegLiveness: true
521 %1:vgpr_32 = IMPLICIT_DEF
522 %2:vgpr_32 = V_MOV_B32_dpp %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
523 %4:vgpr_32 = V_MIN_F32_e32 %2, undef %3:vgpr_32, implicit $mode, implicit $exec
526 # Test an undef old operand
527 # GCN-LABEL: name: dpp_undef_old
528 # 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
530 tracksRegLiveness: true
533 %2:vgpr_32 = V_MOV_B32_dpp undef %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
534 %3:vgpr_32 = V_CEIL_F32_e32 %2, implicit $mode, implicit $exec
537 # Do not combine a dpp mov which writes a physreg.
538 # GCN-LABEL: name: phys_dpp_mov_dst
539 # GCN: $vgpr0 = V_MOV_B32_dpp undef %0:vgpr_32, undef %1:vgpr_32, 1, 15, 15, 1, implicit $exec
540 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 $vgpr0, implicit $mode, implicit $exec
541 name: phys_dpp_mov_dst
542 tracksRegLiveness: true
545 $vgpr0 = V_MOV_B32_dpp undef %1:vgpr_32, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
546 %2:vgpr_32 = V_CEIL_F32_e32 $vgpr0, implicit $mode, implicit $exec
549 # Do not combine a dpp mov which reads a physreg.
550 # GCN-LABEL: name: phys_dpp_mov_old_src
551 # GCN: %0:vgpr_32 = V_MOV_B32_dpp undef $vgpr0, undef %1:vgpr_32, 1, 15, 15, 1, implicit $exec
552 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 %0, implicit $mode, implicit $exec
553 name: phys_dpp_mov_old_src
554 tracksRegLiveness: true
557 %1:vgpr_32 = V_MOV_B32_dpp undef $vgpr0, undef %0:vgpr_32, 1, 15, 15, 1, implicit $exec
558 %2:vgpr_32 = V_CEIL_F32_e32 %1, implicit $mode, implicit $exec
561 # Do not combine a dpp mov which reads a physreg.
562 # GCN-LABEL: name: phys_dpp_mov_src
563 # GCN: %0:vgpr_32 = V_MOV_B32_dpp undef %1:vgpr_32, undef $vgpr0, 1, 15, 15, 1, implicit $exec
564 # GCN: %2:vgpr_32 = V_CEIL_F32_e32 %0, implicit $mode, implicit $exec
565 name: phys_dpp_mov_src
566 tracksRegLiveness: true
569 %1:vgpr_32 = V_MOV_B32_dpp undef %0:vgpr_32, undef $vgpr0, 1, 15, 15, 1, implicit $exec
570 %2:vgpr_32 = V_CEIL_F32_e32 %1, implicit $mode, implicit $exec
573 # GCN-LABEL: name: dpp_reg_sequence_both_combined
574 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
575 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
576 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
577 # GCN: %9:vgpr_32 = IMPLICIT_DEF
578 # GCN: %8:vgpr_32 = IMPLICIT_DEF
579 # GCN: %6:vgpr_32 = V_ADD_U32_dpp %9, %1.sub0, %2, 1, 15, 15, 1, implicit $exec
580 # GCN: %7:vgpr_32 = V_ADDC_U32_dpp %8, %1.sub1, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
581 name: dpp_reg_sequence_both_combined
582 tracksRegLiveness: true
585 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
587 %0:vreg_64 = COPY $vgpr0_vgpr1
588 %1:vreg_64 = COPY $vgpr2_vgpr3
589 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
590 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
591 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
592 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
593 %6:vgpr_32 = V_ADD_U32_e32 %4.sub0, %5, implicit $exec
594 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
597 # GCN-LABEL: name: dpp_reg_sequence_first_combined
598 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
599 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
600 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
601 # GCN: %8:vgpr_32 = IMPLICIT_DEF
602 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
603 # GCN: %5:vreg_64 = REG_SEQUENCE undef %3:vgpr_32, %subreg.sub0, %4, %subreg.sub1
604 # GCN: %6:vgpr_32 = V_ADD_U32_dpp %8, %1.sub0, %2, 1, 15, 15, 1, implicit $exec
605 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
606 name: dpp_reg_sequence_first_combined
607 tracksRegLiveness: true
610 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
612 %0:vreg_64 = COPY $vgpr0_vgpr1
613 %1:vreg_64 = COPY $vgpr2_vgpr3
614 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
615 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
616 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
617 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
618 %6:vgpr_32 = V_ADD_U32_e32 %4.sub0, %5, implicit $exec
619 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
622 # GCN-LABEL: name: dpp_reg_sequence_second_combined
623 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
624 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
625 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
626 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
627 # GCN: %8:vgpr_32 = IMPLICIT_DEF
628 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, undef %4:vgpr_32, %subreg.sub1
629 # GCN: %6:vgpr_32 = V_ADD_U32_e32 %5.sub0, %2, implicit $exec
630 # GCN: %7:vgpr_32 = V_ADDC_U32_dpp %8, %1.sub1, %2, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
631 name: dpp_reg_sequence_second_combined
632 tracksRegLiveness: true
635 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
637 %0:vreg_64 = COPY $vgpr0_vgpr1
638 %1:vreg_64 = COPY $vgpr2_vgpr3
639 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
640 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
641 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
642 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
643 %6:vgpr_32 = V_ADD_U32_e32 %4.sub0, %5, implicit $exec
644 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
647 # GCN-LABEL: name: dpp_reg_sequence_none_combined
648 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
649 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
650 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
651 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
652 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
653 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
654 # GCN: %6:vgpr_32 = V_ADD_U32_e32 %5.sub0, %2, implicit $exec
655 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
656 name: dpp_reg_sequence_none_combined
657 tracksRegLiveness: true
660 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
662 %0:vreg_64 = COPY $vgpr0_vgpr1
663 %1:vreg_64 = COPY $vgpr2_vgpr3
664 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
665 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 1, 1, 1, implicit $exec
666 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 1, 1, 1, implicit $exec
667 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
668 %6:vgpr_32 = V_ADD_U32_e32 %4.sub0, %5, implicit $exec
669 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
672 # GCN-LABEL: name: dpp_reg_sequence_exec_changed
673 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
674 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
675 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
676 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
677 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
678 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
679 # GCN: S_BRANCH %bb.1
681 # GCN: %6:vgpr_32 = V_ADD_U32_e32 %5.sub0, %2, implicit $exec
682 # GCN: %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
683 name: dpp_reg_sequence_exec_changed
684 tracksRegLiveness: true
687 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
689 %0:vreg_64 = COPY $vgpr0_vgpr1
690 %1:vreg_64 = COPY $vgpr2_vgpr3
691 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
692 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
693 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
694 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
698 %6:vgpr_32 = V_ADD_U32_e32 %4.sub0, %5, implicit $exec
699 %7:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %5, implicit-def $vcc, implicit $vcc, implicit $exec
702 # GCN-LABEL: name: dpp_reg_sequence_subreg
703 # GCN: %0:vreg_64 = COPY $vgpr0_vgpr1
704 # GCN: %1:vreg_64 = COPY $vgpr2_vgpr3
705 # GCN: %2:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
706 # GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
707 # GCN: %4:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
708 # GCN: %5:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %4, %subreg.sub1
709 # GCN: %6:vreg_64 = REG_SEQUENCE %5.sub0, %subreg.sub0, %5.sub1, %subreg.sub1
710 # GCN: %7:vgpr_32 = V_ADD_U32_e32 %6.sub0, %2, implicit $exec
711 # GCN: %8:vgpr_32 = V_ADDC_U32_e32 %6.sub1, %2, implicit-def $vcc, implicit $vcc, implicit $exec
712 name: dpp_reg_sequence_subreg
713 tracksRegLiveness: true
716 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
718 %0:vreg_64 = COPY $vgpr0_vgpr1
719 %1:vreg_64 = COPY $vgpr2_vgpr3
720 %8:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
721 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
722 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
723 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
724 %5:vreg_64 = REG_SEQUENCE %4.sub0, %subreg.sub0, %4.sub1, %subreg.sub1
725 %6:vgpr_32 = V_ADD_U32_e32 %5.sub0, %8, implicit $exec
726 %7:vgpr_32 = V_ADDC_U32_e32 %5.sub1, %8, implicit-def $vcc, implicit $vcc, implicit $exec
729 # GCN-LABEL: name: dpp_reg_sequence_src2_reject
730 #GCN: %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
731 #GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
732 #GCN: %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
733 #GCN: %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
734 #GCN: %6:vgpr_32 = V_FMA_F32_e64 2, %4.sub0, 2, %5, 2, %4.sub0, 1, 2, implicit $mode, implicit $exec
735 #GCN: %7:vgpr_32 = V_FMA_F32_e64 2, %4.sub0, 2, %5, 2, %4.sub1, 1, 2, implicit $mode, implicit $exec
736 name: dpp_reg_sequence_src2_reject
737 tracksRegLiveness: true
740 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
742 %0:vreg_64 = COPY $vgpr0_vgpr1
743 %1:vreg_64 = COPY $vgpr2_vgpr3
744 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
745 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
746 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
747 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
748 ; use of dpp arg as src2, reject
749 %6:vgpr_32 = V_FMA_F32_e64 2, %4.sub0, 2, %5, 2, %4.sub0, 1, 2, implicit $mode, implicit $exec
750 ; cannot commute src0 and src2, and %4.sub0 already rejected, reject
751 %7:vgpr_32 = V_FMA_F32_e64 2, %4.sub0, 2, %5, 2, %4.sub1, 1, 2, implicit $mode, implicit $exec
754 # GCN-LABEL: name: dpp_reg_sequence_src2
755 #GCN: %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
756 #GCN: %4:vreg_64 = REG_SEQUENCE undef %2:vgpr_32, %subreg.sub0, %3, %subreg.sub1
757 #GCN: %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
758 #GCN: %6:vgpr_32 = V_FMA_F32_e64_dpp %8, 2, %1.sub0, 2, %5, 2, %4.sub1, 1, 2, 1, 15, 15, 1, implicit $mode, implicit $exec
759 name: dpp_reg_sequence_src2
760 tracksRegLiveness: true
763 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
765 %0:vreg_64 = COPY $vgpr0_vgpr1
766 %1:vreg_64 = COPY $vgpr2_vgpr3
767 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
768 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
769 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
770 %5:vgpr_32 = V_MOV_B32_e32 5, implicit $exec
771 %6:vgpr_32 = V_FMA_F32_e64 2, %4.sub0, 2, %5, 2, %4.sub1, 1, 2, implicit $mode, implicit $exec
774 # GCN-LABEL: name: dpp64_add64_impdef
775 # GCN: %3:vgpr_32 = V_ADD_U32_dpp %1.sub0, %0.sub0, undef %4:vgpr_32, 1, 15, 15, 1, implicit $exec
776 # 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
777 name: dpp64_add64_impdef
778 tracksRegLiveness: true
781 %0:vreg_64 = IMPLICIT_DEF
782 %1:vreg_64 = IMPLICIT_DEF
783 %2:vreg_64 = V_MOV_B64_DPP_PSEUDO %1:vreg_64, %0:vreg_64, 1, 15, 15, 1, implicit $exec
784 %5:vgpr_32 = V_ADD_U32_e32 %2.sub0, undef %4:vgpr_32, implicit $exec
785 %6:vgpr_32 = V_ADDC_U32_e32 %2.sub1, undef %4, implicit-def $vcc, implicit $vcc, implicit $exec
788 # GCN-LABEL: name: dpp64_add64_undef
789 # GCN: %3:vgpr_32 = V_ADD_U32_dpp undef %1.sub0:vreg_64, undef %2.sub0:vreg_64, undef %4:vgpr_32, 1, 15, 15, 1, implicit $exec
790 # 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
791 name: dpp64_add64_undef
792 tracksRegLiveness: true
795 %2:vreg_64 = V_MOV_B64_DPP_PSEUDO undef %1:vreg_64, undef %0:vreg_64, 1, 15, 15, 1, implicit $exec
796 %5:vgpr_32 = V_ADD_U32_e32 %2.sub0, undef %4:vgpr_32, implicit $exec
797 %6:vgpr_32 = V_ADDC_U32_e32 %2.sub1, undef %4, implicit-def $vcc, implicit $vcc, implicit $exec
801 # GCN-LABEL: name: cndmask_with_src2
802 # GCN: %5:vgpr_32 = V_CNDMASK_B32_e64 0, %3, 0, %1, %4, implicit $exec
803 # GCN: %8:vgpr_32 = V_CNDMASK_B32_e64_dpp %2, 4, %1, 0, %1, %7, 1, 15, 15, 1, implicit $exec
804 name: cndmask_with_src2
805 tracksRegLiveness: true
808 liveins: $vgpr0, $vgpr1
809 %0:vgpr_32 = COPY $vgpr0
810 %1:vgpr_32 = COPY $vgpr1
811 %2:vgpr_32 = IMPLICIT_DEF
813 %3:vgpr_32 = V_MOV_B32_dpp %2, %0, 1, 15, 15, 1, implicit $exec
814 %4:sreg_32_xm0_xexec = IMPLICIT_DEF
815 %5:vgpr_32 = V_CNDMASK_B32_e64 0, %3, 0, %1, %4, implicit $exec
817 ; src2 is legal for _e64
818 %6:vgpr_32 = V_MOV_B32_dpp %2, %1, 1, 15, 15, 1, implicit $exec
819 %7:sreg_32_xm0_xexec = IMPLICIT_DEF
820 %8:vgpr_32 = V_CNDMASK_B32_e64 4, %6, 0, %1, %7, implicit $exec
825 # Make sure flags aren't dropped
826 # GCN-LABEL: name: flags_add_f32_e64
827 # GCN: %4:vgpr_32 = nnan nofpexcept V_ADD_F32_dpp %2, 0, %1, 0, %0, 1, 15, 15, 1, implicit $mode, implicit $exec
828 name: flags_add_f32_e64
829 tracksRegLiveness: true
832 liveins: $vgpr0, $vgpr1
834 %0:vgpr_32 = COPY $vgpr0
835 %1:vgpr_32 = COPY $vgpr1
836 %2:vgpr_32 = IMPLICIT_DEF
838 %3:vgpr_32 = V_MOV_B32_dpp undef %2, %1, 1, 15, 15, 1, implicit $exec
839 %4:vgpr_32 = nofpexcept nnan V_ADD_F32_e64 0, %3, 0, %0, 0, 0, implicit $mode, implicit $exec
840 S_ENDPGM 0, implicit %4
844 # GCN-LABEL: name: dont_combine_more_than_one_operand
845 # GCN: %3:vgpr_32 = V_MAX_F32_e64 0, %2, 0, %2, 0, 0, implicit $mode, implicit $exec
846 name: dont_combine_more_than_one_operand
847 tracksRegLiveness: true
850 liveins: $vgpr0, $vgpr1
851 %0:vgpr_32 = COPY $vgpr0
852 %1:vgpr_32 = COPY $vgpr1
853 %2:vgpr_32 = V_MOV_B32_dpp %0, %1, 1, 15, 15, 1, implicit $exec
854 %3:vgpr_32 = V_MAX_F32_e64 0, %2, 0, %2, 0, 0, implicit $mode, implicit $exec
857 # GCN-LABEL: name: dont_combine_more_than_one_operand_dpp_reg_sequence
858 # GCN: %5:vgpr_32 = V_ADD_U32_e32 %4.sub0, %4.sub0, implicit $exec
859 # GCN: %6:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %4.sub1, implicit-def $vcc, implicit $vcc, implicit $exec
860 name: dont_combine_more_than_one_operand_dpp_reg_sequence
861 tracksRegLiveness: true
864 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
865 %0:vreg_64 = COPY $vgpr0_vgpr1
866 %1:vreg_64 = COPY $vgpr2_vgpr3
867 %2:vgpr_32 = V_MOV_B32_dpp %0.sub0, %1.sub0, 1, 15, 15, 1, implicit $exec
868 %3:vgpr_32 = V_MOV_B32_dpp %0.sub1, %1.sub1, 1, 15, 15, 1, implicit $exec
869 %4:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1
870 %5:vgpr_32 = V_ADD_U32_e32 %4.sub0, %4.sub0, implicit $exec
871 %6:vgpr_32 = V_ADDC_U32_e32 %4.sub1, %4.sub1, implicit-def $vcc, implicit $vcc, implicit $exec