1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-- -mcpu=corei7 | FileCheck %s
4 define void @foo(ptr %v0, ptr readonly %v1) {
6 ; CHECK-NEXT: [[T14:%.*]] = getelementptr inbounds i32, ptr [[V1:%.*]], i64 4
7 ; CHECK-NEXT: [[T142:%.*]] = getelementptr inbounds i64, ptr [[V1]], i64 8
8 ; CHECK-NEXT: [[T222:%.*]] = getelementptr inbounds i64, ptr [[V1]], i64 10
9 ; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i32, ptr [[V0:%.*]], i64 4
10 ; CHECK-NEXT: [[T212:%.*]] = getelementptr inbounds i64, ptr [[V0]], i64 8
11 ; CHECK-NEXT: [[T292:%.*]] = getelementptr inbounds i64, ptr [[V0]], i64 10
12 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr [[T14]], align 4
13 ; CHECK-NEXT: [[TMP2:%.*]] = add nsw <4 x i32> [[TMP1]], <i32 4, i32 4, i32 6, i32 7>
14 ; CHECK-NEXT: [[TMP3:%.*]] = load <2 x i64>, ptr [[T142]], align 8
15 ; CHECK-NEXT: [[TMP4:%.*]] = add nsw <2 x i64> [[TMP3]], <i64 4, i64 4>
16 ; CHECK-NEXT: [[TMP5:%.*]] = load <2 x i64>, ptr [[T222]], align 8
17 ; CHECK-NEXT: [[TMP6:%.*]] = add nsw <2 x i64> [[TMP5]], <i64 6, i64 7>
18 ; CHECK-NEXT: store <2 x i64> [[TMP4]], ptr [[T212]], align 8
19 ; CHECK-NEXT: store <2 x i64> [[TMP6]], ptr [[T292]], align 8
20 ; CHECK-NEXT: store <4 x i32> [[TMP2]], ptr [[T21]], align 4
21 ; CHECK-NEXT: ret void
25 %t14 = getelementptr inbounds i32, ptr %v1, i64 4
26 %t18 = getelementptr inbounds i32, ptr %v1, i64 5
27 %t22 = getelementptr inbounds i32, ptr %v1, i64 6
28 %t26 = getelementptr inbounds i32, ptr %v1, i64 7
30 %t142 = getelementptr inbounds i64, ptr %v1, i64 8
31 %t182 = getelementptr inbounds i64, ptr %v1, i64 9
32 %t222 = getelementptr inbounds i64, ptr %v1, i64 10
33 %t262 = getelementptr inbounds i64, ptr %v1, i64 11
35 %t21 = getelementptr inbounds i32, ptr %v0, i64 4
36 %t25 = getelementptr inbounds i32, ptr %v0, i64 5
37 %t29 = getelementptr inbounds i32, ptr %v0, i64 6
38 %t32 = getelementptr inbounds i32, ptr %v0, i64 7
40 %t212 = getelementptr inbounds i64, ptr %v0, i64 8
41 %t252 = getelementptr inbounds i64, ptr %v0, i64 9
42 %t292 = getelementptr inbounds i64, ptr %v0, i64 10
43 %t322 = getelementptr inbounds i64, ptr %v0, i64 11
45 %t19 = load i32, ptr %t14, align 4
46 %t23 = load i32, ptr %t18, align 4
47 %t27 = load i32, ptr %t22, align 4
48 %t30 = load i32, ptr %t26, align 4
50 %t192 = load i64, ptr %t142, align 8
51 %t232 = load i64, ptr %t182, align 8
52 %t272 = load i64, ptr %t222, align 8
53 %t302 = load i64, ptr %t262, align 8
55 %t20 = add nsw i32 %t19, 4
56 %t24 = add nsw i32 %t23, 4
57 %t28 = add nsw i32 %t27, 6
58 %t31 = add nsw i32 %t30, 7
60 %t202 = add nsw i64 %t192, 4
61 %t242 = add nsw i64 %t232, 4
62 %t282 = add nsw i64 %t272, 6
63 %t312 = add nsw i64 %t302, 7
65 store i64 %t202, ptr %t212, align 8
66 store i64 %t242, ptr %t252, align 8
67 store i64 %t282, ptr %t292, align 8
68 store i64 %t312, ptr %t322, align 8
70 store i32 %t20, ptr %t21, align 4
71 store i32 %t24, ptr %t25, align 4
72 store i32 %t28, ptr %t29, align 4
73 store i32 %t31, ptr %t32, align 4