1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=slp-vectorizer -mtriple=x86_64-pc-windows-msvc19.16.0 < %s | FileCheck %s
4 define void @test(ptr %a, ptr %b) {
7 ; CHECK-NEXT: [[RESULT:%.*]] = alloca [4 x [4 x float]], i32 0, align 4
8 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr null, align 4
9 ; CHECK-NEXT: [[ARRAYIDX120:%.*]] = getelementptr [4 x float], ptr [[B:%.*]], i64 0, i64 3
10 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x float>, ptr [[ARRAYIDX120]], align 4
11 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 0>
12 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x float> [[TMP2]], float [[TMP0]], i32 2
13 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
15 ; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr null, align 4
16 ; CHECK-NEXT: [[TMP4:%.*]] = load <2 x float>, ptr [[A:%.*]], align 4
17 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
18 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x float> [[TMP6]], float [[TMP3]], i32 1
19 ; CHECK-NEXT: [[TMP8:%.*]] = fmul <4 x float> [[TMP5]], [[TMP7]]
20 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
21 ; CHECK-NEXT: [[TMP10:%.*]] = fmul <4 x float> [[TMP9]], zeroinitializer
22 ; CHECK-NEXT: [[TMP11:%.*]] = fadd <4 x float> [[TMP8]], [[TMP10]]
23 ; CHECK-NEXT: [[TMP12:%.*]] = fadd <4 x float> [[TMP11]], zeroinitializer
24 ; CHECK-NEXT: store <4 x float> [[TMP12]], ptr [[RESULT]], align 4
25 ; CHECK-NEXT: br label [[FOR_BODY]]
28 %result = alloca [4 x [4 x float]], i32 0, align 4
29 %arrayidx11 = getelementptr [4 x [4 x float]], ptr %b, i64 0, i64 1
30 %0 = load float, ptr %arrayidx11, align 4
31 %1 = load float, ptr null, align 4
32 %arrayidx120 = getelementptr [4 x float], ptr %b, i64 0, i64 3
33 %2 = load float, ptr %arrayidx120, align 4
37 %3 = load float, ptr %a, align 4
38 %mul = fmul float %3, 0.000000e+00
39 %arrayidx9 = getelementptr [4 x [4 x float]], ptr %a, i64 0, i64 0, i64 1
40 %4 = load float, ptr %arrayidx9, align 4
41 %mul13 = fmul float %4, %0
42 %add = fadd float %mul, %mul13
43 %add22 = fadd float %add, 0.000000e+00
44 store float %add22, ptr %result, align 4
45 %5 = load float, ptr null, align 4
46 %mul43 = fmul float %3, %5
47 %mul51 = fmul float %4, 0.000000e+00
48 %add52 = fadd float %mul43, %mul51
49 %add61 = fadd float %add52, 0.000000e+00
50 %arrayidx74 = getelementptr [4 x [4 x float]], ptr %result, i64 0, i64 0, i64 1
51 store float %add61, ptr %arrayidx74, align 4
52 %mul82 = fmul float %3, 0.000000e+00
53 %mul90 = fmul float %4, %1
54 %add91 = fadd float %mul82, %mul90
55 %add100 = fadd float %add91, 0.000000e+00
56 %arrayidx113 = getelementptr [4 x [4 x float]], ptr %result, i64 0, i64 0, i64 2
57 store float %add100, ptr %arrayidx113, align 4
58 %mul121 = fmul float %3, %2
59 %mul129 = fmul float %4, 0.000000e+00
60 %add130 = fadd float %mul121, %mul129
61 %add139 = fadd float %add130, 0.000000e+00
62 %arrayidx152 = getelementptr [4 x [4 x float]], ptr %result, i64 0, i64 0, i64 3
63 store float %add139, ptr %arrayidx152, align 4