1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2> %t | FileCheck -check-prefixes=GCN %s
3 # RUN: FileCheck -check-prefix=ERR %s < %t
6 # ERR: remark: <unknown>:0:0: cannot select: G_BRCOND %1:sgpr(s1), %bb.1 (in function: brcond_sgpr)
7 # ERR-NEXT: remark: <unknown>:0:0: cannot select: G_BRCOND %1:vgpr(s1), %bb.1 (in function: brcond_vgpr)
17 ; GCN-LABEL: name: brcond_scc
19 ; GCN: successors: %bb.1(0x80000000)
20 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
21 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
22 ; GCN: S_CMP_EQ_U32 [[COPY]], [[COPY1]], implicit-def $scc
23 ; GCN: [[COPY2:%[0-9]+]]:sreg_32_xm0 = COPY $scc
24 ; GCN: $scc = COPY [[COPY2]]
25 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
28 liveins: $sgpr0, $sgpr1
30 %0:sgpr(s32) = COPY $sgpr0
31 %1:sgpr(s32) = COPY $sgpr1
32 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
41 name: brcond_scc_impdef
46 ; GCN-LABEL: name: brcond_scc_impdef
48 ; GCN: successors: %bb.1(0x80000000)
49 ; GCN: [[DEF:%[0-9]+]]:sreg_32_xm0 = IMPLICIT_DEF
50 ; GCN: $scc = COPY [[DEF]]
51 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
54 liveins: $sgpr0, $sgpr1
56 %0:scc(s1) = G_IMPLICIT_DEF
65 name: brcond_scc_undef
70 ; GCN-LABEL: name: brcond_scc_undef
72 ; GCN: successors: %bb.1(0x80000000)
73 ; GCN: $scc = COPY %0:sreg_32_xm0
74 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
77 liveins: $sgpr0, $sgpr1
79 G_BRCOND undef %0:scc(s1), %bb.1
92 ; GCN-LABEL: name: brcond_scc_br
94 ; GCN: successors: %bb.1(0x80000000)
95 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
96 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
97 ; GCN: S_CMP_EQ_U32 [[COPY]], [[COPY1]], implicit-def $scc
98 ; GCN: [[COPY2:%[0-9]+]]:sreg_32_xm0 = COPY $scc
99 ; GCN: $scc = COPY [[COPY2]]
100 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
101 ; GCN: S_BRANCH %bb.1
103 ; GCN: successors: %bb.2(0x80000000)
106 liveins: $sgpr0, $sgpr1
108 %0:sgpr(s32) = COPY $sgpr0
109 %1:sgpr(s32) = COPY $sgpr1
110 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
124 regBankSelected: true
127 ; GCN-LABEL: name: brcond_vcc
129 ; GCN: successors: %bb.1(0x80000000)
130 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
131 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
132 ; GCN: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 [[COPY]], [[COPY1]], implicit $exec
133 ; GCN: $vcc = COPY [[V_CMP_EQ_U32_e64_]]
134 ; GCN: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
137 liveins: $vgpr0, $vgpr1
139 %0:vgpr(s32) = COPY $vgpr0
140 %1:vgpr(s32) = COPY $vgpr1
141 %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
148 # Don't try to select this.
153 regBankSelected: true
156 ; GCN-LABEL: name: brcond_sgpr
158 ; GCN: successors: %bb.1(0x80000000)
159 ; GCN: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
160 ; GCN: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
161 ; GCN: G_BRCOND [[TRUNC]](s1), %bb.1
164 liveins: $sgpr0, $sgpr1
166 %0:sgpr(s32) = COPY $sgpr0
167 %1:sgpr(s1) = G_TRUNC %0
174 # Don't try to select this.
179 regBankSelected: true
182 ; GCN-LABEL: name: brcond_vgpr
184 ; GCN: successors: %bb.1(0x80000000)
185 ; GCN: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
186 ; GCN: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
187 ; GCN: G_BRCOND [[TRUNC]](s1), %bb.1
190 liveins: $vgpr0, $vgpr1
192 %0:vgpr(s32) = COPY $vgpr0
193 %1:vgpr(s1) = G_TRUNC %0