1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux < %s | FileCheck %s
4 @a = external global [32000 x float], align 64
7 ; CHECK-LABEL: define void @test() {
8 ; CHECK-NEXT: [[ENTRY:.*]]:
9 ; CHECK-NEXT: br label %[[FOR_BODY:.*]]
10 ; CHECK: [[FOR_BODY]]:
11 ; CHECK-NEXT: [[TMP0:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP16:%.*]], %[[FOR_BODY]] ]
12 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[INDVARS_IV_NEXT:%.*]], %[[FOR_BODY]] ]
13 ; CHECK-NEXT: [[TMP1:%.*]] = add nuw nsw i64 [[INDVARS_IV]], 1
14 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 [[TMP1]]
15 ; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 [[INDVARS_IV]]
16 ; CHECK-NEXT: [[TMP5:%.*]] = add nuw nsw i64 [[INDVARS_IV]], 4
17 ; CHECK-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 [[TMP5]]
18 ; CHECK-NEXT: [[TMP14:%.*]] = load <4 x float>, ptr [[ARRAYIDX]], align 4
19 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x float> [[TMP14]], <4 x float> poison, <4 x i32> <i32 poison, i32 0, i32 1, i32 2>
20 ; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x float> [[TMP4]], float [[TMP0]], i32 0
21 ; CHECK-NEXT: [[TMP15:%.*]] = fmul fast <4 x float> [[TMP11]], [[TMP14]]
22 ; CHECK-NEXT: store <4 x float> [[TMP15]], ptr [[ARRAYIDX6]], align 4
23 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 5
24 ; CHECK-NEXT: [[ARRAYIDX41:%.*]] = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 [[INDVARS_IV_NEXT]]
25 ; CHECK-NEXT: [[TMP16]] = load float, ptr [[ARRAYIDX41]], align 4
26 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x float> [[TMP14]], i32 3
27 ; CHECK-NEXT: [[MUL45:%.*]] = fmul fast float [[TMP16]], [[TMP6]]
28 ; CHECK-NEXT: store float [[MUL45]], ptr [[ARRAYIDX31]], align 4
29 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i64 [[INDVARS_IV]], 31990
30 ; CHECK-NEXT: br i1 [[CMP2]], label %[[FOR_BODY]], label %[[EXIT:.*]]
32 ; CHECK-NEXT: ret void
38 %0 = phi float [ 0.000000e+00, %entry ], [ %9, %for.body ]
39 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
40 %1 = add nuw nsw i64 %indvars.iv, 1
41 %arrayidx = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %1
42 %2 = load float, ptr %arrayidx, align 4
43 %arrayidx6 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %indvars.iv
44 %mul = fmul fast float %0, %2
45 store float %mul, ptr %arrayidx6, align 4
46 %3 = add nuw nsw i64 %indvars.iv, 2
47 %arrayidx11 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %3
48 %4 = load float, ptr %arrayidx11, align 4
49 %mul15 = fmul fast float %4, %2
50 store float %mul15, ptr %arrayidx, align 4
51 %5 = add nuw nsw i64 %indvars.iv, 3
52 %arrayidx21 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %5
53 %6 = load float, ptr %arrayidx21, align 4
54 %mul25 = fmul fast float %6, %4
55 store float %mul25, ptr %arrayidx11, align 4
56 %7 = add nuw nsw i64 %indvars.iv, 4
57 %arrayidx31 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %7
58 %8 = load float, ptr %arrayidx31, align 4
59 %mul35 = fmul fast float %8, %6
60 store float %mul35, ptr %arrayidx21, align 4
61 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 5
62 %arrayidx41 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %indvars.iv.next
63 %9 = load float, ptr %arrayidx41, align 4
64 %mul45 = fmul fast float %9, %8
65 store float %mul45, ptr %arrayidx31, align 4
66 %cmp2 = icmp ult i64 %indvars.iv, 31990
67 br i1 %cmp2, label %for.body, label %exit