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: [[TMP1:%.*]] = load <2 x i64>, ptr [[LD:%.*]], align 8
7 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
8 ; CHECK-NEXT: store <4 x i64> [[TMP2]], 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: [[TMP1:%.*]] = load <2 x i64>, ptr [[LD:%.*]], align 8
30 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
31 ; CHECK-NEXT: store <4 x i64> [[TMP2]], 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: [[T1:%.*]] = load i64, ptr [[ARRAYIDX1]], align 8
54 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[LD]], align 8
55 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
56 ; CHECK-NEXT: store <4 x i64> [[TMP2]], ptr [[ST:%.*]], align 8
57 ; CHECK-NEXT: store i64 [[T1]], ptr [[LD]], align 8
58 ; CHECK-NEXT: ret void
60 %arrayidx1 = getelementptr inbounds i64, ptr %ld, i64 1
62 %t0 = load i64, ptr %ld, align 8
63 %t1 = load i64, ptr %arrayidx1, align 8
65 %arrayidx3 = getelementptr inbounds i64, ptr %st, i64 1
66 %arrayidx4 = getelementptr inbounds i64, ptr %st, i64 2
67 %arrayidx5 = getelementptr inbounds i64, ptr %st, i64 3
69 store i64 %t0, ptr %st, align 8
70 store i64 %t0, ptr %arrayidx3, align 8
71 store i64 %t0, ptr %arrayidx4, align 8
72 store i64 %t1, ptr %arrayidx5, align 8
73 store i64 %t1, ptr %ld, align 8