1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
3 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-regalloc -misched-only-block=999 -start-before=machine-scheduler -stop-after=greedy,0 -o - %s | FileCheck %s
5 # This run line is a total hack to get the live intervals to make it
6 # to the verifier. This requires asserts to use
7 # -misched-only-block. We use the scheduler only because -start-before
8 # doesn't see si-optimize-exec-masking-pre-ra unless the scheduler is
9 # part of the pass pipeline.
12 name: subreg_value_undef
13 tracksRegLiveness: true
15 ; CHECK-LABEL: name: subreg_value_undef
17 ; CHECK-NEXT: successors: %bb.1(0x80000000)
18 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
20 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
21 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), align 8, addrspace 1)
22 ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub1:sgpr_128 = S_MOV_B32 -1
23 ; CHECK-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, undef [[S_MOV_B32_]].sub0, implicit-def dead $scc
24 ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sgpr_128 = COPY [[S_LOAD_DWORDX4_IMM]].sub0
25 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
28 ; CHECK-NEXT: S_NOP 0, implicit [[S_MOV_B32_]].sub1
31 %0:sgpr_64 = COPY $sgpr0_sgpr1
32 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), align 8, addrspace 1)
33 undef %2.sub1:sgpr_128 = S_MOV_B32 -1
34 %3:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, undef %2.sub0, implicit $exec
35 %4:sreg_32_xm0_xexec = V_CMP_NE_U32_e64 1, %3, implicit $exec
36 $vcc_lo = S_AND_B32 $exec_lo, %4, implicit-def dead $scc
37 %2.sub1:sgpr_128 = COPY %1.sub0
38 S_CBRANCH_VCCNZ %bb.1, implicit $vcc
41 S_NOP 0, implicit %2.sub1
45 name: needs_distribute_0
46 tracksRegLiveness: true
48 ; CHECK-LABEL: name: needs_distribute_0
50 ; CHECK-NEXT: successors: %bb.1(0x80000000)
51 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
53 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
54 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), align 8, addrspace 1)
55 ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub0:sreg_64_xexec = S_MOV_B32 -1
56 ; CHECK-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, [[S_MOV_B32_]].sub0, implicit-def dead $scc
57 ; CHECK-NEXT: dead [[S_MOV_B32_:%[0-9]+]].sub1:sreg_64_xexec = COPY [[S_LOAD_DWORDX4_IMM]].sub0
58 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
63 %0:sgpr_64 = COPY $sgpr0_sgpr1
64 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), align 8, addrspace 1)
65 undef %2.sub0:sreg_64_xexec = S_MOV_B32 -1
66 %3:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %2.sub0, implicit $exec
67 %4:sreg_32_xm0_xexec = V_CMP_NE_U32_e64 1, %3, implicit $exec
68 $vcc_lo = S_AND_B32 $exec_lo, %4, implicit-def dead $scc
69 %2.sub1:sreg_64_xexec = COPY %1.sub0
70 S_CBRANCH_VCCNZ %bb.1, implicit $vcc
76 name: needs_distribute_1
77 tracksRegLiveness: true
79 ; CHECK-LABEL: name: needs_distribute_1
81 ; CHECK-NEXT: successors: %bb.1(0x80000000)
82 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
85 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), align 8, addrspace 1)
86 ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub0:sreg_64_xexec = S_MOV_B32 -1
87 ; CHECK-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, [[S_MOV_B32_]].sub0, implicit-def dead $scc
88 ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sreg_64_xexec = COPY [[S_LOAD_DWORDX4_IMM]].sub0
89 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
92 ; CHECK-NEXT: S_NOP 0, implicit [[S_MOV_B32_]].sub1
95 %0:sgpr_64 = COPY $sgpr0_sgpr1
96 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), align 8, addrspace 1)
97 undef %2.sub0:sreg_64_xexec = S_MOV_B32 -1
98 %3:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %2.sub0, implicit $exec
99 %4:sreg_32_xm0_xexec = V_CMP_NE_U32_e64 1, %3, implicit $exec
100 $vcc_lo = S_AND_B32 $exec_lo, %4, implicit-def dead $scc
101 %2.sub1:sreg_64_xexec = COPY %1.sub0
102 S_CBRANCH_VCCNZ %bb.1, implicit $vcc
105 S_NOP 0, implicit %2.sub1
109 name: needs_distribute_2
110 tracksRegLiveness: true
112 ; CHECK-LABEL: name: needs_distribute_2
114 ; CHECK-NEXT: successors: %bb.1(0x80000000)
115 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
117 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
118 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), align 8, addrspace 1)
119 ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub0:sreg_64_xexec = S_MOV_B32 -1
120 ; CHECK-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, [[S_MOV_B32_]].sub0, implicit-def dead $scc
121 ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sreg_64_xexec = COPY [[S_LOAD_DWORDX4_IMM]].sub0
122 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
125 ; CHECK-NEXT: S_NOP 0, implicit [[S_MOV_B32_]]
127 liveins: $sgpr0_sgpr1
128 %0:sgpr_64 = COPY $sgpr0_sgpr1
129 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), align 8, addrspace 1)
130 undef %2.sub0:sreg_64_xexec = S_MOV_B32 -1
131 %3:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %2.sub0, implicit $exec
132 %4:sreg_32_xm0_xexec = V_CMP_NE_U32_e64 1, %3, implicit $exec
133 $vcc_lo = S_AND_B32 $exec_lo, %4, implicit-def dead $scc
134 %2.sub1:sreg_64_xexec = COPY %1.sub0
135 S_CBRANCH_VCCNZ %bb.1, implicit $vcc
142 name: needs_distribute_3
143 tracksRegLiveness: true
145 ; CHECK-LABEL: name: needs_distribute_3
147 ; CHECK-NEXT: successors: %bb.1(0x80000000)
148 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
151 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), align 8, addrspace 1)
152 ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub0:sreg_64_xexec = S_MOV_B32 -1
153 ; CHECK-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, [[S_MOV_B32_]].sub0, implicit-def dead $scc
154 ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sreg_64_xexec = COPY [[S_LOAD_DWORDX4_IMM]].sub0
155 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
158 ; CHECK-NEXT: S_NOP 0, implicit [[S_MOV_B32_]].sub0
160 liveins: $sgpr0_sgpr1
161 %0:sgpr_64 = COPY $sgpr0_sgpr1
162 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), align 8, addrspace 1)
163 undef %2.sub0:sreg_64_xexec = S_MOV_B32 -1
164 %3:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %2.sub0, implicit $exec
165 %4:sreg_32_xm0_xexec = V_CMP_NE_U32_e64 1, %3, implicit $exec
166 $vcc_lo = S_AND_B32 $exec_lo, %4, implicit-def dead $scc
167 %2.sub1:sreg_64_xexec = COPY %1.sub0
168 S_CBRANCH_VCCNZ %bb.1, implicit $vcc
171 S_NOP 0, implicit %2.sub0