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 - | FileCheck %s
8 liveins: $w0, $w1, $w2, $w3
9 ; CHECK-LABEL: name: legal_v4s32
10 ; CHECK: liveins: $w0, $w1, $w2, $w3
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
13 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
14 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
15 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $w3
16 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
17 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<4 x s32>)
18 ; CHECK-NEXT: RET_ReallyLR
23 %4:_(<4 x s32>) = G_BUILD_VECTOR %0(s32), %1(s32), %2(s32), %3(s32)
24 $q0 = COPY %4(<4 x s32>)
32 ; CHECK-LABEL: name: legal_v2s64
33 ; CHECK: liveins: $x0, $x1
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
36 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
37 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
38 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<2 x s64>)
39 ; CHECK-NEXT: RET_ReallyLR
42 %2:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
43 $q0 = COPY %2(<2 x s64>)
51 ; CHECK-LABEL: name: legal_v2p0
52 ; CHECK: liveins: $x0, $x1
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
55 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
56 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[COPY]](p0), [[COPY1]](p0)
57 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<2 x p0>)
58 ; CHECK-NEXT: RET_ReallyLR
61 %2:_(<2 x p0>) = G_BUILD_VECTOR %0(p0), %1(p0)
62 $q0 = COPY %2(<2 x p0>)
69 ; CHECK-LABEL: name: legal_v16s8
70 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
71 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
72 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<16 x s8>) = G_BUILD_VECTOR [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8)
73 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<16 x s8>)
74 ; CHECK-NEXT: RET_ReallyLR
75 %0:_(s8) = G_IMPLICIT_DEF
76 %1:_(s8) = G_IMPLICIT_DEF
77 %2:_(<16 x s8>) = G_BUILD_VECTOR %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8)
78 $q0 = COPY %2(<16 x s8>)
85 ; CHECK-LABEL: name: legal_v8s8
86 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
87 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
88 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s8>) = G_BUILD_VECTOR [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8)
89 ; CHECK-NEXT: $d0 = COPY [[BUILD_VECTOR]](<8 x s8>)
90 ; CHECK-NEXT: RET_ReallyLR
91 %0:_(s8) = G_IMPLICIT_DEF
92 %1:_(s8) = G_IMPLICIT_DEF
93 %2:_(<8 x s8>) = G_BUILD_VECTOR %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8)
94 $d0 = COPY %2(<8 x s8>)
101 ; CHECK-LABEL: name: widen_v16s1
102 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
103 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
104 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<16 x s8>) = G_BUILD_VECTOR [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8)
105 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<16 x s8>)
106 ; CHECK-NEXT: RET_ReallyLR
107 %0:_(s1) = G_IMPLICIT_DEF
108 %1:_(s1) = G_IMPLICIT_DEF
109 %2:_(<16 x s1>) = G_BUILD_VECTOR %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1), %0(s1), %1(s1)
110 %w:_(<16 x s8>) = G_ANYEXT %2
111 $q0 = COPY %w(<16 x s8>)
119 ; CHECK-LABEL: name: widen_v2s16
120 ; CHECK: liveins: $x0, $x1
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
123 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $h1
124 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
125 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[COPY]](s16), [[COPY1]](s16), [[DEF]](s16), [[DEF]](s16)
126 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<4 x s32>) = G_ANYEXT [[BUILD_VECTOR]](<4 x s16>)
127 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[ANYEXT]](<4 x s32>)
128 ; CHECK-NEXT: $d0 = COPY [[UV]](<2 x s32>)
129 ; CHECK-NEXT: RET_ReallyLR
132 %2:_(<2 x s16>) = G_BUILD_VECTOR %0(s16), %1(s16)
133 %3:_(<2 x s32>) = G_ANYEXT %2(<2 x s16>)
134 $d0 = COPY %3(<2 x s32>)
142 ; CHECK-LABEL: name: widen_v2s8
143 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
144 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
145 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[DEF]](s32)
146 ; CHECK-NEXT: $d0 = COPY [[BUILD_VECTOR]](<2 x s32>)
147 ; CHECK-NEXT: RET_ReallyLR
148 %0:_(s8) = G_IMPLICIT_DEF
149 %1:_(s8) = G_IMPLICIT_DEF
150 %2:_(<2 x s8>) = G_BUILD_VECTOR %0(s8), %1(s8)
151 %3:_(<2 x s32>) = G_ANYEXT %2(<2 x s8>)
152 $d0 = COPY %3(<2 x s32>)
160 ; CHECK-LABEL: name: widen_v4s8
161 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
162 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
163 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
164 ; CHECK-NEXT: [[DEF3:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
165 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s8>) = G_BUILD_VECTOR [[DEF]](s8), [[DEF1]](s8), [[DEF2]](s8), [[DEF3]](s8), [[DEF]](s8), [[DEF]](s8), [[DEF]](s8), [[DEF]](s8)
166 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<8 x s16>) = G_ANYEXT [[BUILD_VECTOR]](<8 x s8>)
167 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[ANYEXT]](<8 x s16>)
168 ; CHECK-NEXT: $d0 = COPY [[UV]](<4 x s16>)
169 ; CHECK-NEXT: RET_ReallyLR
170 %0:_(s8) = G_IMPLICIT_DEF
171 %1:_(s8) = G_IMPLICIT_DEF
172 %2:_(s8) = G_IMPLICIT_DEF
173 %3:_(s8) = G_IMPLICIT_DEF
174 %4:_(<4 x s8>) = G_BUILD_VECTOR %0(s8), %1(s8), %2(s8), %3(s8)
175 %5:_(<4 x s16>) = G_ANYEXT %4(<4 x s8>)
176 $d0 = COPY %5(<4 x s16>)