1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-linux-gnu -O0 -run-pass=legalizer %s -o - -global-isel-abort=1 | FileCheck %s
8 ; CHECK-LABEL: name: pr63826_v2s16
11 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
12 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
13 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
14 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s32), [[C]](s32)
15 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
16 ; CHECK-NEXT: RET_ReallyLR implicit $d0
17 %1:_(<2 x s32>) = COPY $d0
18 %0:_(<2 x s16>) = G_TRUNC %1(<2 x s32>)
19 %4:_(s32) = G_CONSTANT i32 0
20 %3:_(s16) = G_CONSTANT i16 1
21 %2:_(<2 x s16>) = G_INSERT_VECTOR_ELT %0, %3(s16), %4(s32)
22 %5:_(<2 x s32>) = G_ANYEXT %2(<2 x s16>)
23 $d0 = COPY %5(<2 x s32>)
24 RET_ReallyLR implicit $d0
31 ; CHECK-LABEL: name: pr63826_v2s8
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
35 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
36 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
37 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s32), [[C]](s32)
38 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
39 ; CHECK-NEXT: RET_ReallyLR implicit $d0
40 %1:_(<2 x s32>) = COPY $d0
41 %0:_(<2 x s8>) = G_TRUNC %1(<2 x s32>)
42 %4:_(s32) = G_CONSTANT i32 0
43 %3:_(s8) = G_CONSTANT i8 1
44 %2:_(<2 x s8>) = G_INSERT_VECTOR_ELT %0, %3(s8), %4(s32)
45 %5:_(<2 x s32>) = G_ANYEXT %2(<2 x s8>)
46 $d0 = COPY %5(<2 x s32>)
47 RET_ReallyLR implicit $d0
54 ; CHECK-LABEL: name: pr63826_v4s8
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
58 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
59 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
60 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s16), [[C]](s32)
61 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<4 x s16>)
62 ; CHECK-NEXT: RET_ReallyLR implicit $d0
63 %1:_(<4 x s16>) = COPY $d0
64 %0:_(<4 x s8>) = G_TRUNC %1(<4 x s16>)
65 %4:_(s32) = G_CONSTANT i32 0
66 %3:_(s8) = G_CONSTANT i8 1
67 %2:_(<4 x s8>) = G_INSERT_VECTOR_ELT %0, %3(s8), %4(s32)
68 %5:_(<4 x s16>) = G_ANYEXT %2(<4 x s8>)
69 $d0 = COPY %5(<4 x s16>)
70 RET_ReallyLR implicit $d0
77 ; CHECK-LABEL: name: v8s8
80 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
81 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
82 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
83 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s32)
84 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<8 x s8>)
85 ; CHECK-NEXT: RET_ReallyLR
86 %0:_(<8 x s8>) = COPY $d0
87 %1:_(s32) = G_CONSTANT i32 1
88 %val:_(s8) = G_CONSTANT i8 42
89 %2:_(<8 x s8>) = G_INSERT_VECTOR_ELT %0(<8 x s8>), %val(s8), %1(s32)
90 $d0 = COPY %2(<8 x s8>)
98 ; CHECK-LABEL: name: v16s8
101 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
102 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
103 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
104 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<16 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s32)
105 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<16 x s8>)
106 ; CHECK-NEXT: RET_ReallyLR
107 %0:_(<16 x s8>) = COPY $q0
108 %1:_(s32) = G_CONSTANT i32 1
109 %val:_(s8) = G_CONSTANT i8 42
110 %2:_(<16 x s8>) = G_INSERT_VECTOR_ELT %0(<16 x s8>), %val(s8), %1(s32)
111 $q0 = COPY %2(<16 x s8>)
119 ; CHECK-LABEL: name: v4s16
120 ; CHECK: liveins: $q0
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
123 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
124 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
125 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s32)
126 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<4 x s16>)
127 ; CHECK-NEXT: RET_ReallyLR
128 %0:_(<4 x s16>) = COPY $d0
129 %1:_(s32) = G_CONSTANT i32 1
130 %val:_(s16) = G_CONSTANT i16 42
131 %2:_(<4 x s16>) = G_INSERT_VECTOR_ELT %0(<4 x s16>), %val(s16), %1(s32)
132 $d0 = COPY %2(<4 x s16>)
140 ; CHECK-LABEL: name: v8s16
141 ; CHECK: liveins: $q0
143 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
144 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
145 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
146 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s32)
147 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<8 x s16>)
148 ; CHECK-NEXT: RET_ReallyLR
149 %0:_(<8 x s16>) = COPY $q0
150 %1:_(s32) = G_CONSTANT i32 1
151 %val:_(s16) = G_CONSTANT i16 42
152 %2:_(<8 x s16>) = G_INSERT_VECTOR_ELT %0(<8 x s16>), %val(s16), %1(s32)
153 $q0 = COPY %2(<8 x s16>)
161 ; CHECK-LABEL: name: v2s32
162 ; CHECK: liveins: $q0
164 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
165 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
166 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
167 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s32)
168 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
169 ; CHECK-NEXT: RET_ReallyLR
170 %0:_(<2 x s32>) = COPY $d0
171 %1:_(s32) = G_CONSTANT i32 1
172 %val:_(s32) = G_CONSTANT i32 42
173 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0(<2 x s32>), %val(s32), %1(s32)
174 $d0 = COPY %2(<2 x s32>)
182 ; CHECK-LABEL: name: v4s32
183 ; CHECK: liveins: $q0
185 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
186 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
187 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
188 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s32)
189 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<4 x s32>)
190 ; CHECK-NEXT: RET_ReallyLR
191 %0:_(<4 x s32>) = COPY $q0
192 %1:_(s32) = G_CONSTANT i32 1
193 %val:_(s32) = G_CONSTANT i32 42
194 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %0(<4 x s32>), %val(s32), %1(s32)
195 $q0 = COPY %2(<4 x s32>)
203 ; CHECK-LABEL: name: v2s64
204 ; CHECK: liveins: $q0
206 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
207 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
208 ; CHECK-NEXT: %val:_(s64) = G_CONSTANT i64 42
209 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s64), [[C]](s32)
210 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<2 x s64>)
211 ; CHECK-NEXT: RET_ReallyLR
212 %0:_(<2 x s64>) = COPY $q0
213 %1:_(s32) = G_CONSTANT i32 1
214 %val:_(s64) = G_CONSTANT i64 42
215 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %0(<2 x s64>), %val(s64), %1(s32)
216 $q0 = COPY %2(<2 x s64>)