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 # Deciding which lanes are killed needs to account for other defs in the
7 # addVRegDefDeps would encounter the %0.sub0 def and erase %0 from
8 # current vreg uses because it shared no lanes with %0.sub1 use on the
9 # nop. It then didn't see the lanemask when it reached the second
10 # subreg def, and failed to add the necessary dependency between the
14 name: no_live_subrange_at_use
15 tracksRegLiveness: true
19 ; CHECK-LABEL: name: no_live_subrange_at_use
21 ; CHECK-NEXT: successors: %bb.1(0x80000000)
23 ; CHECK-NEXT: undef %0.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
24 ; CHECK-NEXT: %0.sub1:vreg_64 = V_MOV_B32_e32 0, implicit $exec
25 ; CHECK-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
28 ; CHECK-NEXT: successors: %bb.1(0x80000000)
30 ; CHECK-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[V_MOV_B32_e32_]], 0, 0, implicit $exec :: (load (s32), addrspace 3)
31 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851978 /* regdef:VGPR_16 */, def %0, 2147549193 /* reguse tiedto:$1 */, %0(tied-def 3)
32 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851977 /* reguse:VGPR_16 */, [[DS_READ_B32_gfx9_]]
33 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851978 /* regdef:VGPR_16 */, def undef %0.sub0, 851978 /* regdef:VGPR_16 */, def undef %0.sub1
34 ; CHECK-NEXT: S_NOP 0, implicit %0.sub1
35 ; CHECK-NEXT: $sgpr10 = S_MOV_B32 -1
36 ; CHECK-NEXT: S_BRANCH %bb.1
38 undef %0.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
39 %0.sub1:vreg_64 = V_MOV_B32_e32 0, implicit $exec
40 %1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
43 %2:vgpr_32 = DS_READ_B32_gfx9 %1, 0, 0, implicit $exec :: (load (s32), addrspace 3)
44 INLINEASM &"", 1, 851978, def %0, 2147549193, %0(tied-def 3)
45 INLINEASM &"", 1, 851977, %2
46 INLINEASM &"", 1, 851978, def undef %0.sub0, 851978, def %0.sub1
47 S_NOP 0, implicit %0.sub1
48 $sgpr10 = S_MOV_B32 -1
53 # Different operand order
55 name: no_live_subrange_at_use_swap
56 tracksRegLiveness: true
60 ; CHECK-LABEL: name: no_live_subrange_at_use_swap
62 ; CHECK-NEXT: successors: %bb.1(0x80000000)
64 ; CHECK-NEXT: undef %0.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
65 ; CHECK-NEXT: %0.sub1:vreg_64 = V_MOV_B32_e32 0, implicit $exec
66 ; CHECK-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
69 ; CHECK-NEXT: successors: %bb.1(0x80000000)
71 ; CHECK-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[V_MOV_B32_e32_]], 0, 0, implicit $exec :: (load (s32), addrspace 3)
72 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851978 /* regdef:VGPR_16 */, def %0, 2147549193 /* reguse tiedto:$1 */, %0(tied-def 3)
73 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851977 /* reguse:VGPR_16 */, [[DS_READ_B32_gfx9_]]
74 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 851978 /* regdef:VGPR_16 */, def undef %0.sub1, 851978 /* regdef:VGPR_16 */, def undef %0.sub0
75 ; CHECK-NEXT: S_NOP 0, implicit %0.sub1
76 ; CHECK-NEXT: $sgpr10 = S_MOV_B32 -1
77 ; CHECK-NEXT: S_BRANCH %bb.1
79 undef %0.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
80 %0.sub1:vreg_64 = V_MOV_B32_e32 0, implicit $exec
81 %1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
84 %2:vgpr_32 = DS_READ_B32_gfx9 %1, 0, 0, implicit $exec :: (load (s32), addrspace 3)
85 INLINEASM &"", 1, 851978, def %0, 2147549193, %0(tied-def 3)
86 INLINEASM &"", 1, 851977, %2
87 INLINEASM &"", 1, 851978, def %0.sub1, 851978, def undef %0.sub0
88 S_NOP 0, implicit %0.sub1
89 $sgpr10 = S_MOV_B32 -1