1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -pass-remarks-output=%t < %s | FileCheck %s
3 ; RUN: FileCheck %s --input-file=%t --check-prefix=YAML
5 ; YAML-LABEL: --- !Passed
6 ; YAML-NEXT: Pass: slp-vectorizer
7 ; YAML-NEXT: Name: StoresVectorized
8 ; YAML-NEXT: Function: bcast_long
10 ; YAML-NEXT: - String: 'Stores SLP vectorized with cost '
11 ; YAML-NEXT: - Cost: '-4'
12 ; YAML-NEXT: - String: ' and with tree size '
13 ; YAML-NEXT: - TreeSize: '2'
15 define void @bcast_long(ptr %A, ptr %S) {
16 ; CHECK-LABEL: @bcast_long(
18 ; CHECK-NEXT: [[A0:%.*]] = load i32, ptr [[A:%.*]], align 8
19 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> poison, i32 [[A0]], i32 0
20 ; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> poison, <8 x i32> <i32 0, i32 0, i32 poison, i32 0, i32 0, i32 0, i32 0, i32 0>
21 ; CHECK-NEXT: [[TMP1:%.*]] = freeze <8 x i32> [[SHUFFLE]]
22 ; CHECK-NEXT: store <8 x i32> [[TMP1]], ptr [[S:%.*]], align 8
23 ; CHECK-NEXT: ret void
26 %A0 = load i32, ptr %A, align 8
28 %idxS1 = getelementptr inbounds i32, ptr %S, i64 1
29 %idxS2 = getelementptr inbounds i32, ptr %S, i64 2
30 %idxS3 = getelementptr inbounds i32, ptr %S, i64 3
31 %idxS4 = getelementptr inbounds i32, ptr %S, i64 4
32 %idxS5 = getelementptr inbounds i32, ptr %S, i64 5
33 %idxS6 = getelementptr inbounds i32, ptr %S, i64 6
34 %idxS7 = getelementptr inbounds i32, ptr %S, i64 7
36 store i32 %A0, ptr %S, align 8
37 store i32 %A0, ptr %idxS1, align 8
38 store i32 undef, ptr %idxS2, align 8
39 store i32 %A0, ptr %idxS3, align 8
40 store i32 %A0, ptr %idxS4, align 8
41 store i32 %A0, ptr %idxS5, align 8
42 store i32 %A0, ptr %idxS6, align 8
43 store i32 %A0, ptr %idxS7, align 8