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 frameOffsetReg: '$sgpr32'
14 stackPtrOffsetReg: '$sgpr32'
16 privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
17 privateSegmentWaveByteOffset: { reg: '$sgpr33' }
19 ; CHECK-LABEL: name: multi_def_dead_reg_subreg_check
21 ; CHECK-NEXT: successors: %bb.1(0x80000000)
22 ; CHECK-NEXT: liveins: $sgpr6_sgpr7
24 ; CHECK-NEXT: undef [[V_MOV_B32_e32_:%[0-9]+]].sub3:vreg_512 = V_MOV_B32_e32 0, implicit $exec
25 ; CHECK-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
26 ; CHECK-NEXT: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 0, [[V_MOV_B32_e32_1]], implicit $exec
27 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_512 = COPY [[V_MOV_B32_e32_]]
30 ; CHECK-NEXT: successors: %bb.1(0x80000000)
32 ; CHECK-NEXT: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_]].sub3, undef %5:vgpr_32, $sgpr24_sgpr25_sgpr26_sgpr27, $sgpr32, 0, 0, 0, implicit $exec :: (store (s32), align 8, addrspace 5)
33 ; CHECK-NEXT: dead [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 undef %7:vgpr_32, 0, 0, implicit $exec
34 ; CHECK-NEXT: dead [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[V_MOV_B32_e32_1]], 0, 0, implicit $exec
35 ; CHECK-NEXT: dead [[DS_READ_B128_gfx9_:%[0-9]+]]:vreg_128 = DS_READ_B128_gfx9 [[V_ADD_U32_e32_]], 0, 0, implicit $exec
36 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
37 ; CHECK-NEXT: undef [[COPY2:%[0-9]+]].sub1:vreg_512 = COPY [[COPY]].sub1
38 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851978 /* regdef:VGPR_16 */, def dead [[COPY1]], 851978 /* regdef:VGPR_16 */, def dead [[COPY]].sub1, 2147483657 /* reguse tiedto:$0 */, [[COPY1]], 2147549193 /* reguse tiedto:$1 */, [[COPY]].sub1
39 ; CHECK-NEXT: [[COPY2:%[0-9]+]].sub0:vreg_512 = COPY [[COPY]].sub0
40 ; CHECK-NEXT: [[COPY2:%[0-9]+]].sub3:vreg_512 = COPY [[COPY]].sub3
41 ; CHECK-NEXT: [[V_MOV_B32_e32_2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
42 ; CHECK-NEXT: dead [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 4, [[V_MOV_B32_e32_2]], implicit-def dead $vcc, implicit $exec
43 ; CHECK-NEXT: [[COPY2:%[0-9]+]].sub2:vreg_512 = COPY undef [[V_MOV_B32_e32_1]]
44 ; CHECK-NEXT: [[COPY2:%[0-9]+]].sub5:vreg_512 = COPY undef [[V_MOV_B32_e32_1]]
45 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_512 = COPY [[COPY2]]
46 ; CHECK-NEXT: S_BRANCH %bb.1
50 undef %0.sub3:vreg_512 = V_MOV_B32_e32 0, implicit $exec
51 %1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
52 %2:vgpr_32 = V_ADD_U32_e32 0, %1, implicit $exec
53 %3:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
57 BUFFER_STORE_DWORD_OFFEN %0.sub3, undef %5:vgpr_32, $sgpr24_sgpr25_sgpr26_sgpr27, $sgpr32, 0, 0, 0, implicit $exec :: (store (s32), align 8, addrspace 5)
58 %6:vgpr_32 = DS_READ_B32_gfx9 undef %7:vgpr_32, 0, 0, implicit $exec
59 %8:vreg_64 = DS_READ_B64_gfx9 %1, 0, 0, implicit $exec
60 %9:vreg_128 = DS_READ_B128_gfx9 %2, 0, 0, implicit $exec
61 %10:vgpr_32 = V_ADD_CO_U32_e32 4, %3, implicit-def dead $vcc, implicit $exec
62 undef %11.sub0:vreg_512 = COPY %4.sub0
63 %12:vgpr_32 = COPY %4.sub0
64 %11.sub1:vreg_512 = COPY %4.sub1
65 INLINEASM &"", 1, 851978, def dead %12, 851978, def dead %4.sub1, 2147483657, %12, 2147549193, %4.sub1
66 %11.sub2:vreg_512 = COPY undef %1
67 %11.sub3:vreg_512 = COPY %4.sub3
68 %11.sub5:vreg_512 = COPY undef %1
69 %4:vreg_512 = COPY %11