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
7 ; CHECK-LABEL: name: pr63826
8 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $w0
9 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
10 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
11 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<2 x s16>)
12 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
13 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[DEF]](s16), [[DEF]](s16)
14 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[BUILD_VECTOR]], [[C]](s16), [[C1]](s32)
15 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[IVEC]](<4 x s16>)
16 ; CHECK-NEXT: $w0 = COPY [[UV2]](<2 x s16>)
17 %0:_(<2 x s16>) = COPY $w0
18 %1:_(s16) = G_CONSTANT i16 1
19 %2:_(s32) = G_CONSTANT i32 42
20 %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT %0(<2 x s16>), %1(s16), %2(s32)
21 $w0 = COPY %4(<2 x s16>)
28 ; CHECK-LABEL: name: v8s8
31 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
32 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
33 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
34 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s32)
35 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<8 x s8>)
36 ; CHECK-NEXT: RET_ReallyLR
37 %0:_(<8 x s8>) = COPY $d0
38 %1:_(s32) = G_CONSTANT i32 1
39 %val:_(s8) = G_CONSTANT i8 42
40 %2:_(<8 x s8>) = G_INSERT_VECTOR_ELT %0(<8 x s8>), %val(s8), %1(s32)
41 $d0 = COPY %2(<8 x s8>)
49 ; CHECK-LABEL: name: v16s8
52 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
53 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
54 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
55 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<16 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s32)
56 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<16 x s8>)
57 ; CHECK-NEXT: RET_ReallyLR
58 %0:_(<16 x s8>) = COPY $q0
59 %1:_(s32) = G_CONSTANT i32 1
60 %val:_(s8) = G_CONSTANT i8 42
61 %2:_(<16 x s8>) = G_INSERT_VECTOR_ELT %0(<16 x s8>), %val(s8), %1(s32)
62 $q0 = COPY %2(<16 x s8>)
70 ; CHECK-LABEL: name: v4s16
73 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
74 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
75 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
76 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s32)
77 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<4 x s16>)
78 ; CHECK-NEXT: RET_ReallyLR
79 %0:_(<4 x s16>) = COPY $d0
80 %1:_(s32) = G_CONSTANT i32 1
81 %val:_(s16) = G_CONSTANT i16 42
82 %2:_(<4 x s16>) = G_INSERT_VECTOR_ELT %0(<4 x s16>), %val(s16), %1(s32)
83 $d0 = COPY %2(<4 x s16>)
91 ; CHECK-LABEL: name: v8s16
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
95 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
96 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
97 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s32)
98 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<8 x s16>)
99 ; CHECK-NEXT: RET_ReallyLR
100 %0:_(<8 x s16>) = COPY $q0
101 %1:_(s32) = G_CONSTANT i32 1
102 %val:_(s16) = G_CONSTANT i16 42
103 %2:_(<8 x s16>) = G_INSERT_VECTOR_ELT %0(<8 x s16>), %val(s16), %1(s32)
104 $q0 = COPY %2(<8 x s16>)
112 ; CHECK-LABEL: name: v2s32
113 ; CHECK: liveins: $q0
115 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
116 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
117 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
118 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s32)
119 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
120 ; CHECK-NEXT: RET_ReallyLR
121 %0:_(<2 x s32>) = COPY $d0
122 %1:_(s32) = G_CONSTANT i32 1
123 %val:_(s32) = G_CONSTANT i32 42
124 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0(<2 x s32>), %val(s32), %1(s32)
125 $d0 = COPY %2(<2 x s32>)
133 ; CHECK-LABEL: name: v4s32
134 ; CHECK: liveins: $q0
136 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
137 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
138 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
139 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s32)
140 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<4 x s32>)
141 ; CHECK-NEXT: RET_ReallyLR
142 %0:_(<4 x s32>) = COPY $q0
143 %1:_(s32) = G_CONSTANT i32 1
144 %val:_(s32) = G_CONSTANT i32 42
145 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %0(<4 x s32>), %val(s32), %1(s32)
146 $q0 = COPY %2(<4 x s32>)
154 ; CHECK-LABEL: name: v2s64
155 ; CHECK: liveins: $q0
157 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
158 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
159 ; CHECK-NEXT: %val:_(s64) = G_CONSTANT i64 42
160 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s64), [[C]](s32)
161 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<2 x s64>)
162 ; CHECK-NEXT: RET_ReallyLR
163 %0:_(<2 x s64>) = COPY $q0
164 %1:_(s32) = G_CONSTANT i32 1
165 %val:_(s64) = G_CONSTANT i64 42
166 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %0(<2 x s64>), %val(s64), %1(s32)
167 $q0 = COPY %2(<2 x s64>)