1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -slp-vectorize-hor -slp-vectorize-hor-store -S < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 | FileCheck %s
4 define void @i64_simplified(ptr noalias %st, ptr noalias %ld) {
5 ; CHECK-LABEL: @i64_simplified(
6 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i64>, ptr [[LD:%.*]], align 8
7 ; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x i64> [[TMP2]], <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
8 ; CHECK-NEXT: store <4 x i64> [[SHUFFLE]], ptr [[ST:%.*]], align 8
11 %arrayidx1 = getelementptr inbounds i64, ptr %ld, i64 1
13 %t0 = load i64, ptr %ld, align 8
14 %t1 = load i64, ptr %arrayidx1, align 8
16 %arrayidx3 = getelementptr inbounds i64, ptr %st, i64 1
17 %arrayidx4 = getelementptr inbounds i64, ptr %st, i64 2
18 %arrayidx5 = getelementptr inbounds i64, ptr %st, i64 3
20 store i64 %t0, ptr %st, align 8
21 store i64 %t1, ptr %arrayidx3, align 8
22 store i64 %t0, ptr %arrayidx4, align 8
23 store i64 %t1, ptr %arrayidx5, align 8
27 define void @i64_simplifiedi_reversed(ptr noalias %st, ptr noalias %ld) {
28 ; CHECK-LABEL: @i64_simplifiedi_reversed(
29 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i64>, ptr [[LD:%.*]], align 8
30 ; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x i64> [[TMP2]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
31 ; CHECK-NEXT: store <4 x i64> [[SHUFFLE]], ptr [[ST:%.*]], align 8
32 ; CHECK-NEXT: ret void
34 %arrayidx1 = getelementptr inbounds i64, ptr %ld, i64 1
36 %t0 = load i64, ptr %ld, align 8
37 %t1 = load i64, ptr %arrayidx1, align 8
39 %arrayidx3 = getelementptr inbounds i64, ptr %st, i64 1
40 %arrayidx4 = getelementptr inbounds i64, ptr %st, i64 2
41 %arrayidx5 = getelementptr inbounds i64, ptr %st, i64 3
43 store i64 %t1, ptr %st, align 8
44 store i64 %t0, ptr %arrayidx3, align 8
45 store i64 %t1, ptr %arrayidx4, align 8
46 store i64 %t0, ptr %arrayidx5, align 8
50 define void @i64_simplifiedi_extract(ptr noalias %st, ptr noalias %ld) {
51 ; CHECK-LABEL: @i64_simplifiedi_extract(
52 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i64, ptr [[LD:%.*]], i64 1
53 ; CHECK-NEXT: [[T0:%.*]] = load i64, ptr [[LD]], align 8
54 ; CHECK-NEXT: [[T1:%.*]] = load i64, ptr [[ARRAYIDX1]], align 8
55 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i64, ptr [[ST:%.*]], i64 1
56 ; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i64, ptr [[ST]], i64 2
57 ; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i64, ptr [[ST]], i64 3
58 ; CHECK-NEXT: store i64 [[T0]], ptr [[ST]], align 8
59 ; CHECK-NEXT: store i64 [[T0]], ptr [[ARRAYIDX3]], align 8
60 ; CHECK-NEXT: store i64 [[T0]], ptr [[ARRAYIDX4]], align 8
61 ; CHECK-NEXT: store i64 [[T1]], ptr [[ARRAYIDX5]], align 8
62 ; CHECK-NEXT: store i64 [[T1]], ptr [[LD]], align 8
63 ; CHECK-NEXT: ret void
65 %arrayidx1 = getelementptr inbounds i64, ptr %ld, i64 1
67 %t0 = load i64, ptr %ld, align 8
68 %t1 = load i64, ptr %arrayidx1, align 8
70 %arrayidx3 = getelementptr inbounds i64, ptr %st, i64 1
71 %arrayidx4 = getelementptr inbounds i64, ptr %st, i64 2
72 %arrayidx5 = getelementptr inbounds i64, ptr %st, i64 3
74 store i64 %t0, ptr %st, align 8
75 store i64 %t0, ptr %arrayidx3, align 8
76 store i64 %t0, ptr %arrayidx4, align 8
77 store i64 %t1, ptr %arrayidx5, align 8
78 store i64 %t1, ptr %ld, align 8