1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
9 ; CHECK-LABEL: name: brcond_vcc_cond
11 ; CHECK-NEXT: successors: %bb.1(0x80000000)
12 ; CHECK-NEXT: liveins: $vgpr0, $vgpr1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
16 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
17 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
22 liveins: $vgpr0, $vgpr1
23 %0:_(s32) = COPY $vgpr0
24 %1:_(s32) = COPY $vgpr1
25 %2:_(s1) = G_ICMP intpred(ne), %0, %1
35 ; CHECK-LABEL: name: brcond_scc_cond
37 ; CHECK-NEXT: successors: %bb.1(0x80000000)
38 ; CHECK-NEXT: liveins: $sgpr0, $sgpr1
40 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
41 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
42 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
43 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
44 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
45 ; CHECK-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
50 liveins: $sgpr0, $sgpr1
51 %0:_(s32) = COPY $sgpr0
52 %1:_(s32) = COPY $sgpr1
53 %2:_(s1) = G_ICMP intpred(ne), %0, %1
60 name: brcond_sgpr_cond
63 ; CHECK-LABEL: name: brcond_sgpr_cond
65 ; CHECK-NEXT: successors: %bb.1(0x80000000)
66 ; CHECK-NEXT: liveins: $sgpr0
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
69 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
70 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
71 ; CHECK-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
77 %0:_(s32) = COPY $sgpr0
85 name: brcond_vgpr_cond
88 ; CHECK-LABEL: name: brcond_vgpr_cond
90 ; CHECK-NEXT: successors: %bb.1(0x80000000)
91 ; CHECK-NEXT: liveins: $vgpr0
93 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
94 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
95 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
96 ; CHECK-NEXT: G_BRCOND [[COPY1]](s1), %bb.1
102 %0:_(s32) = COPY $vgpr0
103 %1:_(s1) = G_TRUNC %0
110 # The terminator that needs handling is the only instruction in the
114 name: empty_block_vgpr_brcond
117 ; CHECK-LABEL: name: empty_block_vgpr_brcond
119 ; CHECK-NEXT: successors: %bb.1(0x80000000)
120 ; CHECK-NEXT: liveins: $vgpr0
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
123 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
126 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
128 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
129 ; CHECK-NEXT: G_BRCOND [[COPY1]](s1), %bb.1
135 %0:_(s32) = COPY $vgpr0
136 %1:_(s1) = G_TRUNC %0
145 # Make sure the first instruction in the block isn't skipped.
147 name: copy_first_inst_brcond
150 ; CHECK-LABEL: name: copy_first_inst_brcond
152 ; CHECK-NEXT: successors: %bb.1(0x80000000)
153 ; CHECK-NEXT: liveins: $vgpr0
155 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
158 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
160 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
161 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
162 ; CHECK-NEXT: G_BRCOND [[COPY1]](s1), %bb.1
168 %0:_(s32) = COPY $vgpr0
171 %1:_(s1) = G_TRUNC %0
177 # Extra instruction separates brcond from the condition def
179 name: copy_middle_inst_brcond
182 ; CHECK-LABEL: name: copy_middle_inst_brcond
184 ; CHECK-NEXT: successors: %bb.1(0x80000000)
185 ; CHECK-NEXT: liveins: $vgpr0
187 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
190 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
192 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
193 ; CHECK-NEXT: S_NOP 0
194 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
195 ; CHECK-NEXT: G_BRCOND [[COPY1]](s1), %bb.1
201 %0:_(s32) = COPY $vgpr0
204 %1:_(s1) = G_TRUNC %0