1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
3 ; RUN: opt < %s -passes=slp-vectorizer -S | FileCheck %s
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 @total = global i64 0, align 8
10 define void @_Z3fooPml(ptr nocapture %a, i64 %i) {
11 ; CHECK-LABEL: @_Z3fooPml(
13 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[A:%.*]], align 8
14 ; CHECK-NEXT: [[TMP2:%.*]] = lshr <2 x i64> [[TMP1]], <i64 4, i64 4>
15 ; CHECK-NEXT: store <2 x i64> [[TMP2]], ptr [[A]], align 8
16 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[I:%.*]]
17 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr [[ARRAYIDX3]], align 8
18 ; CHECK-NEXT: [[TMP3:%.*]] = load i64, ptr @total, align 8
19 ; CHECK-NEXT: [[ADD:%.*]] = add i64 [[TMP3]], [[TMP2]]
20 ; CHECK-NEXT: store i64 [[ADD]], ptr @total, align 8
21 ; CHECK-NEXT: [[TMP5:%.*]] = load <2 x i64>, ptr [[A]], align 8
22 ; CHECK-NEXT: [[TMP6:%.*]] = lshr <2 x i64> [[TMP5]], <i64 4, i64 4>
23 ; CHECK-NEXT: store <2 x i64> [[TMP6]], ptr [[A]], align 8
24 ; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[ARRAYIDX3]], align 8
25 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @total, align 8
26 ; CHECK-NEXT: [[ADD9:%.*]] = add i64 [[TMP7]], [[TMP6]]
27 ; CHECK-NEXT: store i64 [[ADD9]], ptr @total, align 8
28 ; CHECK-NEXT: ret void
31 %tmp = load i64, ptr %a, align 8
32 %shr = lshr i64 %tmp, 4
33 store i64 %shr, ptr %a, align 8
34 %arrayidx1 = getelementptr inbounds i64, ptr %a, i64 1
35 %tmp1 = load i64, ptr %arrayidx1, align 8
36 %shr2 = lshr i64 %tmp1, 4
37 store i64 %shr2, ptr %arrayidx1, align 8
38 %arrayidx3 = getelementptr inbounds i64, ptr %a, i64 %i
39 %tmp2 = load i64, ptr %arrayidx3, align 8
40 %tmp3 = load i64, ptr @total, align 8
41 %add = add i64 %tmp3, %tmp2
42 store i64 %add, ptr @total, align 8
43 %tmp4 = load i64, ptr %a, align 8
44 %shr5 = lshr i64 %tmp4, 4
45 store i64 %shr5, ptr %a, align 8
46 %tmp5 = load i64, ptr %arrayidx1, align 8
47 %shr7 = lshr i64 %tmp5, 4
48 store i64 %shr7, ptr %arrayidx1, align 8
49 %tmp6 = load i64, ptr %arrayidx3, align 8
50 %tmp7 = load i64, ptr @total, align 8
51 %add9 = add i64 %tmp7, %tmp6
52 store i64 %add9, ptr @total, align 8