1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: zext_s32_to_s64_s
12 ; CHECK-LABEL: name: zext_s32_to_s64_s
13 ; CHECK: liveins: $sgpr0
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[COPY]](s32)
17 %0:_(s32) = COPY $sgpr0
22 name: zext_s16_to_s64_s
28 ; CHECK-LABEL: name: zext_s16_to_s64_s
29 ; CHECK: liveins: $sgpr0
31 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
32 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
33 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[TRUNC]](s16)
34 %0:_(s32) = COPY $sgpr0
35 %1:_(s16) = G_TRUNC %0
40 name: zext_s32_to_s64_v
46 ; CHECK-LABEL: name: zext_s32_to_s64_v
47 ; CHECK: liveins: $vgpr0_vgpr1
49 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
51 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
52 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[C]](s32)
53 %0:_(s32) = COPY $vgpr0
58 name: zext_s1_to_s16_scc
63 liveins: $sgpr0, $sgpr1
64 ; CHECK-LABEL: name: zext_s1_to_s16_scc
65 ; CHECK: liveins: $sgpr0, $sgpr1
67 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
68 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
69 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
70 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
71 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s16) = G_ZEXT [[TRUNC]](s1)
72 %0:_(s32) = COPY $sgpr0
73 %1:_(s32) = COPY $sgpr1
74 %2:_(s1) = G_ICMP intpred(eq), %0, %1
79 name: zext_s1_to_s32_scc
84 liveins: $sgpr0, $sgpr1
85 ; CHECK-LABEL: name: zext_s1_to_s32_scc
86 ; CHECK: liveins: $sgpr0, $sgpr1
88 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
89 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
90 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
91 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
92 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
93 %0:_(s32) = COPY $sgpr0
94 %1:_(s32) = COPY $sgpr1
95 %2:_(s1) = G_ICMP intpred(eq), %0, %1
100 name: zext_s1_to_s64_scc
105 liveins: $sgpr0, $sgpr1
106 ; CHECK-LABEL: name: zext_s1_to_s64_scc
107 ; CHECK: liveins: $sgpr0, $sgpr1
109 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
110 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
111 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
112 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
113 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[TRUNC]](s1)
114 %0:_(s32) = COPY $sgpr0
115 %1:_(s32) = COPY $sgpr1
116 %2:_(s1) = G_ICMP intpred(eq), %0, %1
117 %3:_(s64) = G_ZEXT %2
121 name: zext_s1_to_s16_vcc
126 liveins: $vgpr0, $vgpr1
127 ; CHECK-LABEL: name: zext_s1_to_s16_vcc
128 ; CHECK: liveins: $vgpr0, $vgpr1
130 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
131 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
132 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
133 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
134 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
135 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
136 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
137 %0:_(s32) = COPY $vgpr0
138 %1:_(s32) = COPY $vgpr1
139 %2:_(s1) = G_ICMP intpred(eq), %0, %1
140 %3:_(s16) = G_ZEXT %2
144 name: zext_s1_to_s32_vcc
149 liveins: $vgpr0, $vgpr1
150 ; CHECK-LABEL: name: zext_s1_to_s32_vcc
151 ; CHECK: liveins: $vgpr0, $vgpr1
153 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
154 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
155 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
156 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
157 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
158 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
159 %0:_(s32) = COPY $vgpr0
160 %1:_(s32) = COPY $vgpr1
161 %2:_(s1) = G_ICMP intpred(eq), %0, %1
162 %3:_(s32) = G_ZEXT %2
166 name: zext_s1_to_s64_vcc
171 liveins: $vgpr0, $vgpr1
172 ; CHECK-LABEL: name: zext_s1_to_s64_vcc
173 ; CHECK: liveins: $vgpr0, $vgpr1
175 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
176 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
177 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
178 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
179 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
180 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
181 ; CHECK-NEXT: [[C2:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
182 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[C2]](s32)
183 %0:_(s32) = COPY $vgpr0
184 %1:_(s32) = COPY $vgpr1
185 %2:_(s1) = G_ICMP intpred(eq), %0, %1
186 %3:_(s64) = G_ZEXT %2
190 name: zext_s1_to_s16_sgpr
196 ; CHECK-LABEL: name: zext_s1_to_s16_sgpr
197 ; CHECK: liveins: $sgpr0
199 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
200 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
201 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s16) = G_ZEXT [[TRUNC]](s1)
202 %0:_(s32) = COPY $sgpr0
203 %1:_(s1) = G_TRUNC %0
204 %2:_(s16) = G_ZEXT %1
208 name: zext_s1_to_s32_sgpr
214 ; CHECK-LABEL: name: zext_s1_to_s32_sgpr
215 ; CHECK: liveins: $sgpr0
217 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
218 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
219 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
220 %0:_(s32) = COPY $sgpr0
221 %1:_(s1) = G_TRUNC %0
222 %2:_(s32) = G_ZEXT %1
226 name: zext_s1_to_s64_sgpr
232 ; CHECK-LABEL: name: zext_s1_to_s64_sgpr
233 ; CHECK: liveins: $sgpr0
235 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
236 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
237 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[TRUNC]](s1)
238 %0:_(s32) = COPY $sgpr0
239 %1:_(s1) = G_TRUNC %0
240 %2:_(s64) = G_ZEXT %1
244 name: zext_s1_to_s16_vgpr
250 ; CHECK-LABEL: name: zext_s1_to_s16_vgpr
251 ; CHECK: liveins: $vgpr0
253 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
254 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
255 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:vgpr(s16) = G_ZEXT [[TRUNC]](s1)
256 %0:_(s32) = COPY $vgpr0
257 %1:_(s1) = G_TRUNC %0
258 %2:_(s16) = G_ZEXT %1
262 name: zext_s1_to_s32_vgpr
268 ; CHECK-LABEL: name: zext_s1_to_s32_vgpr
269 ; CHECK: liveins: $vgpr0
271 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
272 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
273 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:vgpr(s32) = G_ZEXT [[TRUNC]](s1)
274 %0:_(s32) = COPY $vgpr0
275 %1:_(s1) = G_TRUNC %0
276 %2:_(s32) = G_ZEXT %1
280 name: zext_s1_to_s64_vgpr
286 ; CHECK-LABEL: name: zext_s1_to_s64_vgpr
287 ; CHECK: liveins: $vgpr0
289 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
290 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
291 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:vgpr(s32) = G_ZEXT [[TRUNC]](s1)
292 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
293 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ZEXT]](s32), [[C]](s32)
294 %0:_(s32) = COPY $vgpr0
295 %1:_(s1) = G_TRUNC %0
296 %2:_(s64) = G_ZEXT %1
300 name: zext_s16_to_s64_vgpr
306 ; CHECK-LABEL: name: zext_s16_to_s64_vgpr
307 ; CHECK: liveins: $vgpr0
309 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
310 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
311 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:vgpr(s32) = G_ZEXT [[TRUNC]](s16)
312 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
313 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ZEXT]](s32), [[C]](s32)
314 %0:_(s32) = COPY $vgpr0
315 %1:_(s16) = G_TRUNC %0
316 %2:_(s64) = G_ZEXT %1