f6f2609e8fbe00aed8c44908d738b2c85a86b176
[oota-llvm.git] / test / Transforms / LoopVectorize / PowerPC / stride-vectorization.ll
1 ; RUN: opt -S -basicaa -loop-vectorize < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
4
5 ; Function Attrs: nounwind
6 define void @foo(double* noalias nocapture %a, double* noalias nocapture readonly %b) #0 {
7 entry:
8   br label %for.body
9
10 ; CHECK-LABEL: @foo
11 ; CHECK: <2 x double>
12
13 for.cond.cleanup:                                 ; preds = %for.body
14   ret void
15
16 for.body:                                         ; preds = %for.body, %entry
17   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
18   %0 = shl nsw i64 %indvars.iv, 1
19   %odd.idx = add nsw i64 %0, 1
20
21   %arrayidx = getelementptr inbounds double, double* %b, i64 %0
22   %arrayidx.odd = getelementptr inbounds double, double* %b, i64 %odd.idx
23
24   %1 = load double, double* %arrayidx, align 8
25   %2 = load double, double* %arrayidx.odd, align 8
26
27   %add = fadd double %1, %2
28   %arrayidx2 = getelementptr inbounds double, double* %a, i64 %indvars.iv
29   store double %add, double* %arrayidx2, align 8
30   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
31   %exitcond = icmp eq i64 %indvars.iv.next, 1600
32   br i1 %exitcond, label %for.cond.cleanup, label %for.body
33 }
34
35 attributes #0 = { nounwind "target-cpu"="pwr8" }
36