1 ; RUN: opt -S -passes=loop-vectorize < %s | FileCheck %s
2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-apple-macosx10.11.0"
5 define i32 @accum(ptr nocapture readonly %x, i32 %N) #0 {
10 %cmp1 = icmp sgt i32 %N, 0
11 br i1 %cmp1, label %for.inc.preheader, label %for.end
17 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.inc.preheader ]
18 %sum.02 = phi i32 [ %add, %for.inc ], [ 0, %for.inc.preheader ]
19 %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
20 %0 = load i32, ptr %arrayidx, align 4
21 %add = add nsw i32 %0, %sum.02
22 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
23 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
24 %exitcond = icmp eq i32 %lftr.wideiv, %N
25 br i1 %exitcond, label %for.end.loopexit, label %for.inc
28 %add.lcssa = phi i32 [ %add, %for.inc ]
32 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add.lcssa, %for.end.loopexit ]
38 attributes #0 = { "target-cpu"="core2" "target-features"="+sse,-avx,-avx2,-sse2" }