1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S < %s | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @"foo"(ptr addrspace(1) %0, ptr addrspace(1) %1) #0 {
9 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0:%.*]], i64 8
10 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP1:%.*]], i64 8
11 ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0]], i64 24
12 ; CHECK-NEXT: [[TMP6:%.*]] = load <2 x float>, ptr addrspace(1) [[TMP3]], align 4
13 ; CHECK-NEXT: [[TMP7:%.*]] = load <2 x float>, ptr addrspace(1) [[TMP5]], align 4
14 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x float> [[TMP7]], <2 x float> poison, <2 x i32> <i32 1, i32 0>
15 ; CHECK-NEXT: [[TMP9:%.*]] = load <8 x float>, ptr addrspace(1) [[TMP4]], align 4
16 ; CHECK-NEXT: [[TMP10:%.*]] = call <4 x float> @llvm.vector.insert.v4f32.v2f32(<4 x float> poison, <2 x float> [[TMP6]], i64 0)
17 ; CHECK-NEXT: [[TMP11:%.*]] = call <4 x float> @llvm.vector.insert.v4f32.v2f32(<4 x float> [[TMP10]], <2 x float> [[TMP8]], i64 2)
18 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <4 x float> [[TMP11]], <4 x float> poison, <8 x i32> <i32 0, i32 3, i32 0, i32 3, i32 2, i32 1, i32 2, i32 1>
19 ; CHECK-NEXT: [[TMP13:%.*]] = fmul <8 x float> [[TMP12]], [[TMP9]]
20 ; CHECK-NEXT: [[TMP14:%.*]] = fadd <8 x float> [[TMP13]], zeroinitializer
21 ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <8 x float> [[TMP14]], <8 x float> poison, <8 x i32> <i32 0, i32 5, i32 2, i32 7, i32 4, i32 1, i32 6, i32 3>
22 ; CHECK-NEXT: store <8 x float> [[TMP15]], ptr addrspace(1) [[TMP3]], align 4
23 ; CHECK-NEXT: ret void
25 %3 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 8
26 %4 = load float, ptr addrspace(1) %3 , align 4
27 %5 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 8
28 %6 = load float, ptr addrspace(1) %5 , align 4
29 %7 = fmul float %4, %6
30 %8 = fadd float %7, 0.000000e+00
31 %9 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 12
32 %10 = load float, ptr addrspace(1) %9 , align 4
33 %11 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 28
34 %12 = load float, ptr addrspace(1) %11 , align 4
35 %13 = fmul float %10, %12
36 %14 = fadd float %13, 0.000000e+00
37 %15 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 16
38 %16 = load float, ptr addrspace(1) %15 , align 4
39 %17 = fmul float %4, %16
40 %18 = fadd float %17, 0.000000e+00
41 %19 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 36
42 %20 = load float, ptr addrspace(1) %19 , align 4
43 %21 = fmul float %10, %20
44 %22 = fadd float %21, 0.000000e+00
45 %23 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 28
46 %24 = load float, ptr addrspace(1) %23 , align 4
47 %25 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 24
48 %26 = load float, ptr addrspace(1) %25 , align 4
49 %27 = fmul float %24, %26
50 %28 = fadd float %27, 0.000000e+00
51 %29 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 24
52 %30 = load float, ptr addrspace(1) %29 , align 4
53 %31 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 12
54 %32 = load float, ptr addrspace(1) %31 , align 4
55 %33 = fmul float %30, %32
56 %34 = fadd float %33, 0.000000e+00
57 %35 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 32
58 %36 = load float, ptr addrspace(1) %35 , align 4
59 %37 = fmul float %24, %36
60 %38 = fadd float %37, 0.000000e+00
61 %39 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 20
62 %40 = load float, ptr addrspace(1) %39 , align 4
63 %41 = fmul float %30, %40
64 %42 = fadd float %41, 0.000000e+00
65 store float %8, ptr addrspace(1) %3 , align 4
66 store float %14, ptr addrspace(1) %9 , align 4
67 %43 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 16
68 store float %18, ptr addrspace(1) %43 , align 4
69 %44 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 20
70 store float %22, ptr addrspace(1) %44 , align 4
71 store float %28, ptr addrspace(1) %29 , align 4
72 store float %34, ptr addrspace(1) %23 , align 4
73 %45 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 32
74 store float %38, ptr addrspace(1) %45 , align 4
75 %46 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 36
76 store float %42, ptr addrspace(1) %46 , align 4
80 attributes #0 = { "target-cpu"="skylake" }