1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
9 ; CHECK-LABEL: name: brcond_vcc_cond
11 ; CHECK: successors: %bb.1(0x80000000)
12 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
13 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
14 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
15 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.1
19 liveins: $vgpr0, $vgpr1
20 %0:_(s32) = COPY $vgpr0
21 %1:_(s32) = COPY $vgpr1
22 %2:_(s1) = G_ICMP intpred(ne), %0, %1
32 ; CHECK-LABEL: name: brcond_scc_cond
34 ; CHECK: successors: %bb.1(0x80000000)
35 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
36 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
37 ; CHECK: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
38 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
39 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
40 ; CHECK: G_BRCOND [[ZEXT]](s32), %bb.1
44 liveins: $sgpr0, $sgpr1
45 %0:_(s32) = COPY $sgpr0
46 %1:_(s32) = COPY $sgpr1
47 %2:_(s1) = G_ICMP intpred(ne), %0, %1
54 name: brcond_sgpr_cond
57 ; CHECK-LABEL: name: brcond_sgpr_cond
59 ; CHECK: successors: %bb.1(0x80000000)
60 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
61 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
62 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
63 ; CHECK: G_BRCOND [[ZEXT]](s32), %bb.1
68 %0:_(s32) = COPY $sgpr0
76 name: brcond_vgpr_cond
79 ; CHECK-LABEL: name: brcond_vgpr_cond
81 ; CHECK: successors: %bb.1(0x80000000)
82 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
83 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
84 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
85 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
90 %0:_(s32) = COPY $vgpr0
98 # The terminator that needs handling is the only instruction in the
102 name: empty_block_vgpr_brcond
105 ; CHECK-LABEL: name: empty_block_vgpr_brcond
107 ; CHECK: successors: %bb.1(0x80000000)
108 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
109 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
111 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
112 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
113 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
118 %0:_(s32) = COPY $vgpr0
119 %1:_(s1) = G_TRUNC %0
128 # Make sure the first instruction in the block isn't skipped.
130 name: copy_first_inst_brcond
133 ; CHECK-LABEL: name: copy_first_inst_brcond
135 ; CHECK: successors: %bb.1(0x80000000)
136 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
138 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
139 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
140 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
141 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
146 %0:_(s32) = COPY $vgpr0
149 %1:_(s1) = G_TRUNC %0
155 # Extra instruction separates brcond from the condition def
157 name: copy_middle_inst_brcond
160 ; CHECK-LABEL: name: copy_middle_inst_brcond
162 ; CHECK: successors: %bb.1(0x80000000)
163 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
165 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
166 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
168 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
169 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
174 %0:_(s32) = COPY $vgpr0
177 %1:_(s1) = G_TRUNC %0