1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
5 name: test_bitcast_s32_to_v2s16
10 ; CHECK-LABEL: name: test_bitcast_s32_to_v2s16
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[COPY]](s32)
13 ; CHECK: $vgpr0 = COPY [[BITCAST]](<2 x s16>)
14 %0:_(s32) = COPY $vgpr0
15 %1:_(<2 x s16>) = G_BITCAST %0
20 name: test_bitcast_v2s16_to_s32
25 ; CHECK-LABEL: name: test_bitcast_v2s16_to_s32
26 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
27 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
28 ; CHECK: $vgpr0 = COPY [[BITCAST]](s32)
29 %0:_(<2 x s16>) = COPY $vgpr0
30 %1:_(s32) = G_BITCAST %0
35 name: test_bitcast_v2s32_to_s64
40 ; CHECK-LABEL: name: test_bitcast_v2s32_to_s64
41 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
42 ; CHECK: [[BITCAST:%[0-9]+]]:_(s64) = G_BITCAST [[COPY]](<2 x s32>)
43 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](s64)
44 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
45 %1:_(s64) = G_BITCAST %0
46 $vgpr0_vgpr1 = COPY %1
50 name: test_bitcast_s64_to_v2s32
55 ; CHECK-LABEL: name: test_bitcast_s64_to_v2s32
56 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
57 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s32>) = G_BITCAST [[COPY]](s64)
58 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](<2 x s32>)
59 %0:_(s64) = COPY $vgpr0_vgpr1
60 %1:_(<2 x s32>) = G_BITCAST %0
61 $vgpr0_vgpr1 = COPY %1
65 name: test_bitcast_v2s64_to_v4s32
68 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
70 ; CHECK-LABEL: name: test_bitcast_v2s64_to_v4s32
71 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
72 ; CHECK: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY]](<2 x s64>)
73 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BITCAST]](<4 x s32>)
74 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
75 %1:_(<4 x s32>) = G_BITCAST %0
76 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
80 name: test_bitcast_v4s32_to_v2s64
83 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
85 ; CHECK-LABEL: name: test_bitcast_v4s32_to_v2s64
86 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
87 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[COPY]](<4 x s32>)
88 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BITCAST]](<2 x s64>)
89 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
90 %1:_(<2 x s64>) = G_BITCAST %0
91 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
95 name: test_bitcast_v4s16_to_s64
100 ; CHECK-LABEL: name: test_bitcast_v4s16_to_s64
101 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
102 ; CHECK: [[BITCAST:%[0-9]+]]:_(s64) = G_BITCAST [[COPY]](<4 x s16>)
103 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](s64)
104 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
105 %1:_(s64) = G_BITCAST %0
106 $vgpr0_vgpr1 = COPY %1
110 name: test_bitcast_s64_to_v4s16
113 liveins: $vgpr0_vgpr1
115 ; CHECK-LABEL: name: test_bitcast_s64_to_v4s16
116 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
117 ; CHECK: [[BITCAST:%[0-9]+]]:_(<4 x s16>) = G_BITCAST [[COPY]](s64)
118 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](<4 x s16>)
119 %0:_(s64) = COPY $vgpr0_vgpr1
120 %1:_(<4 x s16>) = G_BITCAST %0
121 $vgpr0_vgpr1 = COPY %1
125 name: test_bitcast_v2s64_to_v8s16
128 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
130 ; CHECK-LABEL: name: test_bitcast_v2s64_to_v8s16
131 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
132 ; CHECK: [[BITCAST:%[0-9]+]]:_(<8 x s16>) = G_BITCAST [[COPY]](<2 x s64>)
133 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BITCAST]](<8 x s16>)
134 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
135 %1:_(<8 x s16>) = G_BITCAST %0
136 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
140 name: test_bitcast_v8s16_to_v2s64
143 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
145 ; CHECK-LABEL: name: test_bitcast_v8s16_to_v2s64
146 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
147 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[COPY]](<8 x s16>)
148 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BITCAST]](<2 x s64>)
149 %0:_(<8 x s16>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
150 %1:_(<2 x s64>) = G_BITCAST %0
151 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
155 name: test_bitcast_p0_to_p1
158 liveins: $vgpr0_vgpr1
160 ; CHECK-LABEL: name: test_bitcast_p0_to_p1
161 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
162 ; CHECK: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[COPY]](p0)
163 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](p1)
164 %0:_(p0) = COPY $vgpr0_vgpr1
165 %1:_(p1) = G_BITCAST %0
166 $vgpr0_vgpr1 = COPY %1
170 name: test_bitcast_p1_to_p0
173 liveins: $vgpr0_vgpr1
175 ; CHECK-LABEL: name: test_bitcast_p1_to_p0
176 ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
177 ; CHECK: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p1)
178 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
179 %0:_(p1) = COPY $vgpr0_vgpr1
180 %1:_(p0) = G_BITCAST %0
181 $vgpr0_vgpr1 = COPY %1
185 name: test_bitcast_p999_to_p0
188 liveins: $vgpr0_vgpr1
190 ; CHECK-LABEL: name: test_bitcast_p999_to_p0
191 ; CHECK: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
192 ; CHECK: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p999)
193 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
194 %0:_(p999) = COPY $vgpr0_vgpr1
195 %1:_(p0) = G_BITCAST %0
196 $vgpr0_vgpr1 = COPY %1
200 name: test_bitcast_p123_to_p999
203 liveins: $vgpr0_vgpr1
205 ; CHECK-LABEL: name: test_bitcast_p123_to_p999
206 ; CHECK: [[COPY:%[0-9]+]]:_(p123) = COPY $vgpr0_vgpr1
207 ; CHECK: [[BITCAST:%[0-9]+]]:_(p999) = G_BITCAST [[COPY]](p123)
208 ; CHECK: $vgpr0_vgpr1 = COPY [[BITCAST]](p999)
209 %0:_(p123) = COPY $vgpr0_vgpr1
210 %1:_(p999) = G_BITCAST %0
211 $vgpr0_vgpr1 = COPY %1
215 name: test_bitcast_v4s64_to_v8s32
216 tracksRegLiveness: true
220 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
222 ; CHECK-LABEL: name: test_bitcast_v4s64_to_v8s32
223 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
224 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
225 ; CHECK: [[BITCAST:%[0-9]+]]:_(<8 x s32>) = G_BITCAST [[COPY]](<4 x s64>)
226 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BITCAST]](<8 x s32>)
227 %0:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
228 %1:_(<8 x s32>) = G_BITCAST %0
229 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
233 name: test_bitcast_v8s32_to_v4s64
234 tracksRegLiveness: true
238 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
240 ; CHECK-LABEL: name: test_bitcast_v8s32_to_v4s64
241 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
242 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
243 ; CHECK: [[BITCAST:%[0-9]+]]:_(<4 x s64>) = G_BITCAST [[COPY]](<8 x s32>)
244 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BITCAST]](<4 x s64>)
245 %0:_(<8 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
246 %1:_(<4 x s64>) = G_BITCAST %0
247 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
251 name: test_bitcast_v8s64_to_v16s32
252 tracksRegLiveness: true
256 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
258 ; CHECK-LABEL: name: test_bitcast_v8s64_to_v16s32
259 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
260 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
261 ; CHECK: [[BITCAST:%[0-9]+]]:_(<16 x s32>) = G_BITCAST [[COPY]](<8 x s64>)
262 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[BITCAST]](<16 x s32>)
263 %0:_(<8 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
264 %1:_(<16 x s32>) = G_BITCAST %0
265 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %1
269 name: test_bitcast_v16s32_to_v8s64
270 tracksRegLiveness: true
274 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
276 ; CHECK-LABEL: name: test_bitcast_v16s32_to_v8s64
277 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
278 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
279 ; CHECK: [[BITCAST:%[0-9]+]]:_(<8 x s64>) = G_BITCAST [[COPY]](<16 x s32>)
280 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[BITCAST]](<8 x s64>)
281 %0:_(<16 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
282 %1:_(<8 x s64>) = G_BITCAST %0
283 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %1