1 # RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx900 -verify-machineinstrs -run-pass si-fold-operands,dead-mi-elimination -o - %s | FileCheck -enable-var-scope -check-prefix=GCN %s
4 # GCN-LABEL: name: s_fold_and_imm_regimm_32{{$}}
5 # GCN: %10:vgpr_32 = V_MOV_B32_e32 1543, implicit $exec
6 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
7 name: s_fold_and_imm_regimm_32
8 tracksRegLiveness: true
10 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
12 isFrameAddressTaken: false
13 isReturnAddressTaken: false
22 hasOpaqueSPAdjustment: false
24 hasMustTailInVarArgFunc: false
29 %0:sgpr_64 = COPY $sgpr0_sgpr1
30 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
31 %2:sreg_32_xm0 = COPY %1.sub1
32 %3:sreg_32_xm0 = COPY %1.sub0
33 %4:sreg_32_xm0 = S_MOV_B32 61440
34 %5:sreg_32_xm0 = S_MOV_B32 -1
35 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.hi16, killed %3, %subreg.lo16, killed %4, %subreg.sub0, killed %5, %subreg.sub0_sub1
36 %7:sreg_32_xm0 = S_MOV_B32 1234567
37 %8:sreg_32_xm0 = S_MOV_B32 9999
38 %9:sreg_32_xm0 = S_AND_B32 killed %7, killed %8, implicit-def dead $scc
40 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
46 # GCN-LABEL: name: v_fold_and_imm_regimm_32{{$}}
48 # GCN: [[VAL0:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
49 # GCN: FLAT_STORE_DWORD %10, [[VAL0]],
51 # GCN: [[VAL1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
52 # GCN: FLAT_STORE_DWORD %10, [[VAL1]],
54 # GCN: [[VAL2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
55 # GCN: FLAT_STORE_DWORD %10, [[VAL2]],
57 # GCN: [[VAL3:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1234567, implicit $exec
58 # GCN: FLAT_STORE_DWORD %10, [[VAL3]],
60 # GCN: [[VAL4:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 63, implicit $exec
61 # GCN: FLAT_STORE_DWORD %10, [[VAL4]],
63 name: v_fold_and_imm_regimm_32
64 tracksRegLiveness: true
66 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
67 - { reg: '$vgpr0', virtual-reg: '%3' }
70 liveins: $sgpr0_sgpr1, $vgpr0
72 %3:vgpr_32 = COPY $vgpr0
73 %0:sgpr_64 = COPY $sgpr0_sgpr1
74 %4:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
75 %13:vgpr_32 = V_ASHRREV_I32_e64 31, %3, implicit $exec
76 %14:vreg_64 = REG_SEQUENCE %3, %subreg.hi16, %13, %subreg.lo16
77 %15:vreg_64 = V_LSHLREV_B64_e64 2, killed %14, implicit $exec
78 %5:sreg_32_xm0 = COPY %4.sub1
79 %20:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %15.sub0, implicit-def $vcc, implicit $exec
80 %18:vgpr_32 = COPY killed %5
81 %17:vgpr_32 = V_ADDC_U32_e32 %15.sub1, %18, implicit-def $vcc, implicit $vcc, implicit $exec
82 %19:vreg_64 = REG_SEQUENCE %20, %subreg.hi16, killed %17, %subreg.lo16
83 %6:vgpr_32 = V_MOV_B32_e32 982, implicit $exec
84 %8:sreg_32_xm0 = S_MOV_B32 1234567
85 %16:vgpr_32 = V_MOV_B32_e32 63, implicit $exec
87 %9:vgpr_32 = V_AND_B32_e64 %8, %6, implicit $exec
88 FLAT_STORE_DWORD %19, %9, 0, 0, implicit $exec, implicit $flat_scr
90 %10:vgpr_32 = V_AND_B32_e64 %6, %8, implicit $exec
91 FLAT_STORE_DWORD %19, %10, 0, 0, implicit $exec, implicit $flat_scr
93 %11:vgpr_32 = V_AND_B32_e32 %8, %6, implicit $exec
94 FLAT_STORE_DWORD %19, %11, 0, 0, implicit $exec, implicit $flat_scr
96 %12:vgpr_32 = V_AND_B32_e64 %8, %8, implicit $exec
97 FLAT_STORE_DWORD %19, %12, 0, 0, implicit $exec, implicit $flat_scr
99 %13:vgpr_32 = V_AND_B32_e64 %16, %16, implicit $exec
100 FLAT_STORE_DWORD %19, %13, 0, 0, implicit $exec, implicit $flat_scr
107 # GCN-LABEL: name: s_fold_shl_imm_regimm_32{{$}}
108 # GCN: [[VAL:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 4096, implicit $exec
109 # GCN: BUFFER_STORE_DWORD_OFFSET killed [[VAL]],
111 name: s_fold_shl_imm_regimm_32
112 tracksRegLiveness: true
114 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
117 liveins: $sgpr0_sgpr1
119 %0:sgpr_64 = COPY $sgpr0_sgpr1
120 %4:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
121 %5:sreg_32_xm0_xexec = S_MOV_B32 1
122 %6:sreg_32_xm0 = COPY %4.sub1
123 %7:sreg_32_xm0 = COPY %4.sub0
124 %8:sreg_32_xm0 = S_MOV_B32 61440
125 %9:sreg_32_xm0 = S_MOV_B32 -1
126 %10:sgpr_128 = REG_SEQUENCE killed %7, %subreg.hi16, killed %6, %subreg.lo16, killed %9, %subreg.sub0, killed %8, %subreg.sub0_sub1
127 %12:sreg_32_xm0 = S_LSHL_B32 killed %5, 12, implicit-def dead $scc
128 %13:vgpr_32 = COPY %12
129 BUFFER_STORE_DWORD_OFFSET killed %13, killed %10, 0, 0, 0, 0, implicit $exec
135 # GCN-LABEL: name: s_fold_ashr_imm_regimm_32{{$}}
136 # GCN: [[VAL:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 243, implicit $exec
137 # GCN: BUFFER_STORE_DWORD_OFFSET killed [[VAL]], killed %7,
138 name: s_fold_ashr_imm_regimm_32
139 tracksRegLiveness: true
141 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
144 liveins: $sgpr0_sgpr1
146 %0:sgpr_64 = COPY $sgpr0_sgpr1
147 %2:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
148 %3:sreg_32_xm0_xexec = S_MOV_B32 999123
149 %4:sreg_32_xm0 = COPY %2.sub1
150 %5:sreg_32_xm0 = COPY %2.sub0
151 %6:sreg_32_xm0 = S_MOV_B32 61440
152 %7:sreg_32_xm0 = S_MOV_B32 -1
153 %8:sgpr_128 = REG_SEQUENCE killed %5, %subreg.hi16, killed %4, %subreg.lo16, killed %7, %subreg.sub0, killed %6, %subreg.sub0_sub1
154 %10:sreg_32_xm0 = S_ASHR_I32 killed %3, 12, implicit-def dead $scc
155 %11:vgpr_32 = COPY %10
156 BUFFER_STORE_DWORD_OFFSET killed %11, killed %8, 0, 0, 0, 0, implicit $exec
161 # GCN-LABEL: name: v_fold_ashr_imm_regimm_32{{$}}
162 # GCN: [[VAL0:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 3903258, implicit $exec
163 # GCN: FLAT_STORE_DWORD %10, [[VAL0]],
165 # GCN: [[VAL1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 62452139, implicit $exec
166 # GCN: FLAT_STORE_DWORD %10, [[VAL1]],
168 # GCN: [[VAL2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1678031, implicit $exec
169 # GCN: FLAT_STORE_DWORD %10, [[VAL2]],
171 # GCN: [[VAL3:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 3, implicit $exec
172 # GCN: FLAT_STORE_DWORD %10, [[VAL3]],
174 # GCN: [[VAL4:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
175 # GCN: FLAT_STORE_DWORD %10, [[VAL4]],
177 # GCN: [[VAL5:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 62500, implicit $exec
178 # GCN: FLAT_STORE_DWORD %10, [[VAL5]],
180 # GCN: [[VAL6:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 500000, implicit $exec
181 # GCN: FLAT_STORE_DWORD %10, [[VAL6]],
183 # GCN: [[VAL7:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1920, implicit $exec
184 # GCN: FLAT_STORE_DWORD %10, [[VAL7]],
186 # GCN: [[VAL8:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 487907, implicit $exec
187 # GCN: FLAT_STORE_DWORD %10, [[VAL8]],
189 # GCN: [[VAL9:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
190 # GCN: FLAT_STORE_DWORD %10, [[VAL9]],
192 name: v_fold_ashr_imm_regimm_32
193 tracksRegLiveness: true
195 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
196 - { reg: '$vgpr0', virtual-reg: '%2' }
199 liveins: $sgpr0_sgpr1, $vgpr0
201 %2:vgpr_32 = COPY $vgpr0
202 %0:sgpr_64 = COPY $sgpr0_sgpr1
203 %3:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
204 %15:vgpr_32 = V_ASHRREV_I32_e64 31, %2, implicit $exec
205 %16:vreg_64 = REG_SEQUENCE %2, %subreg.hi16, %15, %subreg.lo16
206 %17:vreg_64 = V_LSHLREV_B64_e64 2, killed %16, implicit $exec
207 %9:sreg_32_xm0 = COPY %3.sub1
208 %21:vgpr_32 = V_ADD_CO_U32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
209 %19:vgpr_32 = COPY killed %9
210 %18:vgpr_32 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
211 %20:vreg_64 = REG_SEQUENCE %21, %subreg.hi16, killed %18, %subreg.lo16
212 %10:vgpr_32 = V_MOV_B32_e32 999234234, implicit $exec
213 %24:vgpr_32 = V_MOV_B32_e32 3871, implicit $exec
214 %6:vgpr_32 = V_MOV_B32_e32 1000000, implicit $exec
215 %7:sreg_32_xm0 = S_MOV_B32 13424252
216 %8:sreg_32_xm0 = S_MOV_B32 4
217 %27:sreg_32_xm0 = S_MOV_B32 -4
218 %29:sreg_32_xm0 = S_MOV_B32 1
219 %30:sreg_32_xm0 = S_MOV_B32 3841
220 %31:vgpr_32 = V_MOV_B32_e32 3841, implicit $exec
221 %32:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
223 %11:vgpr_32 = V_ASHRREV_I32_e64 8, %10, implicit $exec
224 FLAT_STORE_DWORD %20, %11, 0, 0, implicit $exec, implicit $flat_scr
226 %12:vgpr_32 = V_ASHRREV_I32_e64 %8, %10, implicit $exec
227 FLAT_STORE_DWORD %20, %12, 0, 0, implicit $exec, implicit $flat_scr
229 %13:vgpr_32 = V_ASHR_I32_e64 %7, 3, implicit $exec
230 FLAT_STORE_DWORD %20, %13, 0, 0, implicit $exec, implicit $flat_scr
232 %14:vgpr_32 = V_ASHR_I32_e64 7, %29, implicit $exec
233 FLAT_STORE_DWORD %20, %14, 0, 0, implicit $exec, implicit $flat_scr
235 %15:vgpr_32 = V_ASHR_I32_e64 %27, %24, implicit $exec
236 FLAT_STORE_DWORD %20, %15, 0, 0, implicit $exec, implicit $flat_scr
238 %22:vgpr_32 = V_ASHR_I32_e64 %6, 4, implicit $exec
239 FLAT_STORE_DWORD %20, %22, 0, 0, implicit $exec, implicit $flat_scr
241 %23:vgpr_32 = V_ASHR_I32_e64 %6, %30, implicit $exec
242 FLAT_STORE_DWORD %20, %23, 0, 0, implicit $exec, implicit $flat_scr
244 %25:vgpr_32 = V_ASHR_I32_e32 %31, %31, implicit $exec
245 FLAT_STORE_DWORD %20, %25, 0, 0, implicit $exec, implicit $flat_scr
247 %26:vgpr_32 = V_ASHRREV_I32_e32 11, %10, implicit $exec
248 FLAT_STORE_DWORD %20, %26, 0, 0, implicit $exec, implicit $flat_scr
250 %28:vgpr_32 = V_ASHR_I32_e32 %27, %32, implicit $exec
251 FLAT_STORE_DWORD %20, %28, 0, 0, implicit $exec, implicit $flat_scr
258 # GCN-LABEL: name: s_fold_lshr_imm_regimm_32{{$}}
259 # GCN: [[VAL:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1048332, implicit $exec
260 # GCN: BUFFER_STORE_DWORD_OFFSET killed [[VAL]], killed %7,
261 name: s_fold_lshr_imm_regimm_32
262 tracksRegLiveness: true
264 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
267 liveins: $sgpr0_sgpr1
269 %0:sgpr_64 = COPY $sgpr0_sgpr1
270 %2:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
271 %3:sreg_32_xm0_xexec = S_MOV_B32 -999123
272 %4:sreg_32_xm0 = COPY %2.sub1
273 %5:sreg_32_xm0 = COPY %2.sub0
274 %6:sreg_32_xm0 = S_MOV_B32 61440
275 %7:sreg_32_xm0 = S_MOV_B32 -1
276 %8:sgpr_128 = REG_SEQUENCE killed %5, %subreg.hi16, killed %4, %subreg.lo16, killed %7, %subreg.sub0, killed %6, %subreg.sub0_sub1
277 %10:sreg_32_xm0 = S_LSHR_B32 killed %3, 12, implicit-def dead $scc
278 %11:vgpr_32 = COPY %10
279 BUFFER_STORE_DWORD_OFFSET killed %11, killed %8, 0, 0, 0, 0, implicit $exec
285 # GCN-LABEL: name: v_fold_lshr_imm_regimm_32{{$}}
286 # GCN: [[VAL0:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 3903258, implicit $exec
287 # GCN: FLAT_STORE_DWORD %10, [[VAL0]],
289 # GCN: [[VAL1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 62452139, implicit $exec
290 # GCN: FLAT_STORE_DWORD %10, [[VAL1]],
292 # GCN: [[VAL2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1678031, implicit $exec
293 # GCN: FLAT_STORE_DWORD %10, [[VAL2]],
295 # GCN: [[VAL3:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 3, implicit $exec
296 # GCN: FLAT_STORE_DWORD %10, [[VAL3]],
298 # GCN: [[VAL4:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
299 # GCN: FLAT_STORE_DWORD %10, [[VAL4]],
301 # GCN: [[VAL5:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 62500, implicit $exec
302 # GCN: FLAT_STORE_DWORD %10, [[VAL5]],
304 # GCN: [[VAL6:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 500000, implicit $exec
305 # GCN: FLAT_STORE_DWORD %10, [[VAL6]],
307 # GCN: [[VAL7:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1920, implicit $exec
308 # GCN: FLAT_STORE_DWORD %10, [[VAL7]],
310 # GCN: [[VAL8:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 487907, implicit $exec
311 # GCN: FLAT_STORE_DWORD %10, [[VAL8]],
313 # GCN: [[VAL9:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741823, implicit $exec
314 # GCN: FLAT_STORE_DWORD %10, [[VAL9]],
316 name: v_fold_lshr_imm_regimm_32
317 tracksRegLiveness: true
319 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
320 - { reg: '$vgpr0', virtual-reg: '%2' }
323 liveins: $sgpr0_sgpr1, $vgpr0
325 %2:vgpr_32 = COPY $vgpr0
326 %0:sgpr_64 = COPY $sgpr0_sgpr1
327 %3:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
328 %15:vgpr_32 = V_ASHRREV_I32_e64 31, %2, implicit $exec
329 %16:vreg_64 = REG_SEQUENCE %2, %subreg.hi16, %15, %subreg.lo16
330 %17:vreg_64 = V_LSHLREV_B64_e64 2, killed %16, implicit $exec
331 %9:sreg_32_xm0 = COPY %3.sub1
332 %21:vgpr_32 = V_ADD_CO_U32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
333 %19:vgpr_32 = COPY killed %9
334 %18:vgpr_32 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
335 %20:vreg_64 = REG_SEQUENCE %21, %subreg.hi16, killed %18, %subreg.lo16
336 %10:vgpr_32 = V_MOV_B32_e32 999234234, implicit $exec
337 %24:vgpr_32 = V_MOV_B32_e32 3871, implicit $exec
338 %6:vgpr_32 = V_MOV_B32_e32 1000000, implicit $exec
339 %7:sreg_32_xm0 = S_MOV_B32 13424252
340 %8:sreg_32_xm0 = S_MOV_B32 4
341 %27:sreg_32_xm0 = S_MOV_B32 -4
342 %29:sreg_32_xm0 = S_MOV_B32 1
343 %30:sreg_32_xm0 = S_MOV_B32 3841
344 %31:vgpr_32 = V_MOV_B32_e32 3841, implicit $exec
345 %32:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
347 %11:vgpr_32 = V_LSHRREV_B32_e64 8, %10, implicit $exec
348 FLAT_STORE_DWORD %20, %11, 0, 0, implicit $exec, implicit $flat_scr
350 %12:vgpr_32 = V_LSHRREV_B32_e64 %8, %10, implicit $exec
351 FLAT_STORE_DWORD %20, %12, 0, 0, implicit $exec, implicit $flat_scr
353 %13:vgpr_32 = V_LSHR_B32_e64 %7, 3, implicit $exec
354 FLAT_STORE_DWORD %20, %13, 0, 0, implicit $exec, implicit $flat_scr
356 %14:vgpr_32 = V_LSHR_B32_e64 7, %29, implicit $exec
357 FLAT_STORE_DWORD %20, %14, 0, 0, implicit $exec, implicit $flat_scr
359 %15:vgpr_32 = V_LSHR_B32_e64 %27, %24, implicit $exec
360 FLAT_STORE_DWORD %20, %15, 0, 0, implicit $exec, implicit $flat_scr
362 %22:vgpr_32 = V_LSHR_B32_e64 %6, 4, implicit $exec
363 FLAT_STORE_DWORD %20, %22, 0, 0, implicit $exec, implicit $flat_scr
365 %23:vgpr_32 = V_LSHR_B32_e64 %6, %30, implicit $exec
366 FLAT_STORE_DWORD %20, %23, 0, 0, implicit $exec, implicit $flat_scr
368 %25:vgpr_32 = V_LSHR_B32_e32 %31, %31, implicit $exec
369 FLAT_STORE_DWORD %20, %25, 0, 0, implicit $exec, implicit $flat_scr
371 %26:vgpr_32 = V_LSHRREV_B32_e32 11, %10, implicit $exec
372 FLAT_STORE_DWORD %20, %26, 0, 0, implicit $exec, implicit $flat_scr
374 %28:vgpr_32 = V_LSHR_B32_e32 %27, %32, implicit $exec
375 FLAT_STORE_DWORD %20, %28, 0, 0, implicit $exec, implicit $flat_scr
380 # There is only an undef use operand for %1, so there is no
381 # corresponding defining instruction
383 # GCN-LABEL: name: undefined_vreg_operand{{$}}
385 # GCN-NEXT: FLAT_STORE_DWORD undef %3:vreg_64, undef %2:vgpr_32,
386 # GCN-NEXT: S_ENDPGM 0
387 name: undefined_vreg_operand
388 tracksRegLiveness: true
391 %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
392 %2:vgpr_32 = V_XOR_B32_e64 killed %0, undef %1:vgpr_32, implicit $exec
393 FLAT_STORE_DWORD undef %3:vreg_64, %2, 0, 0, implicit $exec, implicit $flat_scr
398 # Make sure there is no crash if one of the operands is a physical register
399 # GCN-LABEL: name: constant_fold_physreg_op{{$}}
400 # GCN: %3:sreg_64 = S_AND_B64 $exec, 0, implicit-def dead $scc
402 name: constant_fold_physreg_op
403 tracksRegLiveness: true
406 successors: %bb.1, %bb.3
407 liveins: $vgpr0, $sgpr4_sgpr5
409 %19:sreg_64 = IMPLICIT_DEF
410 %0:sreg_64 = SI_IF killed %19, %bb.3, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
414 %6:sreg_64 = S_MOV_B64 0
415 %7:sreg_64 = S_AND_B64 $exec, killed %6, implicit-def dead $scc
420 SI_END_CF %0, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
421 S_ENDPGM 0, implicit $vcc
425 # GCN-LABEL: name: s_fold_andn2_imm_regimm_32{{$}}
426 # GCN: [[VAL:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1233024, implicit $exec
427 # GCN: BUFFER_STORE_DWORD_OFFSET killed [[VAL]],
428 name: s_fold_andn2_imm_regimm_32
429 tracksRegLiveness: true
431 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
434 liveins: $sgpr0_sgpr1
436 %0:sgpr_64 = COPY $sgpr0_sgpr1
437 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
438 %2:sreg_32_xm0 = COPY %1.sub1
439 %3:sreg_32_xm0 = COPY %1.sub0
440 %4:sreg_32_xm0 = S_MOV_B32 61440
441 %5:sreg_32_xm0 = S_MOV_B32 -1
442 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
443 %7:sreg_32_xm0 = S_MOV_B32 1234567
444 %8:sreg_32_xm0 = S_MOV_B32 9999
445 %9:sreg_32_xm0 = S_ANDN2_B32 killed %7, killed %8, implicit-def dead $scc
446 %10:vgpr_32 = COPY %9
447 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
453 # GCN-LABEL: name: s_fold_or_imm_regimm_32{{$}}
454 # GCN: %10:vgpr_32 = V_MOV_B32_e32 1243023, implicit $exec
455 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
456 name: s_fold_or_imm_regimm_32
458 exposesReturnsTwice: false
460 regBankSelected: false
462 tracksRegLiveness: true
464 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
467 liveins: $sgpr0_sgpr1
469 %0:sgpr_64 = COPY $sgpr0_sgpr1
470 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
471 %2:sreg_32_xm0 = COPY %1.sub1
472 %3:sreg_32_xm0 = COPY %1.sub0
473 %4:sreg_32_xm0 = S_MOV_B32 61440
474 %5:sreg_32_xm0 = S_MOV_B32 -1
475 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
476 %7:sreg_32_xm0 = S_MOV_B32 1234567
477 %8:sreg_32_xm0 = S_MOV_B32 9999
478 %9:sreg_32_xm0 = S_OR_B32 killed %7, killed %8, implicit-def dead $scc
479 %10:vgpr_32 = COPY %9
480 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
486 # GCN-LABEL: name: v_fold_or_imm_regimm_32{{$}}
488 # GCN: %14:vgpr_32 = V_MOV_B32_e32 1234903, implicit $exec
489 # GCN: FLAT_STORE_DWORD %10, %14,
491 # GCN: %15:vgpr_32 = V_MOV_B32_e32 1234903, implicit $exec
492 # GCN: FLAT_STORE_DWORD %10, %15
494 # GCN: %16:vgpr_32 = V_MOV_B32_e32 1234903, implicit $exec
495 # GCN: FLAT_STORE_DWORD %10, %16,
497 # GCN: %17:vgpr_32 = V_MOV_B32_e32 1234567, implicit $exec
498 # GCN: FLAT_STORE_DWORD %10, %17,
500 # GCN: %3:vgpr_32 = V_MOV_B32_e32 63, implicit $exec
501 # GCN: FLAT_STORE_DWORD %10, %3,
503 name: v_fold_or_imm_regimm_32
505 exposesReturnsTwice: false
507 regBankSelected: false
509 tracksRegLiveness: true
511 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
512 - { reg: '$vgpr0', virtual-reg: '%3' }
515 liveins: $sgpr0_sgpr1, $vgpr0
517 %3:vgpr_32 = COPY $vgpr0
518 %0:sgpr_64 = COPY $sgpr0_sgpr1
519 %4:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
520 %13:vgpr_32 = V_ASHRREV_I32_e64 31, %3, implicit $exec
521 %14:vreg_64 = REG_SEQUENCE %3, %subreg.sub0, %13, %subreg.sub1
522 %15:vreg_64 = V_LSHLREV_B64_e64 2, killed %14, implicit $exec
523 %5:sreg_32_xm0 = COPY %4.sub1
524 %20:vgpr_32 = V_ADD_CO_U32_e32 %4.sub0, %15.sub0, implicit-def $vcc, implicit $exec
525 %18:vgpr_32 = COPY killed %5
526 %17:vgpr_32 = V_ADDC_U32_e32 %15.sub1, %18, implicit-def $vcc, implicit $vcc, implicit $exec
527 %19:vreg_64 = REG_SEQUENCE %20, %subreg.sub0, killed %17, %subreg.sub1
528 %6:vgpr_32 = V_MOV_B32_e32 982, implicit $exec
529 %8:sreg_32_xm0 = S_MOV_B32 1234567
530 %16:vgpr_32 = V_MOV_B32_e32 63, implicit $exec
531 %9:vgpr_32 = V_OR_B32_e64 %8, %6, implicit $exec
532 FLAT_STORE_DWORD %19, %9, 0, 0, implicit $exec, implicit $flat_scr
533 %10:vgpr_32 = V_OR_B32_e64 %6, %8, implicit $exec
534 FLAT_STORE_DWORD %19, %10, 0, 0, implicit $exec, implicit $flat_scr
535 %11:vgpr_32 = V_OR_B32_e32 %8, %6, implicit $exec
536 FLAT_STORE_DWORD %19, %11, 0, 0, implicit $exec, implicit $flat_scr
537 %12:vgpr_32 = V_OR_B32_e64 %8, %8, implicit $exec
538 FLAT_STORE_DWORD %19, %12, 0, 0, implicit $exec, implicit $flat_scr
539 %13:vgpr_32 = V_OR_B32_e64 %16, %16, implicit $exec
540 FLAT_STORE_DWORD %19, %13, 0, 0, implicit $exec, implicit $flat_scr
546 # GCN-LABEL: name: s_fold_orn2_imm_regimm_32{{$}}
547 # GCN: %10:vgpr_32 = V_MOV_B32_e32 -8457, implicit $exec
548 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
549 name: s_fold_orn2_imm_regimm_32
551 exposesReturnsTwice: false
553 regBankSelected: false
555 tracksRegLiveness: true
557 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
560 liveins: $sgpr0_sgpr1
562 %0:sgpr_64 = COPY $sgpr0_sgpr1
563 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
564 %2:sreg_32_xm0 = COPY %1.sub1
565 %3:sreg_32_xm0 = COPY %1.sub0
566 %4:sreg_32_xm0 = S_MOV_B32 61440
567 %5:sreg_32_xm0 = S_MOV_B32 -1
568 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
569 %7:sreg_32_xm0 = S_MOV_B32 1234567
570 %8:sreg_32_xm0 = S_MOV_B32 9999
571 %9:sreg_32_xm0 = S_ORN2_B32 killed %7, killed %8, implicit-def dead $scc
572 %10:vgpr_32 = COPY %9
573 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
579 # GCN-LABEL: name: s_fold_nand_imm_regimm_32{{$}}
580 # GCN: %10:vgpr_32 = V_MOV_B32_e32 -1544, implicit $exec
581 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
582 name: s_fold_nand_imm_regimm_32
584 exposesReturnsTwice: false
586 regBankSelected: false
588 tracksRegLiveness: true
590 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
593 liveins: $sgpr0_sgpr1
595 %0:sgpr_64 = COPY $sgpr0_sgpr1
596 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
597 %2:sreg_32_xm0 = COPY %1.sub1
598 %3:sreg_32_xm0 = COPY %1.sub0
599 %4:sreg_32_xm0 = S_MOV_B32 61440
600 %5:sreg_32_xm0 = S_MOV_B32 -1
601 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
602 %7:sreg_32_xm0 = S_MOV_B32 1234567
603 %8:sreg_32_xm0 = S_MOV_B32 9999
604 %9:sreg_32_xm0 = S_NAND_B32 killed %7, killed %8, implicit-def dead $scc
605 %10:vgpr_32 = COPY %9
606 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
612 # GCN-LABEL: name: s_fold_nor_imm_regimm_32{{$}}
613 # GCN: %10:vgpr_32 = V_MOV_B32_e32 -1243024, implicit $exec
614 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
615 name: s_fold_nor_imm_regimm_32
617 exposesReturnsTwice: false
619 regBankSelected: false
621 tracksRegLiveness: true
623 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
626 liveins: $sgpr0_sgpr1
628 %0:sgpr_64 = COPY $sgpr0_sgpr1
629 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
630 %2:sreg_32_xm0 = COPY %1.sub1
631 %3:sreg_32_xm0 = COPY %1.sub0
632 %4:sreg_32_xm0 = S_MOV_B32 61440
633 %5:sreg_32_xm0 = S_MOV_B32 -1
634 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
635 %7:sreg_32_xm0 = S_MOV_B32 1234567
636 %8:sreg_32_xm0 = S_MOV_B32 9999
637 %9:sreg_32_xm0 = S_NOR_B32 killed %7, killed %8, implicit-def dead $scc
638 %10:vgpr_32 = COPY %9
639 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
645 # GCN-LABEL: name: s_fold_xnor_imm_regimm_32{{$}}
646 # GCN: %10:vgpr_32 = V_MOV_B32_e32 -1241481, implicit $exec
647 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
648 name: s_fold_xnor_imm_regimm_32
650 exposesReturnsTwice: false
652 regBankSelected: false
654 tracksRegLiveness: true
656 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
659 liveins: $sgpr0_sgpr1
661 %0:sgpr_64 = COPY $sgpr0_sgpr1
662 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
663 %2:sreg_32_xm0 = COPY %1.sub1
664 %3:sreg_32_xm0 = COPY %1.sub0
665 %4:sreg_32_xm0 = S_MOV_B32 61440
666 %5:sreg_32_xm0 = S_MOV_B32 -1
667 %6:sgpr_128 = REG_SEQUENCE killed %2, %subreg.sub0, killed %3, %subreg.sub1, killed %4, %subreg.sub2, killed %5, %subreg.sub3
668 %7:sreg_32_xm0 = S_MOV_B32 1234567
669 %8:sreg_32_xm0 = S_MOV_B32 9999
670 %9:sreg_32_xm0 = S_XNOR_B32 killed %7, killed %8, implicit-def dead $scc
671 %10:vgpr_32 = COPY %9
672 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, implicit $exec
678 # GCN-LABEL: name: v_fold_shl_imm_regimm_32{{$}}
680 # GCN: %16:vgpr_32 = V_MOV_B32_e32 40955904, implicit $exec
681 # GCN: FLAT_STORE_DWORD %10, %16,
683 # GCN: %17:vgpr_32 = V_MOV_B32_e32 24, implicit $exec
684 # GCN: FLAT_STORE_DWORD %10, %17,
686 # GCN: %18:vgpr_32 = V_MOV_B32_e32 4096, implicit $exec
687 # GCN: FLAT_STORE_DWORD %10, %18,
689 # GCN: %19:vgpr_32 = V_MOV_B32_e32 24, implicit $exec
690 # GCN: FLAT_STORE_DWORD %10, %19,
692 # GCN: %3:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
693 # GCN: FLAT_STORE_DWORD %10, %3,
695 # GCN: %20:vgpr_32 = V_MOV_B32_e32 4096, implicit $exec
696 # GCN: FLAT_STORE_DWORD %10, %20,
698 # GCN: %21:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
699 # GCN: FLAT_STORE_DWORD %10, %21,
701 # GCN: %22:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
702 # GCN: FLAT_STORE_DWORD %10, %22,
704 # GCN: %23:vgpr_32 = V_MOV_B32_e32 7927808, implicit $exec
705 # GCN: FLAT_STORE_DWORD %10, %23,
707 # GCN: %24:vgpr_32 = V_MOV_B32_e32 -8, implicit $exec
708 # GCN: FLAT_STORE_DWORD %10, %24,
710 name: v_fold_shl_imm_regimm_32
712 exposesReturnsTwice: false
714 regBankSelected: false
716 tracksRegLiveness: true
718 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
719 - { reg: '$vgpr0', virtual-reg: '%2' }
722 liveins: $sgpr0_sgpr1, $vgpr0
724 %2:vgpr_32 = COPY $vgpr0
725 %0:sgpr_64 = COPY $sgpr0_sgpr1
726 %3:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0 :: (non-temporal dereferenceable invariant load (s64) from `ptr addrspace(4) undef`, addrspace 4)
727 %15:vgpr_32 = V_ASHRREV_I32_e64 31, %2, implicit $exec
728 %16:vreg_64 = REG_SEQUENCE %2, %subreg.sub0, %15, %subreg.sub1
729 %17:vreg_64 = V_LSHLREV_B64_e64 2, killed %16, implicit $exec
730 %9:sreg_32_xm0 = COPY %3.sub1
731 %21:vgpr_32 = V_ADD_CO_U32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
732 %19:vgpr_32 = COPY killed %9
733 %18:vgpr_32 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
734 %20:vreg_64 = REG_SEQUENCE %21, %subreg.sub0, killed %18, %subreg.sub1
735 %10:vgpr_32 = V_MOV_B32_e32 9999, implicit $exec
736 %24:vgpr_32 = V_MOV_B32_e32 3871, implicit $exec
737 %6:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
738 %7:sreg_32_xm0 = S_MOV_B32 1
739 %27:sreg_32_xm0 = S_MOV_B32 -4
740 %11:vgpr_32 = V_LSHLREV_B32_e64 12, %10, implicit $exec
741 FLAT_STORE_DWORD %20, %11, 0, 0, implicit $exec, implicit $flat_scr
742 %12:vgpr_32 = V_LSHLREV_B32_e64 %7, 12, implicit $exec
743 FLAT_STORE_DWORD %20, %12, 0, 0, implicit $exec, implicit $flat_scr
744 %13:vgpr_32 = V_LSHL_B32_e64 %7, 12, implicit $exec
745 FLAT_STORE_DWORD %20, %13, 0, 0, implicit $exec, implicit $flat_scr
746 %14:vgpr_32 = V_LSHL_B32_e64 12, %7, implicit $exec
747 FLAT_STORE_DWORD %20, %14, 0, 0, implicit $exec, implicit $flat_scr
748 %15:vgpr_32 = V_LSHL_B32_e64 12, %24, implicit $exec
749 FLAT_STORE_DWORD %20, %15, 0, 0, implicit $exec, implicit $flat_scr
750 %22:vgpr_32 = V_LSHL_B32_e64 %6, 12, implicit $exec
751 FLAT_STORE_DWORD %20, %22, 0, 0, implicit $exec, implicit $flat_scr
752 %23:vgpr_32 = V_LSHL_B32_e64 %6, 32, implicit $exec
753 FLAT_STORE_DWORD %20, %23, 0, 0, implicit $exec, implicit $flat_scr
754 %25:vgpr_32 = V_LSHL_B32_e32 %6, %6, implicit $exec
755 FLAT_STORE_DWORD %20, %25, 0, 0, implicit $exec, implicit $flat_scr
756 %26:vgpr_32 = V_LSHLREV_B32_e32 11, %24, implicit $exec
757 FLAT_STORE_DWORD %20, %26, 0, 0, implicit $exec, implicit $flat_scr
758 %28:vgpr_32 = V_LSHL_B32_e32 %27, %6, implicit $exec
759 FLAT_STORE_DWORD %20, %28, 0, 0, implicit $exec, implicit $flat_scr
764 # This used to incorrectly interpret V_MOV_B32_sdwa as being a move
765 # immediate, and interpreting the src0_modifiers field as a
766 # materialized immediate.
769 # GCN-LABEL: name: no_fold_sdwa_mov_imm
770 # GCN: %2:vgpr_32 = V_MOV_B32_sdwa 0, %0, 0, 5, 2, 4, implicit $exec, implicit %0(tied-def 0)
771 # GCN-NEXT: [[SHIFT:%[0-9]+]]:vgpr_32 = V_LSHRREV_B32_e64 16, %2, implicit $exec
772 # GCN-NEXT: S_ENDPGM 0, implicit [[SHIFT]]
774 name: no_fold_sdwa_mov_imm
776 exposesReturnsTwice: false
778 regBankSelected: false
780 tracksRegLiveness: true
785 %0:vgpr_32 = COPY $vgpr0
786 %1:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
787 %2:vgpr_32 = V_MOV_B32_sdwa 0, %0:vgpr_32, 0, 5, 2, 4, implicit $exec, implicit %0:vgpr_32(tied-def 0)
788 %3:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
789 %4:vgpr_32 = V_LSHRREV_B32_e64 %3:vgpr_32, %2:vgpr_32, implicit $exec
790 S_ENDPGM 0, implicit %4
795 name: constant_s_and_b32_only_implicit_def_scc_is_used
796 tracksRegLiveness: true
799 ; GCN-LABEL: name: constant_s_and_b32_only_implicit_def_scc_is_used
800 ; GCN: [[S_AND_B32_:%[0-9]+]]:sgpr_32 = S_AND_B32 32, 15, implicit-def $scc
801 ; GCN-NEXT: S_ENDPGM 0, implicit $scc
802 %0:sgpr_32 = S_MOV_B32 32
803 %1:sgpr_32 = S_MOV_B32 15
804 %2:sgpr_32 = S_AND_B32 %0, %1, implicit-def $scc
805 S_ENDPGM 0, implicit $scc
810 name: constant_s_and_b32_implicit_def_scc_is_used
811 tracksRegLiveness: true
814 ; GCN-LABEL: name: constant_s_and_b32_implicit_def_scc_is_used
815 ; GCN: [[S_AND_B32_:%[0-9]+]]:sgpr_32 = S_AND_B32 32, 15, implicit-def $scc
816 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_AND_B32_]], implicit $scc
817 %0:sgpr_32 = S_MOV_B32 32
818 %1:sgpr_32 = S_MOV_B32 15
819 %2:sgpr_32 = S_AND_B32 %0, %1, implicit-def $scc
820 S_ENDPGM 0, implicit %2, implicit $scc
825 name: constant_s_and_b32_only_implicit_def_scc_is_dead
826 tracksRegLiveness: true
829 ; GCN-LABEL: name: constant_s_and_b32_only_implicit_def_scc_is_dead
830 ; GCN: S_ENDPGM 0, implicit undef $scc
831 %0:sgpr_32 = S_MOV_B32 32
832 %1:sgpr_32 = S_MOV_B32 15
833 %2:sgpr_32 = S_AND_B32 %0, %1, implicit-def dead $scc
834 S_ENDPGM 0, implicit undef $scc
839 name: constant_s_or_b32_only_implicit_def_scc_is_used
840 tracksRegLiveness: true
843 ; GCN-LABEL: name: constant_s_or_b32_only_implicit_def_scc_is_used
844 ; GCN: [[S_OR_B32_:%[0-9]+]]:sgpr_32 = S_OR_B32 32, 15, implicit-def $scc
845 ; GCN-NEXT: S_ENDPGM 0, implicit $scc
846 %0:sgpr_32 = S_MOV_B32 32
847 %1:sgpr_32 = S_MOV_B32 15
848 %2:sgpr_32 = S_OR_B32 %0, %1, implicit-def $scc
849 S_ENDPGM 0, implicit $scc
854 name: constant_s_xor_b32_only_implicit_def_scc_is_used
855 tracksRegLiveness: true
858 ; GCN-LABEL: name: constant_s_xor_b32_only_implicit_def_scc_is_used
859 ; GCN: [[S_XOR_B32_:%[0-9]+]]:sgpr_32 = S_XOR_B32 32, 15, implicit-def $scc
860 ; GCN-NEXT: S_ENDPGM 0, implicit $scc
861 %0:sgpr_32 = S_MOV_B32 32
862 %1:sgpr_32 = S_MOV_B32 15
863 %2:sgpr_32 = S_XOR_B32 %0, %1, implicit-def $scc
864 S_ENDPGM 0, implicit $scc
869 name: constant_s_not_b32_only_implicit_def_scc_is_used
870 tracksRegLiveness: true
873 ; GCN-LABEL: name: constant_s_not_b32_only_implicit_def_scc_is_used
874 ; GCN: [[S_NOT_B32_:%[0-9]+]]:sgpr_32 = S_NOT_B32 32, implicit-def $scc
875 ; GCN-NEXT: S_ENDPGM 0, implicit $scc
876 %0:sgpr_32 = S_MOV_B32 32
877 %1:sgpr_32 = S_NOT_B32 %0, implicit-def $scc
878 S_ENDPGM 0, implicit $scc
882 # Really really implicit operand
884 name: constant_v_and_b32_implicit_def_scc_is_used
885 tracksRegLiveness: true
888 ; GCN-LABEL: name: constant_v_and_b32_implicit_def_scc_is_used
889 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 15, implicit $exec
890 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 32, [[V_MOV_B32_e32_]], implicit $exec, implicit-def $scc
891 ; GCN-NEXT: S_ENDPGM 0, implicit $scc
892 %0:vgpr_32 = V_MOV_B32_e32 32, implicit $exec
893 %1:vgpr_32 = V_MOV_B32_e32 15, implicit $exec
894 %2:vgpr_32 = V_AND_B32_e32 %0, %1, implicit $exec, implicit-def $scc
895 S_ENDPGM 0, implicit $scc
900 name: constant_v_and_b32_implicit_def_vreg_is_used
901 tracksRegLiveness: true
904 ; GCN-LABEL: name: constant_v_and_b32_implicit_def_vreg_is_used
905 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 15, implicit $exec
906 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 32, [[V_MOV_B32_e32_]], implicit $exec, implicit-def %3
907 ; GCN-NEXT: S_ENDPGM 0, implicit %3
908 %0:vgpr_32 = V_MOV_B32_e32 32, implicit $exec
909 %1:vgpr_32 = V_MOV_B32_e32 15, implicit $exec
910 %2:vgpr_32 = V_AND_B32_e32 %0, %1, implicit $exec, implicit-def %3:vgpr_32
911 S_ENDPGM 0, implicit %3
915 name: constant_v_and_b32_implicit_use
916 tracksRegLiveness: true
919 ; GCN-LABEL: name: constant_v_and_b32_implicit_use
920 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
921 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_MOV_B32_e32_]]
922 %0:vgpr_32 = V_MOV_B32_e32 32, implicit $exec
923 %1:vgpr_32 = V_MOV_B32_e32 15, implicit $exec
924 %2:vgpr_32 = V_MOV_B32_e32 24, implicit $exec
925 %3:vgpr_32 = V_AND_B32_e32 %0, %1, implicit $exec, implicit %2:vgpr_32
926 S_ENDPGM 0, implicit %3