1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -mattr=+avx512f -mtriple=x86_64 -S < %s | FileCheck %s
4 define void @test(ptr noalias %0, ptr %p) {
6 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <8 x ptr> poison, ptr [[P:%.*]], i32 0
7 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x ptr> [[TMP2]], <8 x ptr> poison, <8 x i32> zeroinitializer
8 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr float, <8 x ptr> [[TMP3]], <8 x i64> <i64 15, i64 4, i64 5, i64 0, i64 2, i64 6, i64 7, i64 8>
9 ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds float, ptr [[TMP0:%.*]], i64 2
10 ; CHECK-NEXT: [[TMP6:%.*]] = call <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr> [[TMP4]], i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x float> poison)
11 ; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <8 x float> [[TMP6]], <8 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 0, i32 1, i32 2, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7, i32 5, i32 6, i32 7>
12 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <8 x float> [[TMP6]], <8 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
13 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <16 x float> [[TMP8]], <16 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float poison, float 0.000000e+00, float poison, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <16 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 1, i32 24, i32 0, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
14 ; CHECK-NEXT: [[TMP10:%.*]] = fadd reassoc nsz arcp contract afn <16 x float> [[TMP7]], [[TMP9]]
15 ; CHECK-NEXT: store <16 x float> [[TMP10]], ptr [[TMP5]], align 4
16 ; CHECK-NEXT: ret void
18 %2 = getelementptr inbounds float, ptr %p, i64 2
19 %3 = getelementptr inbounds float, ptr %p, i64 4
20 %4 = load float, ptr %3, align 4
21 %5 = getelementptr inbounds float, ptr %p, i64 5
22 %6 = load float, ptr %5, align 16
23 %7 = getelementptr inbounds float, ptr %p, i64 15
24 %8 = load float, ptr %7, align 4
25 %9 = fadd reassoc nsz arcp contract afn float %8, 0.000000e+00
26 %10 = getelementptr inbounds float, ptr %0, i64 2
27 store float %9, ptr %10, align 4
28 %11 = fadd reassoc nsz arcp contract afn float %4, 0.000000e+00
29 %12 = getelementptr inbounds float, ptr %0, i64 3
30 store float %11, ptr %12, align 4
31 %13 = fadd reassoc nsz arcp contract afn float %6, 0.000000e+00
32 %14 = getelementptr inbounds float, ptr %0, i64 4
33 store float %13, ptr %14, align 4
34 %15 = fadd reassoc nsz arcp contract afn float %8, 0.000000e+00
35 %16 = getelementptr inbounds float, ptr %0, i64 5
36 store float %15, ptr %16, align 4
37 %17 = fadd reassoc nsz arcp contract afn float %4, 0.000000e+00
38 %18 = load float, ptr %p, align 16
39 %19 = getelementptr inbounds float, ptr %0, i64 6
40 store float %17, ptr %19, align 4
41 %20 = fadd reassoc nsz arcp contract afn float %6, 0.000000e+00
42 %21 = getelementptr inbounds float, ptr %0, i64 7
43 store float %20, ptr %21, align 4
44 %22 = fadd reassoc nsz arcp contract afn float %8, 0.000000e+00
45 %23 = load float, ptr %2, align 8
46 %24 = getelementptr inbounds float, ptr %0, i64 8
47 store float %22, ptr %24, align 4
48 %25 = fadd reassoc nsz arcp contract afn float %4, %18
49 %26 = getelementptr inbounds float, ptr %0, i64 9
50 store float %25, ptr %26, align 4
51 %27 = fadd reassoc nsz arcp contract afn float %6, 0.000000e+00
52 %28 = getelementptr inbounds float, ptr %0, i64 10
53 store float %27, ptr %28, align 4
54 %29 = fadd reassoc nsz arcp contract afn float %8, %23
55 %30 = getelementptr inbounds float, ptr %0, i64 11
56 store float %29, ptr %30, align 4
57 %31 = getelementptr inbounds float, ptr %p, i64 6
58 %32 = load float, ptr %31, align 4
59 %33 = fadd reassoc nsz arcp contract afn float %32, 0.000000e+00
60 %34 = getelementptr inbounds float, ptr %0, i64 12
61 store float %33, ptr %34, align 4
62 %35 = getelementptr inbounds float, ptr %p, i64 7
63 %36 = load float, ptr %35, align 8
64 %37 = fadd reassoc nsz arcp contract afn float %36, 0.000000e+00
65 %38 = getelementptr inbounds float, ptr %0, i64 13
66 store float %37, ptr %38, align 4
67 %39 = getelementptr inbounds float, ptr %p, i64 8
68 %40 = load float, ptr %39, align 4
69 %41 = fadd reassoc nsz arcp contract afn float %40, 0.000000e+00
70 %42 = getelementptr inbounds float, ptr %0, i64 14
71 store float %41, ptr %42, align 4
72 %43 = fadd reassoc nsz arcp contract afn float %32, 0.000000e+00
73 %44 = getelementptr inbounds float, ptr %0, i64 15
74 store float %43, ptr %44, align 4
75 %45 = fadd reassoc nsz arcp contract afn float %36, 0.000000e+00
76 %46 = getelementptr inbounds float, ptr %0, i64 16
77 store float %45, ptr %46, align 4
78 %47 = fadd reassoc nsz arcp contract afn float %40, 0.000000e+00
79 %48 = getelementptr inbounds float, ptr %0, i64 17
80 store float %47, ptr %48, align 4