1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: anyext_s32_to_s64_s
12 ; CHECK-LABEL: name: anyext_s32_to_s64_s
13 ; CHECK: liveins: $sgpr0
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[COPY]](s32)
17 %0:_(s32) = COPY $sgpr0
18 %1:_(s64) = G_ANYEXT %0
22 name: anyext_s32_to_s64_v
28 ; CHECK-LABEL: name: anyext_s32_to_s64_v
29 ; CHECK: liveins: $vgpr0
31 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
32 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
33 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
34 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[DEF]](s32)
35 %0:_(s32) = COPY $vgpr0
36 %1:_(s64) = G_ANYEXT %0
40 name: anyext_s1_to_s16_scc
45 liveins: $sgpr0, $sgpr1
46 ; CHECK-LABEL: name: anyext_s1_to_s16_scc
47 ; CHECK: liveins: $sgpr0, $sgpr1
49 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
51 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
52 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
53 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
54 %0:_(s32) = COPY $sgpr0
55 %1:_(s32) = COPY $sgpr1
56 %2:_(s1) = G_ICMP intpred(eq), %0, %1
57 %3:_(s16) = G_ANYEXT %2
61 name: anyext_s1_to_s32_scc
66 liveins: $sgpr0, $sgpr1
67 ; CHECK-LABEL: name: anyext_s1_to_s32_scc
68 ; CHECK: liveins: $sgpr0, $sgpr1
70 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
71 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
72 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
73 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
74 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
75 %0:_(s32) = COPY $sgpr0
76 %1:_(s32) = COPY $sgpr1
77 %2:_(s1) = G_ICMP intpred(eq), %0, %1
78 %3:_(s32) = G_ANYEXT %2
82 name: anyext_s1_to_s64_scc
87 liveins: $sgpr0, $sgpr1
88 ; CHECK-LABEL: name: anyext_s1_to_s64_scc
89 ; CHECK: liveins: $sgpr0, $sgpr1
91 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
92 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
93 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
94 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
95 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
96 %0:_(s32) = COPY $sgpr0
97 %1:_(s32) = COPY $sgpr1
98 %2:_(s1) = G_ICMP intpred(eq), %0, %1
99 %3:_(s64) = G_ANYEXT %2
103 name: anyext_s1_to_s16_vcc
108 liveins: $vgpr0, $vgpr1
109 ; CHECK-LABEL: name: anyext_s1_to_s16_vcc
110 ; CHECK: liveins: $vgpr0, $vgpr1
112 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
113 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
114 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
115 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
116 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
117 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
118 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
119 %0:_(s32) = COPY $vgpr0
120 %1:_(s32) = COPY $vgpr1
121 %2:_(s1) = G_ICMP intpred(eq), %0, %1
122 %3:_(s16) = G_ANYEXT %2
126 name: anyext_s1_to_s32_vcc
131 liveins: $vgpr0, $vgpr1
132 ; CHECK-LABEL: name: anyext_s1_to_s32_vcc
133 ; CHECK: liveins: $vgpr0, $vgpr1
135 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
136 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
137 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
138 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
139 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
140 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
141 %0:_(s32) = COPY $vgpr0
142 %1:_(s32) = COPY $vgpr1
143 %2:_(s1) = G_ICMP intpred(eq), %0, %1
144 %3:_(s32) = G_ANYEXT %2
148 name: anyext_s1_to_s64_vcc
153 liveins: $vgpr0, $vgpr1
154 ; CHECK-LABEL: name: anyext_s1_to_s64_vcc
155 ; CHECK: liveins: $vgpr0, $vgpr1
157 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
158 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
159 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
160 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
161 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
162 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
163 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
164 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[DEF]](s32)
165 %0:_(s32) = COPY $vgpr0
166 %1:_(s32) = COPY $vgpr1
167 %2:_(s1) = G_ICMP intpred(eq), %0, %1
168 %3:_(s64) = G_ANYEXT %2
172 name: anyext_s1_to_s16_sgpr
178 ; CHECK-LABEL: name: anyext_s1_to_s16_sgpr
179 ; CHECK: liveins: $sgpr0
181 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
182 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
183 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
184 %0:_(s32) = COPY $sgpr0
185 %1:_(s1) = G_TRUNC %0
186 %2:_(s16) = G_ANYEXT %1
190 name: anyext_s1_to_s32_sgpr
196 ; CHECK-LABEL: name: anyext_s1_to_s32_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: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
202 %0:_(s32) = COPY $sgpr0
203 %1:_(s1) = G_TRUNC %0
204 %2:_(s32) = G_ANYEXT %1
208 name: anyext_s1_to_s64_sgpr
214 ; CHECK-LABEL: name: anyext_s1_to_s64_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: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
220 %0:_(s32) = COPY $sgpr0
221 %1:_(s1) = G_TRUNC %0
222 %2:_(s64) = G_ANYEXT %1
226 name: anyext_s1_to_s16_vgpr
232 ; CHECK-LABEL: name: anyext_s1_to_s16_vgpr
233 ; CHECK: liveins: $vgpr0
235 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
236 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
237 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s16) = G_ANYEXT [[TRUNC]](s1)
238 %0:_(s32) = COPY $vgpr0
239 %1:_(s1) = G_TRUNC %0
240 %2:_(s16) = G_ANYEXT %1
244 name: anyext_s1_to_s32_vgpr
250 ; CHECK-LABEL: name: anyext_s1_to_s32_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: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
256 %0:_(s32) = COPY $vgpr0
257 %1:_(s1) = G_TRUNC %0
258 %2:_(s32) = G_ANYEXT %1
262 name: anyext_s1_to_s64_vgpr
268 ; CHECK-LABEL: name: anyext_s1_to_s64_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: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
274 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
275 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ANYEXT]](s32), [[DEF]](s32)
276 %0:_(s32) = COPY $vgpr0
277 %1:_(s1) = G_TRUNC %0
278 %2:_(s64) = G_ANYEXT %1