1 ; RUN: llc < %s | FileCheck --check-prefix AS %s
2 ; RUN: opt -S -interleaved-load-combine < %s | FileCheck %s
4 ; ModuleID = 'aarch64_interleaved-ld-combine.bc'
5 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
6 target triple = "arm64--linux-gnu"
8 ; This should be lowered into LD4
9 define void @aarch64_ilc_const(ptr %ptr) {
12 ;;; Check LLVM transformation
13 ; CHECK-LABEL: @aarch64_ilc_const(
14 ; CHECK-DAG: [[GEP:%.+]] = getelementptr inbounds <4 x float>, ptr %ptr, i64 2
15 ; CHECK-DAG: [[LOAD:%.+]] = load <16 x float>, ptr [[GEP]], align 16
16 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
17 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
18 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
19 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
22 ;;; Check if it gets lowerd
23 ; AS-LABEL: aarch64_ilc_const
27 %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i64 2
28 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i64 3
29 %gep3 = getelementptr inbounds <4 x float>, ptr %ptr, i64 4
30 %gep4 = getelementptr inbounds <4 x float>, ptr %ptr, i64 5
31 %ld1 = load <4 x float>, ptr %gep1, align 16
32 %ld2 = load <4 x float>, ptr %gep2, align 16
33 %ld3 = load <4 x float>, ptr %gep3, align 16
34 %ld4 = load <4 x float>, ptr %gep4, align 16
35 %sv1 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
36 %sv2 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
37 %sv3 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
38 %sv4 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
39 %m0_3 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
40 %m4_7 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
41 %m8_11 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
42 %m12_15 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
44 store <4 x float> %m0_3, ptr %gep1, align 16
45 store <4 x float> %m4_7, ptr %gep2, align 16
46 store <4 x float> %m8_11, ptr %gep3, align 16
47 store <4 x float> %m12_15, ptr %gep4, align 16
51 ; This should be lowered into LD4
52 define void @aarch64_ilc_idx(ptr %ptr, i64 %idx) {
55 ;;; Check LLVM transformation
56 ; CHECK-LABEL: @aarch64_ilc_idx(
57 ; CHECK-DAG: [[ADD:%.+]] = add i64 %idx, 16
58 ; CHECK-DAG: [[LSHR:%.+]] = lshr i64 [[ADD]], 2
59 ; CHECK-DAG: [[GEP:%.+]] = getelementptr inbounds <4 x float>, ptr %ptr, i64 [[LSHR]]
60 ; CHECK-DAG: [[LOAD:%.+]] = load <16 x float>, ptr [[GEP]], align 16
61 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
62 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
63 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
64 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
67 ; AS-LABEL: aarch64_ilc_idx
68 ; AS-DAG: lsl [[LSL:x[0-9]+]], x1, #2
69 ; AS-DAG: add [[ADD:x[0-9]+]], [[LSL]], #64
70 ; AS-DAG: and [[AND:x[0-9]+]], [[ADD]], #0xfffffffffffffff0
71 ; AS-DAG: add [[ADR:x[0-9]+]], x0, [[AND]]
72 ; AS-DAG: ld4 { v[[V0:[0-9]+]].4s, v[[V1:[0-9]+]].4s, v[[V2:[0-9]+]].4s, v[[V3:[0-9]+]].4s }, [[[ADR]]]
79 %a2 = add i64 %idx, 20
80 %idx2 = lshr i64 %a2, 2
81 %a3 = add i64 %idx, 24
82 %a1 = add i64 %idx, 16
83 %idx1 = lshr i64 %a1, 2
84 %idx3 = lshr i64 %a3, 2
85 %a4 = add i64 %idx, 28
86 %idx4 = lshr i64 %a4, 2
88 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx2
89 %gep4 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx4
90 %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx1
91 %gep3 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx3
92 %ld1 = load <4 x float>, ptr %gep1, align 16
93 %ld2 = load <4 x float>, ptr %gep2, align 16
94 %ld3 = load <4 x float>, ptr %gep3, align 16
95 %ld4 = load <4 x float>, ptr %gep4, align 16
96 %sv1 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
97 %sv2 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
98 %sv3 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
99 %sv4 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
100 %m0_3 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
101 %m4_7 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
102 %m8_11 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
103 %m12_15 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
105 store <4 x float> %m0_3, ptr %gep1, align 16
106 store <4 x float> %m4_7, ptr %gep2, align 16
107 store <4 x float> %m8_11, ptr %gep3, align 16
108 store <4 x float> %m12_15, ptr %gep4, align 16
112 ; This should be lowered into LD4, a offset of has to be taken into account
113 %struct.ilc = type <{ float, [0 x <4 x float>] }>
114 define void @aarch64_ilc_struct(ptr %ptr, i64 %idx) {
117 ;;; Check LLVM transformation
118 ; CHECK-LABEL: @aarch64_ilc_struct(
119 ; CHECK-DAG: [[LSHR:%.+]] = lshr i64 %idx, 2
120 ; CHECK-DAG: [[GEP:%.+]] = getelementptr %struct.ilc, ptr %ptr, i32 0, i32 1, i64 [[LSHR]]
121 ; CHECK-DAG: [[LOAD:%.+]] = load <16 x float>, ptr [[GEP]], align 4
122 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
123 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
124 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
125 ; CHECK-DAG: %{{.* }}= shufflevector <16 x float> [[LOAD]], <16 x float> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
128 ; AS-LABEL: aarch64_ilc_struct
129 ; AS-DAG: lsl [[LSL:x[0-9]+]], x1, #2
130 ; AS-DAG: add [[ADD:x[0-9]+]], x0, #4
131 ; AS-DAG: and [[AND:x[0-9]+]], [[LSL]], #0xfffffffffffffff0
132 ; AS-DAG: add [[ADR:x[0-9]+]], [[ADD]], [[AND]]
133 ; AS-DAG: ld4 { v[[V0:[0-9]+]].4s, v[[V1:[0-9]+]].4s, v[[V2:[0-9]+]].4s, v[[V3:[0-9]+]].4s }, [[[ADR]]]
134 ; AS-DAG: str q[[V0]]
135 ; AS-DAG: str q[[V1]]
136 ; AS-DAG: str q[[V2]]
137 ; AS-DAG: str q[[V3]]
140 %a1 = add i64 %idx, 4
141 %idx2 = lshr i64 %a1, 2
142 %a2 = add i64 %idx, 8
143 %idx3 = lshr i64 %a2, 2
144 %a3 = add i64 %idx, 12
145 %idx4 = lshr i64 %a3, 2
147 %gep2 = getelementptr %struct.ilc, ptr %ptr, i32 0, i32 1, i64 %idx2
148 %gep3 = getelementptr %struct.ilc, ptr %ptr, i32 0, i32 1, i64 %idx3
149 %gep4 = getelementptr %struct.ilc, ptr %ptr, i32 0, i32 1, i64 %idx4
150 %idx1 = lshr i64 %idx, 2
151 %gep1 = getelementptr %struct.ilc, ptr %ptr, i32 0, i32 1, i64 %idx1
152 %ld1 = load <4 x float>, ptr %gep1, align 4
153 %ld2 = load <4 x float>, ptr %gep2, align 4
154 %ld3 = load <4 x float>, ptr %gep3, align 4
155 %ld4 = load <4 x float>, ptr %gep4, align 4
156 %sv1 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
157 %sv2 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
158 %sv3 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
159 %sv4 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
160 %m0_3 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
161 %m4_7 = shufflevector <4 x float> %sv1, <4 x float> %sv3, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
162 %m8_11 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
163 %m12_15 = shufflevector <4 x float> %sv2, <4 x float> %sv4, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
165 store <4 x float> %m0_3, ptr %gep1, align 16
166 store <4 x float> %m4_7, ptr %gep2, align 16
167 store <4 x float> %m8_11, ptr %gep3, align 16
168 store <4 x float> %m12_15, ptr %gep4, align 16
172 ; This should be lowered into LD2
173 define void @aarch64_ilc_idx_ld2(ptr %ptr, i64 %idx) {
175 ; CHECK-LABEL: @aarch64_ilc_idx_ld2(
176 ; CHECK-DAG: [[LSHR:%.+]] = lshr i64 %idx, 2
177 ; CHECK-DAG: [[GEP:%.+]] = getelementptr inbounds <4 x float>, ptr %ptr, i64 [[LSHR]]
178 ; CHECK-DAG: [[LOAD:%.+]] = load <8 x float>, ptr [[GEP]], align 16
179 ; CHECK: %{{.* }}= shufflevector <8 x float> [[LOAD]], <8 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
180 ; CHECK: %{{.* }}= shufflevector <8 x float> [[LOAD]], <8 x float> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
181 ; CHECK-DAG: ret void
183 ; AS-LABEL: aarch64_ilc_idx_ld2
187 %idx1 = lshr i64 %idx, 2
188 %a1 = add i64 %idx, 4
189 %idx2 = lshr i64 %a1, 2
191 %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx1
192 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx2
193 %ld1 = load <4 x float>, ptr %gep1, align 16
194 %ld2 = load <4 x float>, ptr %gep2, align 16
195 %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
196 %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
198 store <4 x float> %m0_3, ptr %gep1
199 store <4 x float> %m4_7, ptr %gep2
203 ; This should be lowered into LD3
204 define void @aarch64_ilc_idx_ld3(ptr %ptr, i64 %idx) {
206 ; CHECK-LABEL: @aarch64_ilc_idx_ld3(
207 ; CHECK-DAG: [[LSHR:%.+]] = lshr i64 %idx, 2
208 ; CHECK-DAG: [[GEP:%.+]] = getelementptr inbounds <4 x float>, ptr %ptr, i64 [[LSHR]]
209 ; CHECK-DAG: [[LOAD:%.+]] = load <12 x float>, ptr [[GEP]], align 16
210 ; CHECK: %{{.* }}= shufflevector <12 x float> [[LOAD]], <12 x float> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
211 ; CHECK: %{{.* }}= shufflevector <12 x float> [[LOAD]], <12 x float> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
212 ; CHECK: %{{.* }}= shufflevector <12 x float> [[LOAD]], <12 x float> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
213 ; CHECK-DAG: ret void
215 ; AS-LABEL: aarch64_ilc_idx_ld3
219 %idx1 = lshr i64 %idx, 2
220 %a1 = add i64 %idx, 4
221 %idx2 = lshr i64 %a1, 2
222 %a2 = add i64 %idx, 8
223 %idx3 = lshr i64 %a2, 2
225 %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx1
226 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx2
227 %gep3 = getelementptr inbounds <4 x float>, ptr %ptr, i64 %idx3
228 %ld1 = load <4 x float>, ptr %gep1, align 16
229 %ld2 = load <4 x float>, ptr %gep2, align 16
230 %ld3 = load <4 x float>, ptr %gep3, align 16
232 %sv1 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 3, i32 6, i32 undef>
233 %sv2 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 4, i32 7, i32 undef>
234 %sv3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 2, i32 5, i32 undef, i32 undef>
235 %m0_3 = shufflevector <4 x float> %sv1, <4 x float> %ld3, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
236 %m4_7 = shufflevector <4 x float> %sv2, <4 x float> %ld3, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
237 %m8_11 = shufflevector <4 x float> %sv3, <4 x float> %ld3, <4 x i32> <i32 0, i32 1, i32 4, i32 7>
239 store <4 x float> %m0_3, ptr %gep1, align 16
240 store <4 x float> %m4_7, ptr %gep2, align 16
241 store <4 x float> %m8_11, ptr %gep3, align 16
244 ; %sv3 = shufflevector <4 x float> %ld3, <4 x float> %ld4, <4 x i32> <i32 0, i32 undef, i32 4, i32 undef>
246 ; This must not be lowered
247 define void @aarch64_ilc_i32_idx(ptr %ptr, i32 %idx) {
248 ; CHECK-LABEL: @aarch64_ilc_i32_idx(
249 ; CHECK: %idx1 = lshr i32 %idx, 2
250 ; CHECK-NEXT: %a1 = add i32 %idx, 4
251 ; CHECK-NEXT: %idx2 = lshr i32 %a1, 2
252 ; CHECK-NEXT: %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i32 %idx1
253 ; CHECK-NEXT: %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 %idx2
254 ; CHECK-NEXT: %ld1 = load <4 x float>, ptr %gep1, align 16
255 ; CHECK-NEXT: %ld2 = load <4 x float>, ptr %gep2, align 16
256 ; CHECK-NEXT: %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
257 ; CHECK-NEXT: %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
258 ; CHECK-NEXT: store <4 x float> %m0_3, ptr %gep1, align 16
259 ; CHECK-NEXT: store <4 x float> %m4_7, ptr %gep2, align 16
260 ; CHECK-NEXT: ret void
262 ; AS-LABEL: aarch64_ilc_i32_idx
270 %idx1 = lshr i32 %idx, 2
271 %a1 = add i32 %idx, 4
272 %idx2 = lshr i32 %a1, 2
274 %gep1 = getelementptr inbounds <4 x float>, ptr %ptr, i32 %idx1
275 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 %idx2
276 %ld1 = load <4 x float>, ptr %gep1, align 16
277 %ld2 = load <4 x float>, ptr %gep2, align 16
278 %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
279 %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
281 store <4 x float> %m0_3, ptr %gep1, align 16
282 store <4 x float> %m4_7, ptr %gep2, align 16
286 ; Volatile loads must not be lowered
287 define void @aarch64_ilc_volatile(ptr %ptr) {
288 ; CHECK-LABEL: @aarch64_ilc_volatile(
289 ; CHECK: %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 1
290 ; CHECK-NEXT: %ld1 = load volatile <4 x float>, ptr %ptr, align 16
291 ; CHECK-NEXT: %ld2 = load <4 x float>, ptr %gep2, align 16
292 ; CHECK-NEXT: %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
293 ; CHECK-NEXT: %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
294 ; CHECK-NEXT: store <4 x float> %m0_3, ptr %ptr, align 16
295 ; CHECK-NEXT: store <4 x float> %m4_7, ptr %gep2, align 16
296 ; CHECK-NEXT: ret void
298 ; AS-LABEL: aarch64_ilc_volatile
306 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 1
307 %ld1 = load volatile <4 x float>, ptr %ptr, align 16
308 %ld2 = load <4 x float>, ptr %gep2, align 16
309 %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
310 %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
311 store <4 x float> %m0_3, ptr %ptr, align 16
312 store <4 x float> %m4_7, ptr %gep2, align 16
316 ; This must not be lowered
317 define void @aarch64_ilc_depmem(ptr %ptr, i32 %idx) {
319 ; CHECK-LABEL: @aarch64_ilc_depmem(
320 ; CHECK: %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 1
321 ; CHECK-NEXT: %ld1 = load <4 x float>, ptr %ptr, align 16
322 ; CHECK-NEXT: store <4 x float> %ld1, ptr %gep2, align 16
323 ; CHECK-NEXT: %ld2 = load <4 x float>, ptr %gep2, align 16
324 ; CHECK-NEXT: %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
325 ; CHECK-NEXT: %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
326 ; CHECK-NEXT: store <4 x float> %m0_3, ptr %ptr, align 16
327 ; CHECK-NEXT: store <4 x float> %m4_7, ptr %gep2, align 16
328 ; CHECK-NEXT: ret void
330 ; AS-LABEL: aarch64_ilc_depmem
337 %gep2 = getelementptr inbounds <4 x float>, ptr %ptr, i32 1
338 %ld1 = load <4 x float>, ptr %ptr, align 16
339 store <4 x float> %ld1, ptr %gep2, align 16
340 %ld2 = load <4 x float>, ptr %gep2, align 16
341 %m0_3 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
342 %m4_7 = shufflevector <4 x float> %ld1, <4 x float> %ld2, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
344 store <4 x float> %m0_3, ptr %ptr, align 16
345 store <4 x float> %m4_7, ptr %gep2, align 16
349 ; This cannot be converted - insertion position cannot be determined
350 define void @aarch64_no_insertion_pos(ptr %ptr) {
352 ; CHECK-LABEL: @aarch64_no_insertion_pos(
353 ; CHECK: %p1 = getelementptr inbounds float, ptr %ptr, i32 4
354 ; CHECK-NEXT: %l0 = load <5 x float>, ptr %ptr
355 ; CHECK-NEXT: %l1 = load <5 x float>, ptr %p1
356 ; CHECK-NEXT: %s0 = shufflevector <5 x float> %l0, <5 x float> %l1, <4 x i32> <i32 1, i32 3, i32 6, i32 8>
357 ; CHECK-NEXT: %s1 = shufflevector <5 x float> %l0, <5 x float> %l1, <4 x i32> <i32 2, i32 4, i32 7, i32 9>
358 ; CHECK-NEXT: ret void
360 %p1 = getelementptr inbounds float, ptr %ptr, i32 4
361 %l0 = load <5 x float>, ptr %ptr
362 %l1 = load <5 x float>, ptr %p1
363 %s0 = shufflevector <5 x float> %l0, <5 x float> %l1, <4 x i32> <i32 1, i32 3, i32 6, i32 8>
364 %s1 = shufflevector <5 x float> %l0, <5 x float> %l1, <4 x i32> <i32 2, i32 4, i32 7, i32 9>
368 ; This cannot be converted - the insertion position does not dominate all
370 define void @aarch64_insertpos_does_not_dominate(ptr %ptr) {
372 ; CHECK-LABEL: @aarch64_insertpos_does_not_dominate(
373 ; CHECK: %p1 = getelementptr inbounds float, ptr %ptr, i32 1
374 ; CHECK-NEXT: %l1 = load <7 x float>, ptr %p1
375 ; CHECK-NEXT: %s1 = shufflevector <7 x float> %l1, <7 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
376 ; CHECK-NEXT: %l0 = load <7 x float>, ptr %ptr
377 ; CHECK-NEXT: %s0 = shufflevector <7 x float> %l0, <7 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
378 ; CHECK-NEXT: ret void
379 %p1 = getelementptr inbounds float, ptr %ptr, i32 1
380 %l1 = load <7 x float>, ptr %p1
381 %s1 = shufflevector <7 x float> %l1, <7 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
382 %l0 = load <7 x float>, ptr %ptr
383 %s0 = shufflevector <7 x float> %l0, <7 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>