1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
3 ; RUN: opt < %s -basicaa -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(i64* nocapture %a, i64 %i) {
11 ; CHECK-LABEL: @_Z3fooPml(
13 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i64, i64* [[A:%.*]], i64 1
14 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast i64* [[A]] to <2 x i64>*
15 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, <2 x i64>* [[TMP0]], align 8
16 ; CHECK-NEXT: [[TMP2:%.*]] = lshr <2 x i64> [[TMP1]], <i64 4, i64 4>
17 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast i64* [[A]] to <2 x i64>*
18 ; CHECK-NEXT: store <2 x i64> [[TMP2]], <2 x i64>* [[TMP3]], align 8
19 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 [[I:%.*]]
20 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, i64* [[ARRAYIDX3]], align 8
21 ; CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* @total, align 8
22 ; CHECK-NEXT: [[ADD:%.*]] = add i64 [[TMP3]], [[TMP2]]
23 ; CHECK-NEXT: store i64 [[ADD]], i64* @total, align 8
24 ; CHECK-NEXT: [[TMP4:%.*]] = bitcast i64* [[A]] to <2 x i64>*
25 ; CHECK-NEXT: [[TMP5:%.*]] = load <2 x i64>, <2 x i64>* [[TMP4]], align 8
26 ; CHECK-NEXT: [[TMP6:%.*]] = lshr <2 x i64> [[TMP5]], <i64 4, i64 4>
27 ; CHECK-NEXT: [[TMP7:%.*]] = bitcast i64* [[A]] to <2 x i64>*
28 ; CHECK-NEXT: store <2 x i64> [[TMP6]], <2 x i64>* [[TMP7]], align 8
29 ; CHECK-NEXT: [[TMP6:%.*]] = load i64, i64* [[ARRAYIDX3]], align 8
30 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, i64* @total, align 8
31 ; CHECK-NEXT: [[ADD9:%.*]] = add i64 [[TMP7]], [[TMP6]]
32 ; CHECK-NEXT: store i64 [[ADD9]], i64* @total, align 8
33 ; CHECK-NEXT: ret void
36 %tmp = load i64, i64* %a, align 8
37 %shr = lshr i64 %tmp, 4
38 store i64 %shr, i64* %a, align 8
39 %arrayidx1 = getelementptr inbounds i64, i64* %a, i64 1
40 %tmp1 = load i64, i64* %arrayidx1, align 8
41 %shr2 = lshr i64 %tmp1, 4
42 store i64 %shr2, i64* %arrayidx1, align 8
43 %arrayidx3 = getelementptr inbounds i64, i64* %a, i64 %i
44 %tmp2 = load i64, i64* %arrayidx3, align 8
45 %tmp3 = load i64, i64* @total, align 8
46 %add = add i64 %tmp3, %tmp2
47 store i64 %add, i64* @total, align 8
48 %tmp4 = load i64, i64* %a, align 8
49 %shr5 = lshr i64 %tmp4, 4
50 store i64 %shr5, i64* %a, align 8
51 %tmp5 = load i64, i64* %arrayidx1, align 8
52 %shr7 = lshr i64 %tmp5, 4
53 store i64 %shr7, i64* %arrayidx1, align 8
54 %tmp6 = load i64, i64* %arrayidx3, align 8
55 %tmp7 = load i64, i64* @total, align 8
56 %add9 = add i64 %tmp7, %tmp6
57 store i64 %add9, i64* @total, align 8