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:%.*]] = insertelement <4 x ptr addrspace(1)> poison, ptr addrspace(1) [[TMP0:%.*]], i32 0
10 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x ptr addrspace(1)> [[TMP3]], <4 x ptr addrspace(1)> poison, <4 x i32> zeroinitializer
11 ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i8, <4 x ptr addrspace(1)> [[TMP4]], <4 x i64> <i64 8, i64 12, i64 28, i64 24>
12 ; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0]], i64 8
13 ; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP1:%.*]], i64 8
14 ; CHECK-NEXT: [[TMP8:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p1(<4 x ptr addrspace(1)> [[TMP5]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x float> poison)
15 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> poison, <8 x i32> <i32 0, i32 3, i32 0, i32 3, i32 2, i32 1, i32 2, i32 1>
16 ; CHECK-NEXT: [[TMP10:%.*]] = load <8 x float>, ptr addrspace(1) [[TMP7]], align 4
17 ; CHECK-NEXT: [[TMP11:%.*]] = fmul <8 x float> [[TMP9]], [[TMP10]]
18 ; CHECK-NEXT: [[TMP12:%.*]] = fadd <8 x float> [[TMP11]], zeroinitializer
19 ; CHECK-NEXT: [[TMP13:%.*]] = shufflevector <8 x float> [[TMP12]], <8 x float> poison, <8 x i32> <i32 0, i32 5, i32 2, i32 7, i32 4, i32 1, i32 6, i32 3>
20 ; CHECK-NEXT: store <8 x float> [[TMP13]], ptr addrspace(1) [[TMP6]], align 4
21 ; CHECK-NEXT: ret void
23 %3 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 8
24 %4 = load float, ptr addrspace(1) %3 , align 4
25 %5 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 8
26 %6 = load float, ptr addrspace(1) %5 , align 4
27 %7 = fmul float %4, %6
28 %8 = fadd float %7, 0.000000e+00
29 %9 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 12
30 %10 = load float, ptr addrspace(1) %9 , align 4
31 %11 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 28
32 %12 = load float, ptr addrspace(1) %11 , align 4
33 %13 = fmul float %10, %12
34 %14 = fadd float %13, 0.000000e+00
35 %15 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 16
36 %16 = load float, ptr addrspace(1) %15 , align 4
37 %17 = fmul float %4, %16
38 %18 = fadd float %17, 0.000000e+00
39 %19 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 36
40 %20 = load float, ptr addrspace(1) %19 , align 4
41 %21 = fmul float %10, %20
42 %22 = fadd float %21, 0.000000e+00
43 %23 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 28
44 %24 = load float, ptr addrspace(1) %23 , align 4
45 %25 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 24
46 %26 = load float, ptr addrspace(1) %25 , align 4
47 %27 = fmul float %24, %26
48 %28 = fadd float %27, 0.000000e+00
49 %29 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 24
50 %30 = load float, ptr addrspace(1) %29 , align 4
51 %31 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 12
52 %32 = load float, ptr addrspace(1) %31 , align 4
53 %33 = fmul float %30, %32
54 %34 = fadd float %33, 0.000000e+00
55 %35 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 32
56 %36 = load float, ptr addrspace(1) %35 , align 4
57 %37 = fmul float %24, %36
58 %38 = fadd float %37, 0.000000e+00
59 %39 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 20
60 %40 = load float, ptr addrspace(1) %39 , align 4
61 %41 = fmul float %30, %40
62 %42 = fadd float %41, 0.000000e+00
63 store float %8, ptr addrspace(1) %3 , align 4
64 store float %14, ptr addrspace(1) %9 , align 4
65 %43 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 16
66 store float %18, ptr addrspace(1) %43 , align 4
67 %44 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 20
68 store float %22, ptr addrspace(1) %44 , align 4
69 store float %28, ptr addrspace(1) %29 , align 4
70 store float %34, ptr addrspace(1) %23 , align 4
71 %45 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 32
72 store float %38, ptr addrspace(1) %45 , align 4
73 %46 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 36
74 store float %42, ptr addrspace(1) %46 , align 4
78 attributes #0 = { "target-cpu"="skylake" }