1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=regbankselect -verify-machineinstrs -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=regbankselect -verify-machineinstrs -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
13 ; CHECK-LABEL: name: smin_s32_ss
14 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
15 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
16 ; CHECK: [[SMIN:%[0-9]+]]:sgpr(s32) = G_SMIN [[COPY]], [[COPY1]]
17 ; CHECK: $sgpr0 = COPY [[SMIN]](s32)
18 %0:_(s32) = COPY $sgpr0
19 %1:_(s32) = COPY $sgpr1
20 %2:_(s32) = G_SMIN %0, %1
30 liveins: $sgpr0, $vgpr0
32 ; CHECK-LABEL: name: smin_s32_sv
33 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
34 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
35 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
36 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(s32) = G_SMIN [[COPY2]], [[COPY1]]
37 ; CHECK: $vgpr0 = COPY [[SMIN]](s32)
38 %0:_(s32) = COPY $sgpr0
39 %1:_(s32) = COPY $vgpr0
40 %2:_(s32) = G_SMIN %0, %1
50 liveins: $sgpr0, $vgpr0
52 ; CHECK-LABEL: name: smin_s32_vs
53 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
54 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
55 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
56 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(s32) = G_SMIN [[COPY]], [[COPY2]]
57 ; CHECK: $vgpr0 = COPY [[SMIN]](s32)
58 %0:_(s32) = COPY $vgpr0
59 %1:_(s32) = COPY $sgpr0
60 %2:_(s32) = G_SMIN %0, %1
70 liveins: $vgpr0, $vgpr1
72 ; CHECK-LABEL: name: smin_s32_vv
73 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
74 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
75 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(s32) = G_SMIN [[COPY]], [[COPY1]]
76 ; CHECK: $vgpr0 = COPY [[SMIN]](s32)
77 %0:_(s32) = COPY $vgpr0
78 %1:_(s32) = COPY $vgpr1
79 %2:_(s32) = G_SMIN %0, %1
83 # FIXME: This should use VGPR instruction
85 name: smin_s32_ss_vgpr_use
90 liveins: $sgpr0, $sgpr1
92 ; CHECK-LABEL: name: smin_s32_ss_vgpr_use
93 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
94 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
95 ; CHECK: [[SMIN:%[0-9]+]]:sgpr(s32) = G_SMIN [[COPY]], [[COPY1]]
96 ; CHECK: $vgpr0 = COPY [[SMIN]](s32)
97 %0:_(s32) = COPY $sgpr0
98 %1:_(s32) = COPY $sgpr1
99 %2:_(s32) = G_SMIN %0, %1
109 liveins: $sgpr0, $sgpr1
111 ; CHECK-LABEL: name: smin_s16_ss
112 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
113 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
114 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
115 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
116 ; CHECK: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s16)
117 ; CHECK: [[SEXT1:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC1]](s16)
118 ; CHECK: [[SMIN:%[0-9]+]]:sgpr(s32) = G_SMIN [[SEXT]], [[SEXT1]]
119 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SMIN]](s32)
120 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
121 ; CHECK: $sgpr0 = COPY [[ANYEXT]](s32)
122 %0:_(s32) = COPY $sgpr0
123 %1:_(s32) = COPY $sgpr1
124 %2:_(s16) = G_TRUNC %0
125 %3:_(s16) = G_TRUNC %1
126 %4:_(s16) = G_SMIN %2, %3
127 %5:_(s32) = G_ANYEXT %4
133 name: smin_s16_ss_vgpr_use
138 liveins: $sgpr0, $sgpr1
140 ; CHECK-LABEL: name: smin_s16_ss_vgpr_use
141 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
142 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
143 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
144 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
145 ; CHECK: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s16)
146 ; CHECK: [[SEXT1:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC1]](s16)
147 ; CHECK: [[SMIN:%[0-9]+]]:sgpr(s32) = G_SMIN [[SEXT]], [[SEXT1]]
148 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SMIN]](s32)
149 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
150 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
151 %0:_(s32) = COPY $sgpr0
152 %1:_(s32) = COPY $sgpr1
153 %2:_(s16) = G_TRUNC %0
154 %3:_(s16) = G_TRUNC %1
155 %4:_(s16) = G_SMIN %2, %3
156 %5:_(s32) = G_ANYEXT %4
167 liveins: $sgpr0, $sgpr1
169 ; CHECK-LABEL: name: smin_v2s16_ss
170 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
171 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
172 ; CHECK: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
173 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST]], 16
174 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
175 ; CHECK: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST]], [[C]](s32)
176 ; CHECK: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
177 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST1]], 16
178 ; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
179 ; CHECK: [[ASHR1:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST1]], [[C1]](s32)
180 ; CHECK: [[SMIN:%[0-9]+]]:sgpr(s32) = G_SMIN [[SEXT_INREG]], [[SEXT_INREG1]]
181 ; CHECK: [[SMIN1:%[0-9]+]]:sgpr(s32) = G_SMIN [[ASHR]], [[ASHR1]]
182 ; CHECK: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[SMIN]](s32), [[SMIN1]](s32)
183 ; CHECK: $sgpr0 = COPY [[BUILD_VECTOR_TRUNC]](<2 x s16>)
184 %0:_(<2 x s16>) = COPY $sgpr0
185 %1:_(<2 x s16>) = COPY $sgpr1
186 %2:_(<2 x s16>) = G_SMIN %0, %1
196 liveins: $sgpr0, $vgpr0
198 ; CHECK-LABEL: name: smin_v2s16_sv
199 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
200 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
201 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
202 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_SMIN [[COPY2]], [[COPY1]]
203 ; CHECK: $vgpr0 = COPY [[SMIN]](<2 x s16>)
204 %0:_(<2 x s16>) = COPY $sgpr0
205 %1:_(<2 x s16>) = COPY $vgpr0
206 %2:_(<2 x s16>) = G_SMIN %0, %1
216 liveins: $sgpr0, $vgpr0
218 ; CHECK-LABEL: name: smin_v2s16_vs
219 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
220 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
221 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
222 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_SMIN [[COPY]], [[COPY2]]
223 ; CHECK: $vgpr0 = COPY [[SMIN]](<2 x s16>)
224 %0:_(<2 x s16>) = COPY $vgpr0
225 %1:_(<2 x s16>) = COPY $sgpr0
226 %2:_(<2 x s16>) = G_SMIN %0, %1
236 liveins: $vgpr0, $vgpr1
238 ; CHECK-LABEL: name: smin_v2s16_vv
239 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
240 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
241 ; CHECK: [[SMIN:%[0-9]+]]:vgpr(<2 x s16>) = G_SMIN [[COPY]], [[COPY1]]
242 ; CHECK: $vgpr0 = COPY [[SMIN]](<2 x s16>)
243 %0:_(<2 x s16>) = COPY $vgpr0
244 %1:_(<2 x s16>) = COPY $vgpr1
245 %2:_(<2 x s16>) = G_SMIN %0, %1