1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: shl_s32_ss
13 ; CHECK: liveins: $sgpr0, $sgpr1
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
17 ; CHECK-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[COPY]], [[COPY1]](s32)
18 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s32)
19 %0:_(s32) = COPY $sgpr0
20 %1:_(s32) = COPY $sgpr1
21 %2:_(s32) = G_SHL %0, %1
22 S_ENDPGM 0, implicit %2
31 liveins: $sgpr0, $vgpr0
32 ; CHECK-LABEL: name: shl_s32_sv
33 ; CHECK: liveins: $sgpr0, $vgpr0
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
36 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
37 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
38 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s32) = G_SHL [[COPY2]], [[COPY1]](s32)
39 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s32)
40 %0:_(s32) = COPY $sgpr0
41 %1:_(s32) = COPY $vgpr0
42 %2:_(s32) = G_SHL %0, %1
43 S_ENDPGM 0, implicit %2
52 liveins: $sgpr0, $vgpr0
53 ; CHECK-LABEL: name: shl_s32_vs
54 ; CHECK: liveins: $sgpr0, $vgpr0
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
57 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
58 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
59 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s32) = G_SHL [[COPY]], [[COPY2]](s32)
60 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s32)
61 %0:_(s32) = COPY $vgpr0
62 %1:_(s32) = COPY $sgpr0
63 %2:_(s32) = G_SHL %0, %1
64 S_ENDPGM 0, implicit %2
73 liveins: $vgpr0, $vgpr1
74 ; CHECK-LABEL: name: shl_s32_vv
75 ; CHECK: liveins: $vgpr0, $vgpr1
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
78 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
79 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s32) = G_SHL [[COPY]], [[COPY1]](s32)
80 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s32)
81 %0:_(s32) = COPY $vgpr0
82 %1:_(s32) = COPY $vgpr1
83 %2:_(s32) = G_SHL %0, %1
84 S_ENDPGM 0, implicit %2
93 liveins: $sgpr0, $sgpr1
94 ; CHECK-LABEL: name: shl_s16_ss
95 ; CHECK: liveins: $sgpr0, $sgpr1
97 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
98 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
99 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
100 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
101 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s16)
102 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
103 ; CHECK-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[ANYEXT]], [[ZEXT]](s32)
104 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SHL]](s32)
105 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC2]](s16)
106 %0:_(s32) = COPY $sgpr0
107 %1:_(s32) = COPY $sgpr1
108 %2:_(s16) = G_TRUNC %0
109 %3:_(s16) = G_TRUNC %1
110 %4:_(s16) = G_SHL %2, %3
111 S_ENDPGM 0, implicit %4
120 liveins: $sgpr0, $vgpr0
122 ; CHECK-LABEL: name: shl_s16_sv
123 ; CHECK: liveins: $sgpr0, $vgpr0
125 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
126 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
127 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
128 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
129 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC]](s16)
130 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s16) = G_SHL [[COPY2]], [[TRUNC1]](s16)
131 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s16)
132 %0:_(s32) = COPY $sgpr0
133 %1:_(s32) = COPY $vgpr0
134 %2:_(s16) = G_TRUNC %0
135 %3:_(s16) = G_TRUNC %1
136 %4:_(s16) = G_SHL %2, %3
137 S_ENDPGM 0, implicit %4
146 liveins: $sgpr0, $vgpr0
147 ; CHECK-LABEL: name: shl_s16_vs
148 ; CHECK: liveins: $sgpr0, $vgpr0
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
151 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
152 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
153 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
154 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC1]](s16)
155 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s16) = G_SHL [[TRUNC]], [[COPY2]](s16)
156 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s16)
157 %0:_(s32) = COPY $vgpr0
158 %1:_(s32) = COPY $sgpr0
159 %2:_(s16) = G_TRUNC %0
160 %3:_(s16) = G_TRUNC %1
161 %4:_(s16) = G_SHL %2, %3
162 S_ENDPGM 0, implicit %4
172 liveins: $vgpr0, $vgpr1
173 ; CHECK-LABEL: name: shl_s16_vv
174 ; CHECK: liveins: $vgpr0, $vgpr1
176 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
177 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
178 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
179 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
180 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(s16) = G_SHL [[TRUNC]], [[TRUNC1]](s16)
181 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](s16)
182 %0:_(s32) = COPY $vgpr0
183 %1:_(s32) = COPY $vgpr1
184 %2:_(s16) = G_TRUNC %0
185 %3:_(s16) = G_TRUNC %1
186 %4:_(s16) = G_SHL %2, %3
187 S_ENDPGM 0, implicit %4
197 liveins: $sgpr0, $sgpr1
198 ; CHECK-LABEL: name: shl_v2s16_ss
199 ; CHECK: liveins: $sgpr0, $sgpr1
201 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
202 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
203 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
204 ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
205 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST]], [[C]](s32)
206 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
207 ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
208 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST1]], [[C1]](s32)
209 ; CHECK-NEXT: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[BITCAST]], [[BITCAST1]](s32)
210 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:sgpr(s32) = G_SHL [[LSHR]], [[LSHR1]](s32)
211 ; CHECK-NEXT: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[SHL]](s32), [[SHL1]](s32)
212 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR_TRUNC]](<2 x s16>)
213 %0:_(<2 x s16>) = COPY $sgpr0
214 %1:_(<2 x s16>) = COPY $sgpr1
215 %2:_(<2 x s16>) = G_SHL %0, %1
216 S_ENDPGM 0, implicit %2
226 liveins: $sgpr0, $vgpr0
227 ; CHECK-LABEL: name: shl_v2s16_sv
228 ; CHECK: liveins: $sgpr0, $vgpr0
230 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
231 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
232 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
233 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(<2 x s16>) = G_SHL [[COPY2]], [[COPY1]](<2 x s16>)
234 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](<2 x s16>)
235 %0:_(<2 x s16>) = COPY $sgpr0
236 %1:_(<2 x s16>) = COPY $vgpr0
237 %2:_(<2 x s16>) = G_SHL %0, %1
238 S_ENDPGM 0, implicit %2
247 liveins: $sgpr0, $vgpr0
248 ; CHECK-LABEL: name: shl_v2s16_vs
249 ; CHECK: liveins: $sgpr0, $vgpr0
251 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
252 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
253 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
254 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(<2 x s16>) = G_SHL [[COPY]], [[COPY2]](<2 x s16>)
255 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](<2 x s16>)
256 %0:_(<2 x s16>) = COPY $vgpr0
257 %1:_(<2 x s16>) = COPY $sgpr0
258 %2:_(<2 x s16>) = G_SHL %0, %1
259 S_ENDPGM 0, implicit %2
269 liveins: $vgpr0, $vgpr1
270 ; CHECK-LABEL: name: shl_v2s16_vv
271 ; CHECK: liveins: $vgpr0, $vgpr1
273 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
274 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
275 ; CHECK-NEXT: [[SHL:%[0-9]+]]:vgpr(<2 x s16>) = G_SHL [[COPY]], [[COPY1]](<2 x s16>)
276 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SHL]](<2 x s16>)
277 %0:_(<2 x s16>) = COPY $vgpr0
278 %1:_(<2 x s16>) = COPY $vgpr1
279 %2:_(<2 x s16>) = G_SHL %0, %1
280 S_ENDPGM 0, implicit %2