1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=amdgpu-regbankselect -verify-machineinstrs -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=amdgpu-regbankselect -verify-machineinstrs -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
13 ; CHECK-LABEL: name: umin_s32_ss
14 ; CHECK: liveins: $sgpr0, $sgpr1
16 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
17 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
18 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:sgpr(s32) = G_UMIN [[COPY]], [[COPY1]]
19 ; CHECK-NEXT: $sgpr0 = COPY [[UMIN]](s32)
20 %0:_(s32) = COPY $sgpr0
21 %1:_(s32) = COPY $sgpr1
22 %2:_(s32) = G_UMIN %0, %1
33 liveins: $sgpr0, $vgpr0
35 ; CHECK-LABEL: name: umin_s32_sv
36 ; CHECK: liveins: $sgpr0, $vgpr0
38 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
39 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
40 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
41 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(s32) = G_UMIN [[COPY2]], [[COPY1]]
42 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](s32)
43 %0:_(s32) = COPY $sgpr0
44 %1:_(s32) = COPY $vgpr0
45 %2:_(s32) = G_UMIN %0, %1
56 liveins: $sgpr0, $vgpr0
58 ; CHECK-LABEL: name: umin_s32_vs
59 ; CHECK: liveins: $sgpr0, $vgpr0
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
62 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
63 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
64 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(s32) = G_UMIN [[COPY]], [[COPY2]]
65 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](s32)
66 %0:_(s32) = COPY $vgpr0
67 %1:_(s32) = COPY $sgpr0
68 %2:_(s32) = G_UMIN %0, %1
79 liveins: $vgpr0, $vgpr1
81 ; CHECK-LABEL: name: umin_s32_vv
82 ; CHECK: liveins: $vgpr0, $vgpr1
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
85 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
86 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(s32) = G_UMIN [[COPY]], [[COPY1]]
87 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](s32)
88 %0:_(s32) = COPY $vgpr0
89 %1:_(s32) = COPY $vgpr1
90 %2:_(s32) = G_UMIN %0, %1
95 # FIXME: This should use VGPR instruction
97 name: umin_s32_ss_vgpr_use
102 liveins: $sgpr0, $sgpr1
104 ; CHECK-LABEL: name: umin_s32_ss_vgpr_use
105 ; CHECK: liveins: $sgpr0, $sgpr1
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
108 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
109 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:sgpr(s32) = G_UMIN [[COPY]], [[COPY1]]
110 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](s32)
111 %0:_(s32) = COPY $sgpr0
112 %1:_(s32) = COPY $sgpr1
113 %2:_(s32) = G_UMIN %0, %1
123 liveins: $sgpr0, $sgpr1
125 ; CHECK-LABEL: name: umin_s16_ss
126 ; CHECK: liveins: $sgpr0, $sgpr1
128 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
129 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
130 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
131 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
132 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s16)
133 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
134 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:sgpr(s32) = G_UMIN [[ZEXT]], [[ZEXT1]]
135 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[UMIN]](s32)
136 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
137 ; CHECK-NEXT: $sgpr0 = COPY [[ANYEXT]](s32)
138 %0:_(s32) = COPY $sgpr0
139 %1:_(s32) = COPY $sgpr1
140 %2:_(s16) = G_TRUNC %0
141 %3:_(s16) = G_TRUNC %1
142 %4:_(s16) = G_UMIN %2, %3
143 %5:_(s32) = G_ANYEXT %4
149 name: umin_s16_ss_vgpr_use
154 liveins: $sgpr0, $sgpr1
156 ; CHECK-LABEL: name: umin_s16_ss_vgpr_use
157 ; CHECK: liveins: $sgpr0, $sgpr1
159 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
160 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
161 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
162 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
163 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s16)
164 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
165 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:sgpr(s32) = G_UMIN [[ZEXT]], [[ZEXT1]]
166 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[UMIN]](s32)
167 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
168 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
169 %0:_(s32) = COPY $sgpr0
170 %1:_(s32) = COPY $sgpr1
171 %2:_(s16) = G_TRUNC %0
172 %3:_(s16) = G_TRUNC %1
173 %4:_(s16) = G_UMIN %2, %3
174 %5:_(s32) = G_ANYEXT %4
185 liveins: $sgpr0, $sgpr1
187 ; CHECK-LABEL: name: umin_v2s16_ss
188 ; CHECK: liveins: $sgpr0, $sgpr1
190 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
191 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
192 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
193 ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
194 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST]], [[C]](s32)
195 ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
196 ; CHECK-NEXT: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST]], [[C1]]
197 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
198 ; CHECK-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
199 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST1]], [[C2]](s32)
200 ; CHECK-NEXT: [[C3:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
201 ; CHECK-NEXT: [[AND1:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST1]], [[C3]]
202 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:sgpr(s32) = G_UMIN [[AND]], [[AND1]]
203 ; CHECK-NEXT: [[UMIN1:%[0-9]+]]:sgpr(s32) = G_UMIN [[LSHR]], [[LSHR1]]
204 ; CHECK-NEXT: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[UMIN]](s32), [[UMIN1]](s32)
205 ; CHECK-NEXT: $sgpr0 = COPY [[BUILD_VECTOR_TRUNC]](<2 x s16>)
206 %0:_(<2 x s16>) = COPY $sgpr0
207 %1:_(<2 x s16>) = COPY $sgpr1
208 %2:_(<2 x s16>) = G_UMIN %0, %1
218 liveins: $sgpr0, $vgpr0
220 ; CHECK-LABEL: name: umin_v2s16_sv
221 ; CHECK: liveins: $sgpr0, $vgpr0
223 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
224 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
225 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
226 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_UMIN [[COPY2]], [[COPY1]]
227 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](<2 x s16>)
228 %0:_(<2 x s16>) = COPY $sgpr0
229 %1:_(<2 x s16>) = COPY $vgpr0
230 %2:_(<2 x s16>) = G_UMIN %0, %1
240 liveins: $sgpr0, $vgpr0
242 ; CHECK-LABEL: name: umin_v2s16_vs
243 ; CHECK: liveins: $sgpr0, $vgpr0
245 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
246 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
247 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
248 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_UMIN [[COPY]], [[COPY2]]
249 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](<2 x s16>)
250 %0:_(<2 x s16>) = COPY $vgpr0
251 %1:_(<2 x s16>) = COPY $sgpr0
252 %2:_(<2 x s16>) = G_UMIN %0, %1
262 liveins: $vgpr0, $vgpr1
264 ; CHECK-LABEL: name: umin_v2s16_vv
265 ; CHECK: liveins: $vgpr0, $vgpr1
267 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
268 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
269 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_UMIN [[COPY]], [[COPY1]]
270 ; CHECK-NEXT: $vgpr0 = COPY [[UMIN]](<2 x s16>)
271 %0:_(<2 x s16>) = COPY $vgpr0
272 %1:_(<2 x s16>) = COPY $vgpr1
273 %2:_(<2 x s16>) = G_UMIN %0, %1