1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -slp-vectorize-non-power-of-2 -mtriple=arm64-apple-ios -S %s | FileCheck --check-prefixes=CHECK,NON-POW2 %s
3 ; RUN: opt -passes=slp-vectorizer -slp-vectorize-non-power-of-2=false -mtriple=arm64-apple-ios -S %s | FileCheck --check-prefixes=CHECK,POW2-ONLY %s
5 define void @v3_load_i32_mul_by_constant_store(ptr %src, ptr %dst) {
6 ; NON-POW2-LABEL: @v3_load_i32_mul_by_constant_store(
7 ; NON-POW2-NEXT: entry:
8 ; NON-POW2-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds i32, ptr [[SRC:%.*]], i32 0
9 ; NON-POW2-NEXT: [[TMP0:%.*]] = load <3 x i32>, ptr [[GEP_SRC_0]], align 4
10 ; NON-POW2-NEXT: [[TMP1:%.*]] = mul nsw <3 x i32> [[TMP0]], splat (i32 10)
11 ; NON-POW2-NEXT: store <3 x i32> [[TMP1]], ptr [[DST:%.*]], align 4
12 ; NON-POW2-NEXT: ret void
14 ; POW2-ONLY-LABEL: @v3_load_i32_mul_by_constant_store(
15 ; POW2-ONLY-NEXT: entry:
16 ; POW2-ONLY-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds i32, ptr [[SRC:%.*]], i32 0
17 ; POW2-ONLY-NEXT: [[GEP_SRC_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 2
18 ; POW2-ONLY-NEXT: [[L_SRC_2:%.*]] = load i32, ptr [[GEP_SRC_2]], align 4
19 ; POW2-ONLY-NEXT: [[MUL_2:%.*]] = mul nsw i32 [[L_SRC_2]], 10
20 ; POW2-ONLY-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[GEP_SRC_0]], align 4
21 ; POW2-ONLY-NEXT: [[TMP1:%.*]] = mul nsw <2 x i32> [[TMP0]], splat (i32 10)
22 ; POW2-ONLY-NEXT: store <2 x i32> [[TMP1]], ptr [[DST:%.*]], align 4
23 ; POW2-ONLY-NEXT: [[DST_2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
24 ; POW2-ONLY-NEXT: store i32 [[MUL_2]], ptr [[DST_2]], align 4
25 ; POW2-ONLY-NEXT: ret void
28 %gep.src.0 = getelementptr inbounds i32, ptr %src, i32 0
29 %l.src.0 = load i32, ptr %gep.src.0, align 4
30 %mul.0 = mul nsw i32 %l.src.0, 10
32 %gep.src.1 = getelementptr inbounds i32, ptr %src, i32 1
33 %l.src.1 = load i32, ptr %gep.src.1, align 4
34 %mul.1 = mul nsw i32 %l.src.1, 10
36 %gep.src.2 = getelementptr inbounds i32, ptr %src, i32 2
37 %l.src.2 = load i32, ptr %gep.src.2, align 4
38 %mul.2 = mul nsw i32 %l.src.2, 10
40 store i32 %mul.0, ptr %dst
42 %dst.1 = getelementptr i32, ptr %dst, i32 1
43 store i32 %mul.1, ptr %dst.1
45 %dst.2 = getelementptr i32, ptr %dst, i32 2
46 store i32 %mul.2, ptr %dst.2
51 ; Should no be vectorized with a undef/poison element as padding, as division by undef/poison may cause UB.
52 define void @v3_load_i32_udiv_by_constant_store(ptr %src, ptr %dst) {
53 ; CHECK-LABEL: @v3_load_i32_udiv_by_constant_store(
55 ; CHECK-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds i32, ptr [[SRC:%.*]], i32 0
56 ; CHECK-NEXT: [[L_SRC_0:%.*]] = load i32, ptr [[GEP_SRC_0]], align 4
57 ; CHECK-NEXT: [[MUL_0:%.*]] = udiv i32 10, [[L_SRC_0]]
58 ; CHECK-NEXT: [[GEP_SRC_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 1
59 ; CHECK-NEXT: [[L_SRC_1:%.*]] = load i32, ptr [[GEP_SRC_1]], align 4
60 ; CHECK-NEXT: [[MUL_1:%.*]] = udiv i32 10, [[L_SRC_1]]
61 ; CHECK-NEXT: [[GEP_SRC_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 2
62 ; CHECK-NEXT: [[L_SRC_2:%.*]] = load i32, ptr [[GEP_SRC_2]], align 4
63 ; CHECK-NEXT: [[MUL_2:%.*]] = udiv i32 10, [[L_SRC_2]]
64 ; CHECK-NEXT: store i32 [[MUL_0]], ptr [[DST:%.*]], align 4
65 ; CHECK-NEXT: [[DST_1:%.*]] = getelementptr i32, ptr [[DST]], i32 1
66 ; CHECK-NEXT: store i32 [[MUL_1]], ptr [[DST_1]], align 4
67 ; CHECK-NEXT: [[DST_2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
68 ; CHECK-NEXT: store i32 [[MUL_2]], ptr [[DST_2]], align 4
69 ; CHECK-NEXT: ret void
72 %gep.src.0 = getelementptr inbounds i32, ptr %src, i32 0
73 %l.src.0 = load i32, ptr %gep.src.0, align 4
74 %mul.0 = udiv i32 10, %l.src.0
76 %gep.src.1 = getelementptr inbounds i32, ptr %src, i32 1
77 %l.src.1 = load i32, ptr %gep.src.1, align 4
78 %mul.1 = udiv i32 10, %l.src.1
80 %gep.src.2 = getelementptr inbounds i32, ptr %src, i32 2
81 %l.src.2 = load i32, ptr %gep.src.2, align 4
82 %mul.2 = udiv i32 10, %l.src.2
84 store i32 %mul.0, ptr %dst
86 %dst.1 = getelementptr i32, ptr %dst, i32 1
87 store i32 %mul.1, ptr %dst.1
89 %dst.2 = getelementptr i32, ptr %dst, i32 2
90 store i32 %mul.2, ptr %dst.2
97 define void @v3_load_i32_mul_store(ptr %src.1, ptr %src.2, ptr %dst) {
98 ; NON-POW2-LABEL: @v3_load_i32_mul_store(
99 ; NON-POW2-NEXT: entry:
100 ; NON-POW2-NEXT: [[GEP_SRC_1_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_1:%.*]], i32 0
101 ; NON-POW2-NEXT: [[GEP_SRC_2_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_2:%.*]], i32 0
102 ; NON-POW2-NEXT: [[TMP0:%.*]] = load <3 x i32>, ptr [[GEP_SRC_1_0]], align 4
103 ; NON-POW2-NEXT: [[TMP1:%.*]] = load <3 x i32>, ptr [[GEP_SRC_2_0]], align 4
104 ; NON-POW2-NEXT: [[TMP2:%.*]] = mul nsw <3 x i32> [[TMP0]], [[TMP1]]
105 ; NON-POW2-NEXT: store <3 x i32> [[TMP2]], ptr [[DST:%.*]], align 4
106 ; NON-POW2-NEXT: ret void
108 ; POW2-ONLY-LABEL: @v3_load_i32_mul_store(
109 ; POW2-ONLY-NEXT: entry:
110 ; POW2-ONLY-NEXT: [[GEP_SRC_1_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_1:%.*]], i32 0
111 ; POW2-ONLY-NEXT: [[GEP_SRC_2_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_2:%.*]], i32 0
112 ; POW2-ONLY-NEXT: [[GEP_SRC_1_2:%.*]] = getelementptr inbounds i32, ptr [[SRC_1]], i32 2
113 ; POW2-ONLY-NEXT: [[L_SRC_1_2:%.*]] = load i32, ptr [[GEP_SRC_1_2]], align 4
114 ; POW2-ONLY-NEXT: [[GEP_SRC_2_2:%.*]] = getelementptr inbounds i32, ptr [[SRC_2]], i32 2
115 ; POW2-ONLY-NEXT: [[L_SRC_2_2:%.*]] = load i32, ptr [[GEP_SRC_2_2]], align 4
116 ; POW2-ONLY-NEXT: [[MUL_2:%.*]] = mul nsw i32 [[L_SRC_1_2]], [[L_SRC_2_2]]
117 ; POW2-ONLY-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[GEP_SRC_1_0]], align 4
118 ; POW2-ONLY-NEXT: [[TMP1:%.*]] = load <2 x i32>, ptr [[GEP_SRC_2_0]], align 4
119 ; POW2-ONLY-NEXT: [[TMP2:%.*]] = mul nsw <2 x i32> [[TMP0]], [[TMP1]]
120 ; POW2-ONLY-NEXT: store <2 x i32> [[TMP2]], ptr [[DST:%.*]], align 4
121 ; POW2-ONLY-NEXT: [[DST_2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
122 ; POW2-ONLY-NEXT: store i32 [[MUL_2]], ptr [[DST_2]], align 4
123 ; POW2-ONLY-NEXT: ret void
126 %gep.src.1.0 = getelementptr inbounds i32, ptr %src.1, i32 0
127 %l.src.1.0 = load i32, ptr %gep.src.1.0, align 4
128 %gep.src.2.0 = getelementptr inbounds i32, ptr %src.2, i32 0
129 %l.src.2.0 = load i32, ptr %gep.src.2.0, align 4
130 %mul.0 = mul nsw i32 %l.src.1.0, %l.src.2.0
132 %gep.src.1.1 = getelementptr inbounds i32, ptr %src.1, i32 1
133 %l.src.1.1 = load i32, ptr %gep.src.1.1, align 4
134 %gep.src.2.1 = getelementptr inbounds i32, ptr %src.2, i32 1
135 %l.src.2.1 = load i32, ptr %gep.src.2.1, align 4
136 %mul.1 = mul nsw i32 %l.src.1.1, %l.src.2.1
138 %gep.src.1.2 = getelementptr inbounds i32, ptr %src.1, i32 2
139 %l.src.1.2 = load i32, ptr %gep.src.1.2, align 4
140 %gep.src.2.2 = getelementptr inbounds i32, ptr %src.2, i32 2
141 %l.src.2.2 = load i32, ptr %gep.src.2.2, align 4
142 %mul.2 = mul nsw i32 %l.src.1.2, %l.src.2.2
144 store i32 %mul.0, ptr %dst
146 %dst.1 = getelementptr i32, ptr %dst, i32 1
147 store i32 %mul.1, ptr %dst.1
149 %dst.2 = getelementptr i32, ptr %dst, i32 2
150 store i32 %mul.2, ptr %dst.2
155 define void @v3_load_i32_mul_add_const_store(ptr %src.1, ptr %src.2, ptr %dst) {
156 ; NON-POW2-LABEL: @v3_load_i32_mul_add_const_store(
157 ; NON-POW2-NEXT: entry:
158 ; NON-POW2-NEXT: [[GEP_SRC_1_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_1:%.*]], i32 0
159 ; NON-POW2-NEXT: [[GEP_SRC_2_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_2:%.*]], i32 0
160 ; NON-POW2-NEXT: [[TMP0:%.*]] = load <3 x i32>, ptr [[GEP_SRC_1_0]], align 4
161 ; NON-POW2-NEXT: [[TMP1:%.*]] = load <3 x i32>, ptr [[GEP_SRC_2_0]], align 4
162 ; NON-POW2-NEXT: [[TMP2:%.*]] = mul nsw <3 x i32> [[TMP0]], [[TMP1]]
163 ; NON-POW2-NEXT: [[TMP3:%.*]] = add <3 x i32> [[TMP2]], splat (i32 9)
164 ; NON-POW2-NEXT: store <3 x i32> [[TMP3]], ptr [[DST:%.*]], align 4
165 ; NON-POW2-NEXT: ret void
167 ; POW2-ONLY-LABEL: @v3_load_i32_mul_add_const_store(
168 ; POW2-ONLY-NEXT: entry:
169 ; POW2-ONLY-NEXT: [[GEP_SRC_1_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_1:%.*]], i32 0
170 ; POW2-ONLY-NEXT: [[GEP_SRC_2_0:%.*]] = getelementptr inbounds i32, ptr [[SRC_2:%.*]], i32 0
171 ; POW2-ONLY-NEXT: [[GEP_SRC_1_2:%.*]] = getelementptr inbounds i32, ptr [[SRC_1]], i32 2
172 ; POW2-ONLY-NEXT: [[L_SRC_1_2:%.*]] = load i32, ptr [[GEP_SRC_1_2]], align 4
173 ; POW2-ONLY-NEXT: [[GEP_SRC_2_2:%.*]] = getelementptr inbounds i32, ptr [[SRC_2]], i32 2
174 ; POW2-ONLY-NEXT: [[L_SRC_2_2:%.*]] = load i32, ptr [[GEP_SRC_2_2]], align 4
175 ; POW2-ONLY-NEXT: [[MUL_2:%.*]] = mul nsw i32 [[L_SRC_1_2]], [[L_SRC_2_2]]
176 ; POW2-ONLY-NEXT: [[ADD_2:%.*]] = add i32 [[MUL_2]], 9
177 ; POW2-ONLY-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[GEP_SRC_1_0]], align 4
178 ; POW2-ONLY-NEXT: [[TMP1:%.*]] = load <2 x i32>, ptr [[GEP_SRC_2_0]], align 4
179 ; POW2-ONLY-NEXT: [[TMP2:%.*]] = mul nsw <2 x i32> [[TMP0]], [[TMP1]]
180 ; POW2-ONLY-NEXT: [[TMP3:%.*]] = add <2 x i32> [[TMP2]], splat (i32 9)
181 ; POW2-ONLY-NEXT: store <2 x i32> [[TMP3]], ptr [[DST:%.*]], align 4
182 ; POW2-ONLY-NEXT: [[DST_2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
183 ; POW2-ONLY-NEXT: store i32 [[ADD_2]], ptr [[DST_2]], align 4
184 ; POW2-ONLY-NEXT: ret void
187 %gep.src.1.0 = getelementptr inbounds i32, ptr %src.1, i32 0
188 %l.src.1.0 = load i32, ptr %gep.src.1.0, align 4
189 %gep.src.2.0 = getelementptr inbounds i32, ptr %src.2, i32 0
190 %l.src.2.0 = load i32, ptr %gep.src.2.0, align 4
191 %mul.0 = mul nsw i32 %l.src.1.0, %l.src.2.0
192 %add.0 = add i32 %mul.0, 9
194 %gep.src.1.1 = getelementptr inbounds i32, ptr %src.1, i32 1
195 %l.src.1.1 = load i32, ptr %gep.src.1.1, align 4
196 %gep.src.2.1 = getelementptr inbounds i32, ptr %src.2, i32 1
197 %l.src.2.1 = load i32, ptr %gep.src.2.1, align 4
198 %mul.1 = mul nsw i32 %l.src.1.1, %l.src.2.1
199 %add.1 = add i32 %mul.1, 9
201 %gep.src.1.2 = getelementptr inbounds i32, ptr %src.1, i32 2
202 %l.src.1.2 = load i32, ptr %gep.src.1.2, align 4
203 %gep.src.2.2 = getelementptr inbounds i32, ptr %src.2, i32 2
204 %l.src.2.2 = load i32, ptr %gep.src.2.2, align 4
205 %mul.2 = mul nsw i32 %l.src.1.2, %l.src.2.2
206 %add.2 = add i32 %mul.2, 9
208 store i32 %add.0, ptr %dst
210 %dst.1 = getelementptr i32, ptr %dst, i32 1
211 store i32 %add.1, ptr %dst.1
213 %dst.2 = getelementptr i32, ptr %dst, i32 2
214 store i32 %add.2, ptr %dst.2
219 define void @v3_load_f32_fadd_fadd_by_constant_store(ptr %src, ptr %dst) {
220 ; NON-POW2-LABEL: @v3_load_f32_fadd_fadd_by_constant_store(
221 ; NON-POW2-NEXT: entry:
222 ; NON-POW2-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds float, ptr [[SRC:%.*]], i32 0
223 ; NON-POW2-NEXT: [[TMP0:%.*]] = load <3 x float>, ptr [[GEP_SRC_0]], align 4
224 ; NON-POW2-NEXT: [[TMP1:%.*]] = fadd <3 x float> [[TMP0]], splat (float 1.000000e+01)
225 ; NON-POW2-NEXT: store <3 x float> [[TMP1]], ptr [[DST:%.*]], align 4
226 ; NON-POW2-NEXT: ret void
228 ; POW2-ONLY-LABEL: @v3_load_f32_fadd_fadd_by_constant_store(
229 ; POW2-ONLY-NEXT: entry:
230 ; POW2-ONLY-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds float, ptr [[SRC:%.*]], i32 0
231 ; POW2-ONLY-NEXT: [[GEP_SRC_2:%.*]] = getelementptr inbounds float, ptr [[SRC]], i32 2
232 ; POW2-ONLY-NEXT: [[L_SRC_2:%.*]] = load float, ptr [[GEP_SRC_2]], align 4
233 ; POW2-ONLY-NEXT: [[FADD_2:%.*]] = fadd float [[L_SRC_2]], 1.000000e+01
234 ; POW2-ONLY-NEXT: [[TMP0:%.*]] = load <2 x float>, ptr [[GEP_SRC_0]], align 4
235 ; POW2-ONLY-NEXT: [[TMP1:%.*]] = fadd <2 x float> [[TMP0]], splat (float 1.000000e+01)
236 ; POW2-ONLY-NEXT: store <2 x float> [[TMP1]], ptr [[DST:%.*]], align 4
237 ; POW2-ONLY-NEXT: [[DST_2:%.*]] = getelementptr float, ptr [[DST]], i32 2
238 ; POW2-ONLY-NEXT: store float [[FADD_2]], ptr [[DST_2]], align 4
239 ; POW2-ONLY-NEXT: ret void
242 %gep.src.0 = getelementptr inbounds float, ptr %src, i32 0
243 %l.src.0 = load float , ptr %gep.src.0, align 4
244 %fadd.0 = fadd float %l.src.0, 10.0
246 %gep.src.1 = getelementptr inbounds float , ptr %src, i32 1
247 %l.src.1 = load float, ptr %gep.src.1, align 4
248 %fadd.1 = fadd float %l.src.1, 10.0
250 %gep.src.2 = getelementptr inbounds float, ptr %src, i32 2
251 %l.src.2 = load float, ptr %gep.src.2, align 4
252 %fadd.2 = fadd float %l.src.2, 10.0
254 store float %fadd.0, ptr %dst
256 %dst.1 = getelementptr float, ptr %dst, i32 1
257 store float %fadd.1, ptr %dst.1
259 %dst.2 = getelementptr float, ptr %dst, i32 2
260 store float %fadd.2, ptr %dst.2
265 define void @phi_store3(ptr %dst) {
266 ; NON-POW2-LABEL: @phi_store3(
267 ; NON-POW2-NEXT: entry:
268 ; NON-POW2-NEXT: br label [[EXIT:%.*]]
269 ; NON-POW2: invoke.cont8.loopexit:
270 ; NON-POW2-NEXT: br label [[EXIT]]
272 ; NON-POW2-NEXT: [[TMP0:%.*]] = phi <3 x i32> [ <i32 1, i32 2, i32 3>, [[ENTRY:%.*]] ], [ poison, [[INVOKE_CONT8_LOOPEXIT:%.*]] ]
273 ; NON-POW2-NEXT: store <3 x i32> [[TMP0]], ptr [[DST:%.*]], align 4
274 ; NON-POW2-NEXT: ret void
276 ; POW2-ONLY-LABEL: @phi_store3(
277 ; POW2-ONLY-NEXT: entry:
278 ; POW2-ONLY-NEXT: br label [[EXIT:%.*]]
279 ; POW2-ONLY: invoke.cont8.loopexit:
280 ; POW2-ONLY-NEXT: br label [[EXIT]]
282 ; POW2-ONLY-NEXT: [[P_2:%.*]] = phi i32 [ 3, [[ENTRY:%.*]] ], [ 0, [[INVOKE_CONT8_LOOPEXIT:%.*]] ]
283 ; POW2-ONLY-NEXT: [[TMP0:%.*]] = phi <2 x i32> [ <i32 1, i32 2>, [[ENTRY]] ], [ poison, [[INVOKE_CONT8_LOOPEXIT]] ]
284 ; POW2-ONLY-NEXT: [[DST_2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
285 ; POW2-ONLY-NEXT: store <2 x i32> [[TMP0]], ptr [[DST]], align 4
286 ; POW2-ONLY-NEXT: store i32 [[P_2]], ptr [[DST_2]], align 4
287 ; POW2-ONLY-NEXT: ret void
292 invoke.cont8.loopexit: ; No predecessors!
296 %p.0 = phi i32 [ 1, %entry ], [ 0, %invoke.cont8.loopexit ]
297 %p.1 = phi i32 [ 2, %entry ], [ 0, %invoke.cont8.loopexit ]
298 %p.2 = phi i32 [ 3, %entry ], [ 0, %invoke.cont8.loopexit ]
300 %dst.1 = getelementptr i32, ptr %dst, i32 1
301 %dst.2 = getelementptr i32, ptr %dst, i32 2
303 store i32 %p.0, ptr %dst, align 4
304 store i32 %p.1, ptr %dst.1, align 4
305 store i32 %p.2, ptr %dst.2, align 4
309 define void @store_try_reorder(ptr %dst) {
310 ; NON-POW2-LABEL: @store_try_reorder(
311 ; NON-POW2-NEXT: entry:
312 ; NON-POW2-NEXT: store <3 x i32> zeroinitializer, ptr [[DST:%.*]], align 4
313 ; NON-POW2-NEXT: ret void
315 ; POW2-ONLY-LABEL: @store_try_reorder(
316 ; POW2-ONLY-NEXT: entry:
317 ; POW2-ONLY-NEXT: [[ADD:%.*]] = add i32 0, 0
318 ; POW2-ONLY-NEXT: store i32 [[ADD]], ptr [[DST:%.*]], align 4
319 ; POW2-ONLY-NEXT: [[ARRAYIDX_I1887:%.*]] = getelementptr i32, ptr [[DST]], i64 1
320 ; POW2-ONLY-NEXT: store <2 x i32> zeroinitializer, ptr [[ARRAYIDX_I1887]], align 4
321 ; POW2-ONLY-NEXT: ret void
325 store i32 %add, ptr %dst, align 4
326 %add207 = sub i32 0, 0
327 %arrayidx.i1887 = getelementptr i32, ptr %dst, i64 1
328 store i32 %add207, ptr %arrayidx.i1887, align 4
329 %add216 = sub i32 0, 0
330 %arrayidx.i1891 = getelementptr i32, ptr %dst, i64 2
331 store i32 %add216, ptr %arrayidx.i1891, align 4
335 define void @vec3_fpext_cost(ptr %Colour, float %0) {
336 ; CHECK-LABEL: @vec3_fpext_cost(
338 ; CHECK-NEXT: [[ARRAYIDX80:%.*]] = getelementptr float, ptr [[COLOUR:%.*]], i64 2
339 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x float> poison, float [[TMP0:%.*]], i32 0
340 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> poison, <2 x i32> zeroinitializer
341 ; CHECK-NEXT: [[TMP3:%.*]] = fpext <2 x float> [[TMP2]] to <2 x double>
342 ; CHECK-NEXT: [[TMP4:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP3]], <2 x double> zeroinitializer, <2 x double> zeroinitializer)
343 ; CHECK-NEXT: [[TMP5:%.*]] = fptrunc <2 x double> [[TMP4]] to <2 x float>
344 ; CHECK-NEXT: store <2 x float> [[TMP5]], ptr [[COLOUR]], align 4
345 ; CHECK-NEXT: [[CONV78:%.*]] = fpext float [[TMP0]] to double
346 ; CHECK-NEXT: [[TMP6:%.*]] = call double @llvm.fmuladd.f64(double [[CONV78]], double 0.000000e+00, double 0.000000e+00)
347 ; CHECK-NEXT: [[CONV82:%.*]] = fptrunc double [[TMP6]] to float
348 ; CHECK-NEXT: store float [[CONV82]], ptr [[ARRAYIDX80]], align 4
349 ; CHECK-NEXT: ret void
352 %arrayidx72 = getelementptr float, ptr %Colour, i64 1
353 %arrayidx80 = getelementptr float, ptr %Colour, i64 2
354 %conv62 = fpext float %0 to double
355 %1 = call double @llvm.fmuladd.f64(double %conv62, double 0.000000e+00, double 0.000000e+00)
356 %conv66 = fptrunc double %1 to float
357 store float %conv66, ptr %Colour, align 4
358 %conv70 = fpext float %0 to double
359 %2 = call double @llvm.fmuladd.f64(double %conv70, double 0.000000e+00, double 0.000000e+00)
360 %conv74 = fptrunc double %2 to float
361 store float %conv74, ptr %arrayidx72, align 4
362 %conv78 = fpext float %0 to double
363 %3 = call double @llvm.fmuladd.f64(double %conv78, double 0.000000e+00, double 0.000000e+00)
364 %conv82 = fptrunc double %3 to float
365 store float %conv82, ptr %arrayidx80, align 4
369 define void @fpext_gather(ptr %dst, double %conv) {
370 ; CHECK-LABEL: @fpext_gather(
372 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[CONV:%.*]], i32 0
373 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x double> [[TMP0]], <2 x double> poison, <2 x i32> zeroinitializer
374 ; CHECK-NEXT: [[TMP2:%.*]] = fptrunc <2 x double> [[TMP1]] to <2 x float>
375 ; CHECK-NEXT: [[LENGTHS:%.*]] = getelementptr float, ptr [[DST:%.*]], i64 0
376 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x float> [[TMP2]], i32 0
377 ; CHECK-NEXT: store float [[TMP3]], ptr [[LENGTHS]], align 4
378 ; CHECK-NEXT: [[ARRAYIDX32:%.*]] = getelementptr float, ptr [[DST]], i64 1
379 ; CHECK-NEXT: store <2 x float> [[TMP2]], ptr [[ARRAYIDX32]], align 4
380 ; CHECK-NEXT: ret void
383 %conv25 = fptrunc double %conv to float
384 %Lengths = getelementptr float, ptr %dst, i64 0
385 store float %conv25, ptr %Lengths, align 4
386 %arrayidx32 = getelementptr float, ptr %dst, i64 1
387 store float %conv25, ptr %arrayidx32, align 4
388 %conv34 = fptrunc double %conv to float
389 %arrayidx37 = getelementptr float, ptr %dst, i64 2
390 store float %conv34, ptr %arrayidx37, align 4
394 declare float @llvm.fmuladd.f32(float, float, float)
396 declare double @llvm.fmuladd.f64(double, double, double)