[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / inst-select-brcond.mir
blob7c2e3c081bbff36611bc8bf9c8098a0c6d7db3d5
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
5 # ERR-NOT: remark:
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)
8 # ERR-NOT: remark:
10 ---
12 name:            brcond_scc
13 legalized:       true
14 regBankSelected: true
16 body: |
17   ; GCN-LABEL: name: brcond_scc
18   ; GCN: bb.0:
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
26   ; GCN: bb.1:
27   bb.0:
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
33     G_BRCOND %2, %bb.1
35   bb.1:
37 ...
39 ---
41 name:            brcond_scc_impdef
42 legalized:       true
43 regBankSelected: true
45 body: |
46   ; GCN-LABEL: name: brcond_scc_impdef
47   ; GCN: bb.0:
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
52   ; GCN: bb.1:
53   bb.0:
54     liveins: $sgpr0, $sgpr1
56     %0:scc(s1) = G_IMPLICIT_DEF
57     G_BRCOND %0, %bb.1
59   bb.1:
61 ...
63 ---
65 name:            brcond_scc_undef
66 legalized:       true
67 regBankSelected: true
69 body: |
70   ; GCN-LABEL: name: brcond_scc_undef
71   ; GCN: bb.0:
72   ; GCN:   successors: %bb.1(0x80000000)
73   ; GCN:   $scc = COPY %0:sreg_32_xm0
74   ; GCN:   S_CBRANCH_SCC1 %bb.1, implicit $scc
75   ; GCN: bb.1:
76   bb.0:
77     liveins: $sgpr0, $sgpr1
79     G_BRCOND undef %0:scc(s1), %bb.1
81   bb.1:
83 ...
85 ---
87 name:            brcond_scc_br
88 legalized:       true
89 regBankSelected: true
91 body: |
92   ; GCN-LABEL: name: brcond_scc_br
93   ; GCN: bb.0:
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
102   ; GCN: bb.1:
103   ; GCN:   successors: %bb.2(0x80000000)
104   ; GCN: bb.2:
105   bb.0:
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
111     G_BRCOND %2, %bb.1
112     G_BR %bb.1
114   bb.1:
116   bb.2:
122 name:            brcond_vcc
123 legalized:       true
124 regBankSelected: true
126 body: |
127   ; GCN-LABEL: name: brcond_vcc
128   ; GCN: bb.0:
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
135   ; GCN: bb.1:
136   bb.0:
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
142     G_BRCOND %2, %bb.1
144   bb.1:
148 # Don't try to select this.
151 name:            brcond_sgpr
152 legalized:       true
153 regBankSelected: true
155 body: |
156   ; GCN-LABEL: name: brcond_sgpr
157   ; GCN: bb.0:
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
162   ; GCN: bb.1:
163   bb.0:
164     liveins: $sgpr0, $sgpr1
166     %0:sgpr(s32) = COPY $sgpr0
167     %1:sgpr(s1) = G_TRUNC %0
168     G_BRCOND %1, %bb.1
170   bb.1:
174 # Don't try to select this.
177 name:            brcond_vgpr
178 legalized:       true
179 regBankSelected: true
181 body: |
182   ; GCN-LABEL: name: brcond_vgpr
183   ; GCN: bb.0:
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
188   ; GCN: bb.1:
189   bb.0:
190     liveins: $vgpr0, $vgpr1
192     %0:vgpr(s32) = COPY $vgpr0
193     %1:vgpr(s1) = G_TRUNC %0
194     G_BRCOND %1, %bb.1
196   bb.1: