1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -verify-machineinstrs -run-pass=machine-scheduler -verify-misched -o - %s | FileCheck %s
4 # This would assert that a dead def should have no uses, but the dead
5 # def and use have different subreg indices.
8 name: multi_def_dead_reg_subreg_check
9 tracksRegLiveness: true
12 scratchRSrcReg: '$sgpr24_sgpr25_sgpr26_sgpr27'
13 scratchWaveOffsetReg: '$sgpr32'
14 frameOffsetReg: '$sgpr32'
15 stackPtrOffsetReg: '$sgpr32'
17 privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
18 privateSegmentWaveByteOffset: { reg: '$sgpr33' }
20 ; CHECK-LABEL: name: multi_def_dead_reg_subreg_check
22 ; CHECK: successors: %bb.1(0x80000000)
23 ; CHECK: liveins: $sgpr6_sgpr7
24 ; CHECK: undef %0.sub3:vreg_512 = V_MOV_B32_e32 0, implicit $exec
25 ; CHECK: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
26 ; CHECK: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 0, [[V_MOV_B32_e32_]], implicit $exec
27 ; CHECK: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
28 ; CHECK: [[COPY:%[0-9]+]]:vreg_512 = COPY %0
30 ; CHECK: successors: %bb.1(0x80000000)
31 ; CHECK: BUFFER_STORE_DWORD_OFFEN %0.sub3, undef %5:vgpr_32, $sgpr24_sgpr25_sgpr26_sgpr27, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 4, align 8, addrspace 5)
32 ; CHECK: dead %6:vgpr_32 = DS_READ_B32_gfx9 undef %7:vgpr_32, 0, 0, implicit $exec
33 ; CHECK: dead %8:vreg_64 = DS_READ_B64_gfx9 [[V_MOV_B32_e32_]], 0, 0, implicit $exec
34 ; CHECK: dead %9:vreg_128 = DS_READ_B128_gfx9 [[V_ADD_U32_e32_]], 0, 0, implicit $exec
35 ; CHECK: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
36 ; CHECK: undef %11.sub1:vreg_512 = COPY [[COPY]].sub1
37 ; CHECK: INLINEASM &"", 1, 851978, def dead [[COPY1]], 851978, def dead [[COPY]].sub1, 2147483657, [[COPY1]], 2147549193, [[COPY]].sub1
38 ; CHECK: %11.sub0:vreg_512 = COPY [[COPY]].sub0
39 ; CHECK: %11.sub3:vreg_512 = COPY [[COPY]].sub3
40 ; CHECK: dead %10:vgpr_32 = V_ADD_I32_e32 4, [[V_MOV_B32_e32_1]], implicit-def dead $vcc, implicit $exec
41 ; CHECK: %11.sub2:vreg_512 = COPY undef [[V_MOV_B32_e32_]]
42 ; CHECK: %11.sub5:vreg_512 = COPY undef [[V_MOV_B32_e32_]]
43 ; CHECK: [[COPY2:%[0-9]+]]:vreg_512 = COPY %11
44 ; CHECK: S_BRANCH %bb.1
48 undef %0.sub3:vreg_512 = V_MOV_B32_e32 0, implicit $exec
49 %1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
50 %2:vgpr_32 = V_ADD_U32_e32 0, %1, implicit $exec
51 %3:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
55 BUFFER_STORE_DWORD_OFFEN %0.sub3, undef %5:vgpr_32, $sgpr24_sgpr25_sgpr26_sgpr27, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 4, align 8, addrspace 5)
56 %6:vgpr_32 = DS_READ_B32_gfx9 undef %7:vgpr_32, 0, 0, implicit $exec
57 %8:vreg_64 = DS_READ_B64_gfx9 %1, 0, 0, implicit $exec
58 %9:vreg_128 = DS_READ_B128_gfx9 %2, 0, 0, implicit $exec
59 %10:vgpr_32 = V_ADD_I32_e32 4, %3, implicit-def dead $vcc, implicit $exec
60 undef %11.sub0:vreg_512 = COPY %4.sub0
61 %12:vgpr_32 = COPY %4.sub0
62 %11.sub1:vreg_512 = COPY %4.sub1
63 INLINEASM &"", 1, 851978, def dead %12, 851978, def dead %4.sub1, 2147483657, %12, 2147549193, %4.sub1
64 %11.sub2:vreg_512 = COPY undef %1
65 %11.sub3:vreg_512 = COPY %4.sub3
66 %11.sub5:vreg_512 = COPY undef %1
67 %4:vreg_512 = COPY %11