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
6 name: anyext_s32_to_s64_s
12 ; CHECK-LABEL: name: anyext_s32_to_s64_s
13 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
14 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[COPY]](s32)
15 %0:_(s32) = COPY $sgpr0
16 %1:_(s64) = G_ANYEXT %0
20 name: anyext_s32_to_s64_v
26 ; CHECK-LABEL: name: anyext_s32_to_s64_v
27 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
28 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
29 ; CHECK: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
30 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[DEF]](s32)
31 %0:_(s32) = COPY $vgpr0
32 %1:_(s64) = G_ANYEXT %0
36 name: anyext_s1_to_s16_scc
41 liveins: $sgpr0, $sgpr1
42 ; CHECK-LABEL: name: anyext_s1_to_s16_scc
43 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
44 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
45 ; CHECK: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
46 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
47 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
48 %0:_(s32) = COPY $sgpr0
49 %1:_(s32) = COPY $sgpr1
50 %2:_(s1) = G_ICMP intpred(eq), %0, %1
51 %3:_(s16) = G_ANYEXT %2
55 name: anyext_s1_to_s32_scc
60 liveins: $sgpr0, $sgpr1
61 ; CHECK-LABEL: name: anyext_s1_to_s32_scc
62 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
63 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
64 ; CHECK: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
65 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
66 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
67 %0:_(s32) = COPY $sgpr0
68 %1:_(s32) = COPY $sgpr1
69 %2:_(s1) = G_ICMP intpred(eq), %0, %1
70 %3:_(s32) = G_ANYEXT %2
74 name: anyext_s1_to_s64_scc
79 liveins: $sgpr0, $sgpr1
80 ; CHECK-LABEL: name: anyext_s1_to_s64_scc
81 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
82 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
83 ; CHECK: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
84 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
85 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
86 %0:_(s32) = COPY $sgpr0
87 %1:_(s32) = COPY $sgpr1
88 %2:_(s1) = G_ICMP intpred(eq), %0, %1
89 %3:_(s64) = G_ANYEXT %2
93 name: anyext_s1_to_s16_vcc
98 liveins: $vgpr0, $vgpr1
99 ; CHECK-LABEL: name: anyext_s1_to_s16_vcc
100 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
101 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
102 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
103 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
104 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
105 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
106 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
107 %0:_(s32) = COPY $vgpr0
108 %1:_(s32) = COPY $vgpr1
109 %2:_(s1) = G_ICMP intpred(eq), %0, %1
110 %3:_(s16) = G_ANYEXT %2
114 name: anyext_s1_to_s32_vcc
119 liveins: $vgpr0, $vgpr1
120 ; CHECK-LABEL: name: anyext_s1_to_s32_vcc
121 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
122 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
123 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
124 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
125 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
126 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
127 %0:_(s32) = COPY $vgpr0
128 %1:_(s32) = COPY $vgpr1
129 %2:_(s1) = G_ICMP intpred(eq), %0, %1
130 %3:_(s32) = G_ANYEXT %2
134 name: anyext_s1_to_s64_vcc
139 liveins: $vgpr0, $vgpr1
140 ; CHECK-LABEL: name: anyext_s1_to_s64_vcc
141 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
142 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
143 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
144 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
145 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
146 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
147 ; CHECK: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
148 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[DEF]](s32)
149 %0:_(s32) = COPY $vgpr0
150 %1:_(s32) = COPY $vgpr1
151 %2:_(s1) = G_ICMP intpred(eq), %0, %1
152 %3:_(s64) = G_ANYEXT %2
156 name: anyext_s1_to_s16_sgpr
162 ; CHECK-LABEL: name: anyext_s1_to_s16_sgpr
163 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
164 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
165 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
166 %0:_(s32) = COPY $sgpr0
167 %1:_(s1) = G_TRUNC %0
168 %2:_(s16) = G_ANYEXT %1
172 name: anyext_s1_to_s32_sgpr
178 ; CHECK-LABEL: name: anyext_s1_to_s32_sgpr
179 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
180 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
181 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
182 %0:_(s32) = COPY $sgpr0
183 %1:_(s1) = G_TRUNC %0
184 %2:_(s32) = G_ANYEXT %1
188 name: anyext_s1_to_s64_sgpr
194 ; CHECK-LABEL: name: anyext_s1_to_s64_sgpr
195 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
196 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
197 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
198 %0:_(s32) = COPY $sgpr0
199 %1:_(s1) = G_TRUNC %0
200 %2:_(s64) = G_ANYEXT %1
204 name: anyext_s1_to_s16_vgpr
210 ; CHECK-LABEL: name: anyext_s1_to_s16_vgpr
211 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
212 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
213 ; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s16) = G_ANYEXT [[TRUNC]](s1)
214 %0:_(s32) = COPY $vgpr0
215 %1:_(s1) = G_TRUNC %0
216 %2:_(s16) = G_ANYEXT %1
220 name: anyext_s1_to_s32_vgpr
226 ; CHECK-LABEL: name: anyext_s1_to_s32_vgpr
227 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
228 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
229 ; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
230 %0:_(s32) = COPY $vgpr0
231 %1:_(s1) = G_TRUNC %0
232 %2:_(s32) = G_ANYEXT %1
236 name: anyext_s1_to_s64_vgpr
242 ; CHECK-LABEL: name: anyext_s1_to_s64_vgpr
243 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
244 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
245 ; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
246 ; CHECK: [[DEF:%[0-9]+]]:vgpr(s32) = G_IMPLICIT_DEF
247 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ANYEXT]](s32), [[DEF]](s32)
248 %0:_(s32) = COPY $vgpr0
249 %1:_(s1) = G_TRUNC %0
250 %2:_(s64) = G_ANYEXT %1