1; RUN: opt -S -mtriple=x86_64-pc_linux -loop-vectorize -instcombine < %s | FileCheck %s --check-prefix=NORMAL
2; RUN: opt -S -mtriple=x86_64-pc_linux -loop-vectorize -instcombine -mcpu=atom < %s | FileCheck %s --check-prefix=ATOM
3
4; NORMAL-LABEL: foo
5; NORMAL: %[[WIDE:.*]] = load <8 x i32>, <8 x i32>* %{{.*}}, align 4
6; NORMAL: %[[STRIDED1:.*]] = shufflevector <8 x i32> %[[WIDE]], <8 x i32> undef, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
7; NORMAL: %[[STRIDED2:.*]] = shufflevector <8 x i32> %wide.vec, <8 x i32> undef, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
8; NORMAL: add nsw <4 x i32> %[[STRIDED2]], %[[STRIDED1]]
9
10; ATOM-LABEL: foo
11; ATOM: load i32
12; ATOM: load i32
13; ATOM: store i32
14define void @foo(i32* noalias nocapture %a, i32* noalias nocapture readonly %b) {
15entry:
16  br label %for.body
17
18for.cond.cleanup:                                 ; preds = %for.body
19  ret void
20
21for.body:                                         ; preds = %for.body, %entry
22  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
23  %0 = shl nsw i64 %indvars.iv, 1
24  %arrayidx = getelementptr inbounds i32, i32* %b, i64 %0
25  %1 = load i32, i32* %arrayidx, align 4
26  %2 = or i64 %0, 1
27  %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %2
28  %3 = load i32, i32* %arrayidx3, align 4
29  %add4 = add nsw i32 %3, %1
30  %arrayidx6 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
31  store i32 %add4, i32* %arrayidx6, align 4
32  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
33  %exitcond = icmp eq i64 %indvars.iv.next, 1024
34  br i1 %exitcond, label %for.cond.cleanup, label %for.body
35}
36