1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -slp-vectorizer -slp-threshold=-10000 < %s | FileCheck %s --check-prefixes=CHECK,THRESHOLD
3 ; RUN: opt -S -slp-vectorizer -slp-threshold=0 < %s | FileCheck %s --check-prefixes=CHECK,NOTHRESHOLD
4 ; RUN: opt -S -slp-vectorizer -slp-threshold=-10000 -slp-min-tree-size=0 < %s | FileCheck %s --check-prefixes=CHECK,MINTREESIZE
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-n8:16:32:64-S128"
7 target triple = "x86_64-apple-macosx10.8.0"
9 define <4 x float> @simple_select(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
10 ; CHECK-LABEL: @simple_select(
11 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i32> [[C:%.*]], zeroinitializer
12 ; CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]]
13 ; CHECK-NEXT: ret <4 x float> [[TMP2]]
15 %c0 = extractelement <4 x i32> %c, i32 0
16 %c1 = extractelement <4 x i32> %c, i32 1
17 %c2 = extractelement <4 x i32> %c, i32 2
18 %c3 = extractelement <4 x i32> %c, i32 3
19 %a0 = extractelement <4 x float> %a, i32 0
20 %a1 = extractelement <4 x float> %a, i32 1
21 %a2 = extractelement <4 x float> %a, i32 2
22 %a3 = extractelement <4 x float> %a, i32 3
23 %b0 = extractelement <4 x float> %b, i32 0
24 %b1 = extractelement <4 x float> %b, i32 1
25 %b2 = extractelement <4 x float> %b, i32 2
26 %b3 = extractelement <4 x float> %b, i32 3
27 %cmp0 = icmp ne i32 %c0, 0
28 %cmp1 = icmp ne i32 %c1, 0
29 %cmp2 = icmp ne i32 %c2, 0
30 %cmp3 = icmp ne i32 %c3, 0
31 %s0 = select i1 %cmp0, float %a0, float %b0
32 %s1 = select i1 %cmp1, float %a1, float %b1
33 %s2 = select i1 %cmp2, float %a2, float %b2
34 %s3 = select i1 %cmp3, float %a3, float %b3
35 %ra = insertelement <4 x float> poison, float %s0, i32 0
36 %rb = insertelement <4 x float> %ra, float %s1, i32 1
37 %rc = insertelement <4 x float> %rb, float %s2, i32 2
38 %rd = insertelement <4 x float> %rc, float %s3, i32 3
42 declare void @llvm.assume(i1) nounwind
44 ; This entire tree is ephemeral, don't vectorize any of it.
45 define <4 x float> @simple_select_eph(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
46 ; THRESHOLD-LABEL: @simple_select_eph(
47 ; THRESHOLD-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
48 ; THRESHOLD-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
49 ; THRESHOLD-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
50 ; THRESHOLD-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
51 ; THRESHOLD-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
52 ; THRESHOLD-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
53 ; THRESHOLD-NEXT: [[A2:%.*]] = extractelement <4 x float> [[A]], i32 2
54 ; THRESHOLD-NEXT: [[A3:%.*]] = extractelement <4 x float> [[A]], i32 3
55 ; THRESHOLD-NEXT: [[B0:%.*]] = extractelement <4 x float> [[B:%.*]], i32 0
56 ; THRESHOLD-NEXT: [[B1:%.*]] = extractelement <4 x float> [[B]], i32 1
57 ; THRESHOLD-NEXT: [[B2:%.*]] = extractelement <4 x float> [[B]], i32 2
58 ; THRESHOLD-NEXT: [[B3:%.*]] = extractelement <4 x float> [[B]], i32 3
59 ; THRESHOLD-NEXT: [[CMP0:%.*]] = icmp ne i32 [[C0]], 0
60 ; THRESHOLD-NEXT: [[CMP1:%.*]] = icmp ne i32 [[C1]], 0
61 ; THRESHOLD-NEXT: [[CMP2:%.*]] = icmp ne i32 [[C2]], 0
62 ; THRESHOLD-NEXT: [[CMP3:%.*]] = icmp ne i32 [[C3]], 0
63 ; THRESHOLD-NEXT: [[S0:%.*]] = select i1 [[CMP0]], float [[A0]], float [[B0]]
64 ; THRESHOLD-NEXT: [[S1:%.*]] = select i1 [[CMP1]], float [[A1]], float [[B1]]
65 ; THRESHOLD-NEXT: [[S2:%.*]] = select i1 [[CMP2]], float [[A2]], float [[B2]]
66 ; THRESHOLD-NEXT: [[S3:%.*]] = select i1 [[CMP3]], float [[A3]], float [[B3]]
67 ; THRESHOLD-NEXT: [[RA:%.*]] = insertelement <4 x float> poison, float [[S0]], i32 0
68 ; THRESHOLD-NEXT: [[RB:%.*]] = insertelement <4 x float> [[RA]], float [[S1]], i32 1
69 ; THRESHOLD-NEXT: [[RC:%.*]] = insertelement <4 x float> [[RB]], float [[S2]], i32 2
70 ; THRESHOLD-NEXT: [[RD:%.*]] = insertelement <4 x float> [[RC]], float [[S3]], i32 3
71 ; THRESHOLD-NEXT: [[Q0:%.*]] = extractelement <4 x float> [[RD]], i32 0
72 ; THRESHOLD-NEXT: [[Q1:%.*]] = extractelement <4 x float> [[RD]], i32 1
73 ; THRESHOLD-NEXT: [[Q2:%.*]] = extractelement <4 x float> [[RD]], i32 2
74 ; THRESHOLD-NEXT: [[Q3:%.*]] = extractelement <4 x float> [[RD]], i32 3
75 ; THRESHOLD-NEXT: [[Q4:%.*]] = fadd float [[Q0]], [[Q1]]
76 ; THRESHOLD-NEXT: [[Q5:%.*]] = fadd float [[Q2]], [[Q3]]
77 ; THRESHOLD-NEXT: [[Q6:%.*]] = fadd float [[Q4]], [[Q5]]
78 ; THRESHOLD-NEXT: [[QI:%.*]] = fcmp olt float [[Q6]], [[Q5]]
79 ; THRESHOLD-NEXT: call void @llvm.assume(i1 [[QI]])
80 ; THRESHOLD-NEXT: ret <4 x float> undef
82 ; NOTHRESHOLD-LABEL: @simple_select_eph(
83 ; NOTHRESHOLD-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
84 ; NOTHRESHOLD-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
85 ; NOTHRESHOLD-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
86 ; NOTHRESHOLD-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
87 ; NOTHRESHOLD-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
88 ; NOTHRESHOLD-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
89 ; NOTHRESHOLD-NEXT: [[A2:%.*]] = extractelement <4 x float> [[A]], i32 2
90 ; NOTHRESHOLD-NEXT: [[A3:%.*]] = extractelement <4 x float> [[A]], i32 3
91 ; NOTHRESHOLD-NEXT: [[B0:%.*]] = extractelement <4 x float> [[B:%.*]], i32 0
92 ; NOTHRESHOLD-NEXT: [[B1:%.*]] = extractelement <4 x float> [[B]], i32 1
93 ; NOTHRESHOLD-NEXT: [[B2:%.*]] = extractelement <4 x float> [[B]], i32 2
94 ; NOTHRESHOLD-NEXT: [[B3:%.*]] = extractelement <4 x float> [[B]], i32 3
95 ; NOTHRESHOLD-NEXT: [[CMP0:%.*]] = icmp ne i32 [[C0]], 0
96 ; NOTHRESHOLD-NEXT: [[CMP1:%.*]] = icmp ne i32 [[C1]], 0
97 ; NOTHRESHOLD-NEXT: [[CMP2:%.*]] = icmp ne i32 [[C2]], 0
98 ; NOTHRESHOLD-NEXT: [[CMP3:%.*]] = icmp ne i32 [[C3]], 0
99 ; NOTHRESHOLD-NEXT: [[S0:%.*]] = select i1 [[CMP0]], float [[A0]], float [[B0]]
100 ; NOTHRESHOLD-NEXT: [[S1:%.*]] = select i1 [[CMP1]], float [[A1]], float [[B1]]
101 ; NOTHRESHOLD-NEXT: [[S2:%.*]] = select i1 [[CMP2]], float [[A2]], float [[B2]]
102 ; NOTHRESHOLD-NEXT: [[S3:%.*]] = select i1 [[CMP3]], float [[A3]], float [[B3]]
103 ; NOTHRESHOLD-NEXT: [[RA:%.*]] = insertelement <4 x float> poison, float [[S0]], i32 0
104 ; NOTHRESHOLD-NEXT: [[RB:%.*]] = insertelement <4 x float> [[RA]], float [[S1]], i32 1
105 ; NOTHRESHOLD-NEXT: [[RC:%.*]] = insertelement <4 x float> [[RB]], float [[S2]], i32 2
106 ; NOTHRESHOLD-NEXT: [[RD:%.*]] = insertelement <4 x float> [[RC]], float [[S3]], i32 3
107 ; NOTHRESHOLD-NEXT: [[Q0:%.*]] = extractelement <4 x float> [[RD]], i32 0
108 ; NOTHRESHOLD-NEXT: [[Q1:%.*]] = extractelement <4 x float> [[RD]], i32 1
109 ; NOTHRESHOLD-NEXT: [[Q2:%.*]] = extractelement <4 x float> [[RD]], i32 2
110 ; NOTHRESHOLD-NEXT: [[Q3:%.*]] = extractelement <4 x float> [[RD]], i32 3
111 ; NOTHRESHOLD-NEXT: [[Q4:%.*]] = fadd float [[Q0]], [[Q1]]
112 ; NOTHRESHOLD-NEXT: [[Q5:%.*]] = fadd float [[Q2]], [[Q3]]
113 ; NOTHRESHOLD-NEXT: [[Q6:%.*]] = fadd float [[Q4]], [[Q5]]
114 ; NOTHRESHOLD-NEXT: [[QI:%.*]] = fcmp olt float [[Q6]], [[Q5]]
115 ; NOTHRESHOLD-NEXT: call void @llvm.assume(i1 [[QI]])
116 ; NOTHRESHOLD-NEXT: ret <4 x float> undef
118 ; MINTREESIZE-LABEL: @simple_select_eph(
119 ; MINTREESIZE-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
120 ; MINTREESIZE-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
121 ; MINTREESIZE-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
122 ; MINTREESIZE-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
123 ; MINTREESIZE-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
124 ; MINTREESIZE-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
125 ; MINTREESIZE-NEXT: [[A2:%.*]] = extractelement <4 x float> [[A]], i32 2
126 ; MINTREESIZE-NEXT: [[A3:%.*]] = extractelement <4 x float> [[A]], i32 3
127 ; MINTREESIZE-NEXT: [[B0:%.*]] = extractelement <4 x float> [[B:%.*]], i32 0
128 ; MINTREESIZE-NEXT: [[B1:%.*]] = extractelement <4 x float> [[B]], i32 1
129 ; MINTREESIZE-NEXT: [[B2:%.*]] = extractelement <4 x float> [[B]], i32 2
130 ; MINTREESIZE-NEXT: [[B3:%.*]] = extractelement <4 x float> [[B]], i32 3
131 ; MINTREESIZE-NEXT: [[CMP0:%.*]] = icmp ne i32 [[C0]], 0
132 ; MINTREESIZE-NEXT: [[CMP1:%.*]] = icmp ne i32 [[C1]], 0
133 ; MINTREESIZE-NEXT: [[CMP2:%.*]] = icmp ne i32 [[C2]], 0
134 ; MINTREESIZE-NEXT: [[CMP3:%.*]] = icmp ne i32 [[C3]], 0
135 ; MINTREESIZE-NEXT: [[S0:%.*]] = select i1 [[CMP0]], float [[A0]], float [[B0]]
136 ; MINTREESIZE-NEXT: [[S1:%.*]] = select i1 [[CMP1]], float [[A1]], float [[B1]]
137 ; MINTREESIZE-NEXT: [[S2:%.*]] = select i1 [[CMP2]], float [[A2]], float [[B2]]
138 ; MINTREESIZE-NEXT: [[S3:%.*]] = select i1 [[CMP3]], float [[A3]], float [[B3]]
139 ; MINTREESIZE-NEXT: [[RA:%.*]] = insertelement <4 x float> poison, float [[S0]], i32 0
140 ; MINTREESIZE-NEXT: [[RB:%.*]] = insertelement <4 x float> [[RA]], float [[S1]], i32 1
141 ; MINTREESIZE-NEXT: [[RC:%.*]] = insertelement <4 x float> [[RB]], float [[S2]], i32 2
142 ; MINTREESIZE-NEXT: [[RD:%.*]] = insertelement <4 x float> [[RC]], float [[S3]], i32 3
143 ; MINTREESIZE-NEXT: [[Q0:%.*]] = extractelement <4 x float> [[RD]], i32 0
144 ; MINTREESIZE-NEXT: [[Q1:%.*]] = extractelement <4 x float> [[RD]], i32 1
145 ; MINTREESIZE-NEXT: [[Q2:%.*]] = extractelement <4 x float> [[RD]], i32 2
146 ; MINTREESIZE-NEXT: [[Q3:%.*]] = extractelement <4 x float> [[RD]], i32 3
147 ; MINTREESIZE-NEXT: [[TMP1:%.*]] = insertelement <2 x float> poison, float [[Q2]], i32 0
148 ; MINTREESIZE-NEXT: [[TMP2:%.*]] = insertelement <2 x float> [[TMP1]], float [[Q3]], i32 1
149 ; MINTREESIZE-NEXT: [[Q4:%.*]] = fadd float [[Q0]], [[Q1]]
150 ; MINTREESIZE-NEXT: [[Q5:%.*]] = fadd float [[Q2]], [[Q3]]
151 ; MINTREESIZE-NEXT: [[TMP3:%.*]] = insertelement <2 x float> poison, float [[Q4]], i32 0
152 ; MINTREESIZE-NEXT: [[TMP4:%.*]] = insertelement <2 x float> [[TMP3]], float [[Q5]], i32 1
153 ; MINTREESIZE-NEXT: [[Q6:%.*]] = fadd float [[Q4]], [[Q5]]
154 ; MINTREESIZE-NEXT: [[TMP5:%.*]] = insertelement <2 x float> poison, float [[Q6]], i32 0
155 ; MINTREESIZE-NEXT: [[TMP6:%.*]] = insertelement <2 x float> [[TMP5]], float [[Q5]], i32 1
156 ; MINTREESIZE-NEXT: [[QI:%.*]] = fcmp olt float [[Q6]], [[Q5]]
157 ; MINTREESIZE-NEXT: call void @llvm.assume(i1 [[QI]])
158 ; MINTREESIZE-NEXT: ret <4 x float> undef
160 %c0 = extractelement <4 x i32> %c, i32 0
161 %c1 = extractelement <4 x i32> %c, i32 1
162 %c2 = extractelement <4 x i32> %c, i32 2
163 %c3 = extractelement <4 x i32> %c, i32 3
164 %a0 = extractelement <4 x float> %a, i32 0
165 %a1 = extractelement <4 x float> %a, i32 1
166 %a2 = extractelement <4 x float> %a, i32 2
167 %a3 = extractelement <4 x float> %a, i32 3
168 %b0 = extractelement <4 x float> %b, i32 0
169 %b1 = extractelement <4 x float> %b, i32 1
170 %b2 = extractelement <4 x float> %b, i32 2
171 %b3 = extractelement <4 x float> %b, i32 3
172 %cmp0 = icmp ne i32 %c0, 0
173 %cmp1 = icmp ne i32 %c1, 0
174 %cmp2 = icmp ne i32 %c2, 0
175 %cmp3 = icmp ne i32 %c3, 0
176 %s0 = select i1 %cmp0, float %a0, float %b0
177 %s1 = select i1 %cmp1, float %a1, float %b1
178 %s2 = select i1 %cmp2, float %a2, float %b2
179 %s3 = select i1 %cmp3, float %a3, float %b3
180 %ra = insertelement <4 x float> poison, float %s0, i32 0
181 %rb = insertelement <4 x float> %ra, float %s1, i32 1
182 %rc = insertelement <4 x float> %rb, float %s2, i32 2
183 %rd = insertelement <4 x float> %rc, float %s3, i32 3
184 %q0 = extractelement <4 x float> %rd, i32 0
185 %q1 = extractelement <4 x float> %rd, i32 1
186 %q2 = extractelement <4 x float> %rd, i32 2
187 %q3 = extractelement <4 x float> %rd, i32 3
188 %q4 = fadd float %q0, %q1
189 %q5 = fadd float %q2, %q3
190 %q6 = fadd float %q4, %q5
191 %qi = fcmp olt float %q6, %q5
192 call void @llvm.assume(i1 %qi)
193 ret <4 x float> undef
196 ; Insert in an order different from the vector indices to make sure it
198 define <4 x float> @simple_select_insert_out_of_order(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
199 ; CHECK-LABEL: @simple_select_insert_out_of_order(
200 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i32> [[C:%.*]], zeroinitializer
201 ; CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]]
202 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> poison, <4 x i32> <i32 2, i32 1, i32 0, i32 3>
203 ; CHECK-NEXT: ret <4 x float> [[TMP3]]
205 %c0 = extractelement <4 x i32> %c, i32 0
206 %c1 = extractelement <4 x i32> %c, i32 1
207 %c2 = extractelement <4 x i32> %c, i32 2
208 %c3 = extractelement <4 x i32> %c, i32 3
209 %a0 = extractelement <4 x float> %a, i32 0
210 %a1 = extractelement <4 x float> %a, i32 1
211 %a2 = extractelement <4 x float> %a, i32 2
212 %a3 = extractelement <4 x float> %a, i32 3
213 %b0 = extractelement <4 x float> %b, i32 0
214 %b1 = extractelement <4 x float> %b, i32 1
215 %b2 = extractelement <4 x float> %b, i32 2
216 %b3 = extractelement <4 x float> %b, i32 3
217 %cmp0 = icmp ne i32 %c0, 0
218 %cmp1 = icmp ne i32 %c1, 0
219 %cmp2 = icmp ne i32 %c2, 0
220 %cmp3 = icmp ne i32 %c3, 0
221 %s0 = select i1 %cmp0, float %a0, float %b0
222 %s1 = select i1 %cmp1, float %a1, float %b1
223 %s2 = select i1 %cmp2, float %a2, float %b2
224 %s3 = select i1 %cmp3, float %a3, float %b3
225 %ra = insertelement <4 x float> poison, float %s0, i32 2
226 %rb = insertelement <4 x float> %ra, float %s1, i32 1
227 %rc = insertelement <4 x float> %rb, float %s2, i32 0
228 %rd = insertelement <4 x float> %rc, float %s3, i32 3
232 declare void @v4f32_user(<4 x float>) #0
233 declare void @f32_user(float) #0
235 ; Multiple users of the final constructed vector
236 define <4 x float> @simple_select_users(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
237 ; CHECK-LABEL: @simple_select_users(
238 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i32> [[C:%.*]], zeroinitializer
239 ; CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]]
240 ; CHECK-NEXT: call void @v4f32_user(<4 x float> [[TMP2]]) #[[ATTR0:[0-9]+]]
241 ; CHECK-NEXT: ret <4 x float> [[TMP2]]
243 %c0 = extractelement <4 x i32> %c, i32 0
244 %c1 = extractelement <4 x i32> %c, i32 1
245 %c2 = extractelement <4 x i32> %c, i32 2
246 %c3 = extractelement <4 x i32> %c, i32 3
247 %a0 = extractelement <4 x float> %a, i32 0
248 %a1 = extractelement <4 x float> %a, i32 1
249 %a2 = extractelement <4 x float> %a, i32 2
250 %a3 = extractelement <4 x float> %a, i32 3
251 %b0 = extractelement <4 x float> %b, i32 0
252 %b1 = extractelement <4 x float> %b, i32 1
253 %b2 = extractelement <4 x float> %b, i32 2
254 %b3 = extractelement <4 x float> %b, i32 3
255 %cmp0 = icmp ne i32 %c0, 0
256 %cmp1 = icmp ne i32 %c1, 0
257 %cmp2 = icmp ne i32 %c2, 0
258 %cmp3 = icmp ne i32 %c3, 0
259 %s0 = select i1 %cmp0, float %a0, float %b0
260 %s1 = select i1 %cmp1, float %a1, float %b1
261 %s2 = select i1 %cmp2, float %a2, float %b2
262 %s3 = select i1 %cmp3, float %a3, float %b3
263 %ra = insertelement <4 x float> poison, float %s0, i32 0
264 %rb = insertelement <4 x float> %ra, float %s1, i32 1
265 %rc = insertelement <4 x float> %rb, float %s2, i32 2
266 %rd = insertelement <4 x float> %rc, float %s3, i32 3
267 call void @v4f32_user(<4 x float> %rd) #0
271 ; Unused insertelement
272 define <4 x float> @simple_select_no_users(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
273 ; CHECK-LABEL: @simple_select_no_users(
274 ; CHECK-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
275 ; CHECK-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
276 ; CHECK-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
277 ; CHECK-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
278 ; CHECK-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
279 ; CHECK-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
280 ; CHECK-NEXT: [[A2:%.*]] = extractelement <4 x float> [[A]], i32 2
281 ; CHECK-NEXT: [[A3:%.*]] = extractelement <4 x float> [[A]], i32 3
282 ; CHECK-NEXT: [[B0:%.*]] = extractelement <4 x float> [[B:%.*]], i32 0
283 ; CHECK-NEXT: [[B1:%.*]] = extractelement <4 x float> [[B]], i32 1
284 ; CHECK-NEXT: [[B2:%.*]] = extractelement <4 x float> [[B]], i32 2
285 ; CHECK-NEXT: [[B3:%.*]] = extractelement <4 x float> [[B]], i32 3
286 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> poison, i32 [[C0]], i32 0
287 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[C1]], i32 1
288 ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <2 x i32> [[TMP2]], zeroinitializer
289 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i32> poison, i32 [[C2]], i32 0
290 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i32> [[TMP4]], i32 [[C3]], i32 1
291 ; CHECK-NEXT: [[TMP6:%.*]] = icmp ne <2 x i32> [[TMP5]], zeroinitializer
292 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x float> poison, float [[A0]], i32 0
293 ; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x float> [[TMP7]], float [[A1]], i32 1
294 ; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[B0]], i32 0
295 ; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x float> [[TMP9]], float [[B1]], i32 1
296 ; CHECK-NEXT: [[TMP11:%.*]] = select <2 x i1> [[TMP3]], <2 x float> [[TMP8]], <2 x float> [[TMP10]]
297 ; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x float> poison, float [[A2]], i32 0
298 ; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x float> [[TMP12]], float [[A3]], i32 1
299 ; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x float> poison, float [[B2]], i32 0
300 ; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x float> [[TMP14]], float [[B3]], i32 1
301 ; CHECK-NEXT: [[TMP16:%.*]] = select <2 x i1> [[TMP6]], <2 x float> [[TMP13]], <2 x float> [[TMP15]]
302 ; CHECK-NEXT: [[TMP17:%.*]] = shufflevector <2 x float> [[TMP11]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
303 ; CHECK-NEXT: [[TMP18:%.*]] = shufflevector <2 x float> [[TMP16]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
304 ; CHECK-NEXT: [[RD1:%.*]] = shufflevector <4 x float> poison, <4 x float> [[TMP18]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
305 ; CHECK-NEXT: ret <4 x float> [[RD1]]
307 %c0 = extractelement <4 x i32> %c, i32 0
308 %c1 = extractelement <4 x i32> %c, i32 1
309 %c2 = extractelement <4 x i32> %c, i32 2
310 %c3 = extractelement <4 x i32> %c, i32 3
311 %a0 = extractelement <4 x float> %a, i32 0
312 %a1 = extractelement <4 x float> %a, i32 1
313 %a2 = extractelement <4 x float> %a, i32 2
314 %a3 = extractelement <4 x float> %a, i32 3
315 %b0 = extractelement <4 x float> %b, i32 0
316 %b1 = extractelement <4 x float> %b, i32 1
317 %b2 = extractelement <4 x float> %b, i32 2
318 %b3 = extractelement <4 x float> %b, i32 3
319 %cmp0 = icmp ne i32 %c0, 0
320 %cmp1 = icmp ne i32 %c1, 0
321 %cmp2 = icmp ne i32 %c2, 0
322 %cmp3 = icmp ne i32 %c3, 0
323 %s0 = select i1 %cmp0, float %a0, float %b0
324 %s1 = select i1 %cmp1, float %a1, float %b1
325 %s2 = select i1 %cmp2, float %a2, float %b2
326 %s3 = select i1 %cmp3, float %a3, float %b3
327 %ra = insertelement <4 x float> poison, float %s0, i32 0
328 %rb = insertelement <4 x float> %ra, float %s1, i32 1
329 %rc = insertelement <4 x float> poison, float %s2, i32 2
330 %rd = insertelement <4 x float> %rc, float %s3, i32 3
334 ; Make sure infinite loop doesn't happen which I ran into when trying
335 ; to do this backwards this backwards
336 define <4 x i32> @reconstruct(<4 x i32> %c) #0 {
337 ; CHECK-LABEL: @reconstruct(
338 ; CHECK-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
339 ; CHECK-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
340 ; CHECK-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
341 ; CHECK-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
342 ; CHECK-NEXT: [[RA:%.*]] = insertelement <4 x i32> poison, i32 [[C0]], i32 0
343 ; CHECK-NEXT: [[RB:%.*]] = insertelement <4 x i32> [[RA]], i32 [[C1]], i32 1
344 ; CHECK-NEXT: [[RC:%.*]] = insertelement <4 x i32> [[RB]], i32 [[C2]], i32 2
345 ; CHECK-NEXT: [[RD:%.*]] = insertelement <4 x i32> [[RC]], i32 [[C3]], i32 3
346 ; CHECK-NEXT: ret <4 x i32> [[RD]]
348 %c0 = extractelement <4 x i32> %c, i32 0
349 %c1 = extractelement <4 x i32> %c, i32 1
350 %c2 = extractelement <4 x i32> %c, i32 2
351 %c3 = extractelement <4 x i32> %c, i32 3
352 %ra = insertelement <4 x i32> poison, i32 %c0, i32 0
353 %rb = insertelement <4 x i32> %ra, i32 %c1, i32 1
354 %rc = insertelement <4 x i32> %rb, i32 %c2, i32 2
355 %rd = insertelement <4 x i32> %rc, i32 %c3, i32 3
359 define <2 x float> @simple_select_v2(<2 x float> %a, <2 x float> %b, <2 x i32> %c) #0 {
360 ; CHECK-LABEL: @simple_select_v2(
361 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <2 x i32> [[C:%.*]], zeroinitializer
362 ; CHECK-NEXT: [[TMP2:%.*]] = select <2 x i1> [[TMP1]], <2 x float> [[A:%.*]], <2 x float> [[B:%.*]]
363 ; CHECK-NEXT: ret <2 x float> [[TMP2]]
365 %c0 = extractelement <2 x i32> %c, i32 0
366 %c1 = extractelement <2 x i32> %c, i32 1
367 %a0 = extractelement <2 x float> %a, i32 0
368 %a1 = extractelement <2 x float> %a, i32 1
369 %b0 = extractelement <2 x float> %b, i32 0
370 %b1 = extractelement <2 x float> %b, i32 1
371 %cmp0 = icmp ne i32 %c0, 0
372 %cmp1 = icmp ne i32 %c1, 0
373 %s0 = select i1 %cmp0, float %a0, float %b0
374 %s1 = select i1 %cmp1, float %a1, float %b1
375 %ra = insertelement <2 x float> poison, float %s0, i32 0
376 %rb = insertelement <2 x float> %ra, float %s1, i32 1
380 ; Make sure when we construct partial vectors, we don't keep
381 ; re-visiting the insertelement chains starting with undef
382 ; (low cost threshold needed to force this to happen)
383 define <4 x float> @simple_select_partial_vector(<4 x float> %a, <4 x float> %b, <4 x i32> %c) #0 {
384 ; CHECK-LABEL: @simple_select_partial_vector(
385 ; CHECK-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
386 ; CHECK-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
387 ; CHECK-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
388 ; CHECK-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
389 ; CHECK-NEXT: [[B0:%.*]] = extractelement <4 x float> [[B:%.*]], i32 0
390 ; CHECK-NEXT: [[B1:%.*]] = extractelement <4 x float> [[B]], i32 1
391 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> poison, i32 [[C0]], i32 0
392 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[C1]], i32 1
393 ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <2 x i32> [[TMP2]], zeroinitializer
394 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x float> poison, float [[A0]], i32 0
395 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x float> [[TMP4]], float [[A1]], i32 1
396 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x float> poison, float [[B0]], i32 0
397 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x float> [[TMP6]], float [[B1]], i32 1
398 ; CHECK-NEXT: [[TMP8:%.*]] = select <2 x i1> [[TMP3]], <2 x float> [[TMP5]], <2 x float> [[TMP7]]
399 ; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x float> [[TMP8]], i32 0
400 ; CHECK-NEXT: [[RA:%.*]] = insertelement <4 x float> poison, float [[TMP9]], i32 0
401 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x float> [[TMP8]], i32 1
402 ; CHECK-NEXT: [[RB:%.*]] = insertelement <4 x float> [[RA]], float [[TMP10]], i32 1
403 ; CHECK-NEXT: ret <4 x float> [[RB]]
405 %c0 = extractelement <4 x i32> %c, i32 0
406 %c1 = extractelement <4 x i32> %c, i32 1
407 %a0 = extractelement <4 x float> %a, i32 0
408 %a1 = extractelement <4 x float> %a, i32 1
409 %b0 = extractelement <4 x float> %b, i32 0
410 %b1 = extractelement <4 x float> %b, i32 1
411 %1 = insertelement <2 x i32> poison, i32 %c0, i32 0
412 %2 = insertelement <2 x i32> %1, i32 %c1, i32 1
413 %3 = icmp ne <2 x i32> %2, zeroinitializer
414 %4 = insertelement <2 x float> poison, float %a0, i32 0
415 %5 = insertelement <2 x float> %4, float %a1, i32 1
416 %6 = insertelement <2 x float> poison, float %b0, i32 0
417 %7 = insertelement <2 x float> %6, float %b1, i32 1
418 %8 = select <2 x i1> %3, <2 x float> %5, <2 x float> %7
419 %9 = extractelement <2 x float> %8, i32 0
420 %ra = insertelement <4 x float> poison, float %9, i32 0
421 %10 = extractelement <2 x float> %8, i32 1
422 %rb = insertelement <4 x float> %ra, float %10, i32 1
426 ; Make sure that vectorization happens even if insertelements operations
427 ; must be rescheduled. The case here is from compiling Julia.
428 define <4 x float> @reschedule_extract(<4 x float> %a, <4 x float> %b) {
429 ; THRESHOLD-LABEL: @reschedule_extract(
430 ; THRESHOLD-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A:%.*]], [[B:%.*]]
431 ; THRESHOLD-NEXT: ret <4 x float> [[TMP1]]
433 ; NOTHRESHOLD-LABEL: @reschedule_extract(
434 ; NOTHRESHOLD-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A:%.*]], [[B:%.*]]
435 ; NOTHRESHOLD-NEXT: ret <4 x float> [[TMP1]]
437 ; MINTREESIZE-LABEL: @reschedule_extract(
438 ; MINTREESIZE-NEXT: [[TMP1:%.*]] = extractelement <4 x float> [[B:%.*]], i32 3
439 ; MINTREESIZE-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[B]], i32 2
440 ; MINTREESIZE-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[B]], i32 1
441 ; MINTREESIZE-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[B]], i32 0
442 ; MINTREESIZE-NEXT: [[TMP5:%.*]] = extractelement <4 x float> [[A:%.*]], i32 3
443 ; MINTREESIZE-NEXT: [[TMP6:%.*]] = extractelement <4 x float> [[A]], i32 2
444 ; MINTREESIZE-NEXT: [[TMP7:%.*]] = extractelement <4 x float> [[A]], i32 1
445 ; MINTREESIZE-NEXT: [[TMP8:%.*]] = extractelement <4 x float> [[A]], i32 0
446 ; MINTREESIZE-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[TMP8]], i32 0
447 ; MINTREESIZE-NEXT: [[TMP10:%.*]] = insertelement <2 x float> [[TMP9]], float [[TMP4]], i32 1
448 ; MINTREESIZE-NEXT: [[TMP11:%.*]] = fadd <4 x float> [[A]], [[B]]
449 ; MINTREESIZE-NEXT: [[TMP12:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i32 0
450 ; MINTREESIZE-NEXT: [[TMP13:%.*]] = insertelement <2 x float> [[TMP12]], float [[TMP3]], i32 1
451 ; MINTREESIZE-NEXT: [[TMP14:%.*]] = insertelement <2 x float> poison, float [[TMP6]], i32 0
452 ; MINTREESIZE-NEXT: [[TMP15:%.*]] = insertelement <2 x float> [[TMP14]], float [[TMP2]], i32 1
453 ; MINTREESIZE-NEXT: [[TMP16:%.*]] = insertelement <2 x float> poison, float [[TMP5]], i32 0
454 ; MINTREESIZE-NEXT: [[TMP17:%.*]] = insertelement <2 x float> [[TMP16]], float [[TMP1]], i32 1
455 ; MINTREESIZE-NEXT: ret <4 x float> [[TMP11]]
457 %a0 = extractelement <4 x float> %a, i32 0
458 %b0 = extractelement <4 x float> %b, i32 0
459 %c0 = fadd float %a0, %b0
460 %v0 = insertelement <4 x float> poison, float %c0, i32 0
461 %a1 = extractelement <4 x float> %a, i32 1
462 %b1 = extractelement <4 x float> %b, i32 1
463 %c1 = fadd float %a1, %b1
464 %v1 = insertelement <4 x float> %v0, float %c1, i32 1
465 %a2 = extractelement <4 x float> %a, i32 2
466 %b2 = extractelement <4 x float> %b, i32 2
467 %c2 = fadd float %a2, %b2
468 %v2 = insertelement <4 x float> %v1, float %c2, i32 2
469 %a3 = extractelement <4 x float> %a, i32 3
470 %b3 = extractelement <4 x float> %b, i32 3
471 %c3 = fadd float %a3, %b3
472 %v3 = insertelement <4 x float> %v2, float %c3, i32 3
476 ; Check that cost model for vectorization takes credit for
477 ; instructions that are erased.
478 define <4 x float> @take_credit(<4 x float> %a, <4 x float> %b) {
479 ; THRESHOLD-LABEL: @take_credit(
480 ; THRESHOLD-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A:%.*]], [[B:%.*]]
481 ; THRESHOLD-NEXT: ret <4 x float> [[TMP1]]
483 ; NOTHRESHOLD-LABEL: @take_credit(
484 ; NOTHRESHOLD-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A:%.*]], [[B:%.*]]
485 ; NOTHRESHOLD-NEXT: ret <4 x float> [[TMP1]]
487 ; MINTREESIZE-LABEL: @take_credit(
488 ; MINTREESIZE-NEXT: [[TMP1:%.*]] = extractelement <4 x float> [[B:%.*]], i32 3
489 ; MINTREESIZE-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[B]], i32 2
490 ; MINTREESIZE-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[B]], i32 1
491 ; MINTREESIZE-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[B]], i32 0
492 ; MINTREESIZE-NEXT: [[TMP5:%.*]] = extractelement <4 x float> [[A:%.*]], i32 3
493 ; MINTREESIZE-NEXT: [[TMP6:%.*]] = extractelement <4 x float> [[A]], i32 2
494 ; MINTREESIZE-NEXT: [[TMP7:%.*]] = extractelement <4 x float> [[A]], i32 1
495 ; MINTREESIZE-NEXT: [[TMP8:%.*]] = extractelement <4 x float> [[A]], i32 0
496 ; MINTREESIZE-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[TMP8]], i32 0
497 ; MINTREESIZE-NEXT: [[TMP10:%.*]] = insertelement <2 x float> [[TMP9]], float [[TMP4]], i32 1
498 ; MINTREESIZE-NEXT: [[TMP11:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i32 0
499 ; MINTREESIZE-NEXT: [[TMP12:%.*]] = insertelement <2 x float> [[TMP11]], float [[TMP3]], i32 1
500 ; MINTREESIZE-NEXT: [[TMP13:%.*]] = insertelement <2 x float> poison, float [[TMP6]], i32 0
501 ; MINTREESIZE-NEXT: [[TMP14:%.*]] = insertelement <2 x float> [[TMP13]], float [[TMP2]], i32 1
502 ; MINTREESIZE-NEXT: [[TMP15:%.*]] = insertelement <2 x float> poison, float [[TMP5]], i32 0
503 ; MINTREESIZE-NEXT: [[TMP16:%.*]] = insertelement <2 x float> [[TMP15]], float [[TMP1]], i32 1
504 ; MINTREESIZE-NEXT: [[TMP17:%.*]] = fadd <4 x float> [[A]], [[B]]
505 ; MINTREESIZE-NEXT: ret <4 x float> [[TMP17]]
507 %a0 = extractelement <4 x float> %a, i32 0
508 %b0 = extractelement <4 x float> %b, i32 0
509 %c0 = fadd float %a0, %b0
510 %a1 = extractelement <4 x float> %a, i32 1
511 %b1 = extractelement <4 x float> %b, i32 1
512 %c1 = fadd float %a1, %b1
513 %a2 = extractelement <4 x float> %a, i32 2
514 %b2 = extractelement <4 x float> %b, i32 2
515 %c2 = fadd float %a2, %b2
516 %a3 = extractelement <4 x float> %a, i32 3
517 %b3 = extractelement <4 x float> %b, i32 3
518 %c3 = fadd float %a3, %b3
519 %v0 = insertelement <4 x float> poison, float %c0, i32 0
520 %v1 = insertelement <4 x float> %v0, float %c1, i32 1
521 %v2 = insertelement <4 x float> %v1, float %c2, i32 2
522 %v3 = insertelement <4 x float> %v2, float %c3, i32 3
526 ; Make sure we handle multiple trees that feed one build vector correctly.
527 define <4 x double> @multi_tree(double %w, double %x, double %y, double %z) {
528 ; CHECK-LABEL: @multi_tree(
529 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x double> poison, double [[Z:%.*]], i32 0
530 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x double> [[TMP1]], double [[Y:%.*]], i32 1
531 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x double> [[TMP2]], double [[X:%.*]], i32 2
532 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x double> [[TMP3]], double [[W:%.*]], i32 3
533 ; CHECK-NEXT: [[TMP5:%.*]] = fadd <4 x double> [[TMP4]], <double 3.000000e+00, double 2.000000e+00, double 1.000000e+00, double 0.000000e+00>
534 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <4 x double> [[TMP5]], <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
535 ; CHECK-NEXT: ret <4 x double> [[TMP6]]
537 %t0 = fadd double %w , 0.000000e+00
538 %t1 = fadd double %x , 1.000000e+00
539 %t2 = fadd double %y , 2.000000e+00
540 %t3 = fadd double %z , 3.000000e+00
541 %t4 = fmul double %t0, 1.000000e+00
542 %i1 = insertelement <4 x double> poison, double %t4, i32 3
543 %t5 = fmul double %t1, 1.000000e+00
544 %i2 = insertelement <4 x double> %i1, double %t5, i32 2
545 %t6 = fmul double %t2, 1.000000e+00
546 %i3 = insertelement <4 x double> %i2, double %t6, i32 1
547 %t7 = fmul double %t3, 1.000000e+00
548 %i4 = insertelement <4 x double> %i3, double %t7, i32 0
552 define <8 x float> @_vadd256(<8 x float> %a, <8 x float> %b) local_unnamed_addr #0 {
553 ; THRESHOLD-LABEL: @_vadd256(
554 ; THRESHOLD-NEXT: [[TMP1:%.*]] = fadd <8 x float> [[A:%.*]], [[B:%.*]]
555 ; THRESHOLD-NEXT: ret <8 x float> [[TMP1]]
557 ; NOTHRESHOLD-LABEL: @_vadd256(
558 ; NOTHRESHOLD-NEXT: [[TMP1:%.*]] = fadd <8 x float> [[A:%.*]], [[B:%.*]]
559 ; NOTHRESHOLD-NEXT: ret <8 x float> [[TMP1]]
561 ; MINTREESIZE-LABEL: @_vadd256(
562 ; MINTREESIZE-NEXT: [[TMP1:%.*]] = extractelement <8 x float> [[B:%.*]], i32 7
563 ; MINTREESIZE-NEXT: [[TMP2:%.*]] = extractelement <8 x float> [[B]], i32 6
564 ; MINTREESIZE-NEXT: [[TMP3:%.*]] = extractelement <8 x float> [[B]], i32 5
565 ; MINTREESIZE-NEXT: [[TMP4:%.*]] = extractelement <8 x float> [[B]], i32 4
566 ; MINTREESIZE-NEXT: [[TMP5:%.*]] = extractelement <8 x float> [[B]], i32 3
567 ; MINTREESIZE-NEXT: [[TMP6:%.*]] = extractelement <8 x float> [[B]], i32 2
568 ; MINTREESIZE-NEXT: [[TMP7:%.*]] = extractelement <8 x float> [[B]], i32 1
569 ; MINTREESIZE-NEXT: [[TMP8:%.*]] = extractelement <8 x float> [[B]], i32 0
570 ; MINTREESIZE-NEXT: [[TMP9:%.*]] = extractelement <8 x float> [[A:%.*]], i32 7
571 ; MINTREESIZE-NEXT: [[TMP10:%.*]] = extractelement <8 x float> [[A]], i32 6
572 ; MINTREESIZE-NEXT: [[TMP11:%.*]] = extractelement <8 x float> [[A]], i32 5
573 ; MINTREESIZE-NEXT: [[TMP12:%.*]] = extractelement <8 x float> [[A]], i32 4
574 ; MINTREESIZE-NEXT: [[TMP13:%.*]] = extractelement <8 x float> [[A]], i32 3
575 ; MINTREESIZE-NEXT: [[TMP14:%.*]] = extractelement <8 x float> [[A]], i32 2
576 ; MINTREESIZE-NEXT: [[TMP15:%.*]] = extractelement <8 x float> [[A]], i32 1
577 ; MINTREESIZE-NEXT: [[TMP16:%.*]] = extractelement <8 x float> [[A]], i32 0
578 ; MINTREESIZE-NEXT: [[TMP17:%.*]] = insertelement <2 x float> poison, float [[TMP16]], i32 0
579 ; MINTREESIZE-NEXT: [[TMP18:%.*]] = insertelement <2 x float> [[TMP17]], float [[TMP8]], i32 1
580 ; MINTREESIZE-NEXT: [[TMP19:%.*]] = insertelement <2 x float> poison, float [[TMP15]], i32 0
581 ; MINTREESIZE-NEXT: [[TMP20:%.*]] = insertelement <2 x float> [[TMP19]], float [[TMP7]], i32 1
582 ; MINTREESIZE-NEXT: [[TMP21:%.*]] = insertelement <2 x float> poison, float [[TMP14]], i32 0
583 ; MINTREESIZE-NEXT: [[TMP22:%.*]] = insertelement <2 x float> [[TMP21]], float [[TMP6]], i32 1
584 ; MINTREESIZE-NEXT: [[TMP23:%.*]] = insertelement <2 x float> poison, float [[TMP13]], i32 0
585 ; MINTREESIZE-NEXT: [[TMP24:%.*]] = insertelement <2 x float> [[TMP23]], float [[TMP5]], i32 1
586 ; MINTREESIZE-NEXT: [[TMP25:%.*]] = insertelement <2 x float> poison, float [[TMP12]], i32 0
587 ; MINTREESIZE-NEXT: [[TMP26:%.*]] = insertelement <2 x float> [[TMP25]], float [[TMP4]], i32 1
588 ; MINTREESIZE-NEXT: [[TMP27:%.*]] = insertelement <2 x float> poison, float [[TMP11]], i32 0
589 ; MINTREESIZE-NEXT: [[TMP28:%.*]] = insertelement <2 x float> [[TMP27]], float [[TMP3]], i32 1
590 ; MINTREESIZE-NEXT: [[TMP29:%.*]] = insertelement <2 x float> poison, float [[TMP10]], i32 0
591 ; MINTREESIZE-NEXT: [[TMP30:%.*]] = insertelement <2 x float> [[TMP29]], float [[TMP2]], i32 1
592 ; MINTREESIZE-NEXT: [[TMP31:%.*]] = insertelement <2 x float> poison, float [[TMP9]], i32 0
593 ; MINTREESIZE-NEXT: [[TMP32:%.*]] = insertelement <2 x float> [[TMP31]], float [[TMP1]], i32 1
594 ; MINTREESIZE-NEXT: [[TMP33:%.*]] = fadd <8 x float> [[A]], [[B]]
595 ; MINTREESIZE-NEXT: ret <8 x float> [[TMP33]]
597 %vecext = extractelement <8 x float> %a, i32 0
598 %vecext1 = extractelement <8 x float> %b, i32 0
599 %add = fadd float %vecext, %vecext1
600 %vecext2 = extractelement <8 x float> %a, i32 1
601 %vecext3 = extractelement <8 x float> %b, i32 1
602 %add4 = fadd float %vecext2, %vecext3
603 %vecext5 = extractelement <8 x float> %a, i32 2
604 %vecext6 = extractelement <8 x float> %b, i32 2
605 %add7 = fadd float %vecext5, %vecext6
606 %vecext8 = extractelement <8 x float> %a, i32 3
607 %vecext9 = extractelement <8 x float> %b, i32 3
608 %add10 = fadd float %vecext8, %vecext9
609 %vecext11 = extractelement <8 x float> %a, i32 4
610 %vecext12 = extractelement <8 x float> %b, i32 4
611 %add13 = fadd float %vecext11, %vecext12
612 %vecext14 = extractelement <8 x float> %a, i32 5
613 %vecext15 = extractelement <8 x float> %b, i32 5
614 %add16 = fadd float %vecext14, %vecext15
615 %vecext17 = extractelement <8 x float> %a, i32 6
616 %vecext18 = extractelement <8 x float> %b, i32 6
617 %add19 = fadd float %vecext17, %vecext18
618 %vecext20 = extractelement <8 x float> %a, i32 7
619 %vecext21 = extractelement <8 x float> %b, i32 7
620 %add22 = fadd float %vecext20, %vecext21
621 %vecinit.i = insertelement <8 x float> poison, float %add, i32 0
622 %vecinit1.i = insertelement <8 x float> %vecinit.i, float %add4, i32 1
623 %vecinit2.i = insertelement <8 x float> %vecinit1.i, float %add7, i32 2
624 %vecinit3.i = insertelement <8 x float> %vecinit2.i, float %add10, i32 3
625 %vecinit4.i = insertelement <8 x float> %vecinit3.i, float %add13, i32 4
626 %vecinit5.i = insertelement <8 x float> %vecinit4.i, float %add16, i32 5
627 %vecinit6.i = insertelement <8 x float> %vecinit5.i, float %add19, i32 6
628 %vecinit7.i = insertelement <8 x float> %vecinit6.i, float %add22, i32 7
629 ret <8 x float> %vecinit7.i
632 attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }