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]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
38 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.1
42 liveins: $sgpr0, $sgpr1
43 %0:_(s32) = COPY $sgpr0
44 %1:_(s32) = COPY $sgpr1
45 %2:_(s1) = G_ICMP intpred(ne), %0, %1
52 name: brcond_sgpr_cond
55 ; CHECK-LABEL: name: brcond_sgpr_cond
57 ; CHECK: successors: %bb.1(0x80000000)
58 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
59 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
60 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
61 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
66 %0:_(s32) = COPY $sgpr0
74 name: brcond_vgpr_cond
77 ; CHECK-LABEL: name: brcond_vgpr_cond
79 ; CHECK: successors: %bb.1(0x80000000)
80 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
81 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
82 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
83 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
88 %0:_(s32) = COPY $vgpr0
96 # The terminator that needs handling is the only instruction in the
100 name: empty_block_vgpr_brcond
103 ; CHECK-LABEL: name: empty_block_vgpr_brcond
105 ; CHECK: successors: %bb.1(0x80000000)
106 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
107 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
109 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
110 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
111 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
116 %0:_(s32) = COPY $vgpr0
117 %1:_(s1) = G_TRUNC %0
126 # Make sure the first instruction in the block isn't skipped.
128 name: copy_first_inst_brcond
131 ; CHECK-LABEL: name: copy_first_inst_brcond
133 ; CHECK: successors: %bb.1(0x80000000)
134 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
136 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
137 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
138 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
139 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
144 %0:_(s32) = COPY $vgpr0
147 %1:_(s1) = G_TRUNC %0
153 # Extra instruction separates brcond from the condition def
155 name: copy_middle_inst_brcond
158 ; CHECK-LABEL: name: copy_middle_inst_brcond
160 ; CHECK: successors: %bb.1(0x80000000)
161 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
163 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
164 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
166 ; CHECK: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
167 ; CHECK: G_BRCOND [[COPY1]](s1), %bb.1
172 %0:_(s32) = COPY $vgpr0
175 %1:_(s1) = G_TRUNC %0