2 ; RUN: opt < %s -passes='loop-vectorize' -force-vector-width=2 -enable-epilogue-vectorization -epilogue-vectorization-force-VF=2 --debug-only=loop-vectorize -S 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
6 ; Currently we cannot handle live-out variables that are recurrences.
7 ; CHECK: LV: Checking a loop in 'f2'
8 ; CHECK: LEV: Unable to vectorize epilogue because the loop is not a supported candidate.
10 define signext i32 @f2(ptr noalias %A, i32 signext %n) {
12 %cmp1 = icmp sgt i32 %n, 0
13 br i1 %cmp1, label %for.body.preheader, label %for.end
15 for.body.preheader: ; preds = %entry
16 %wide.trip.count = zext i32 %n to i64
19 for.body: ; preds = %for.body.preheader, %for.body
20 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
21 %arrayidx = getelementptr inbounds i8, ptr %A, i64 %indvars.iv
22 %0 = load i8, ptr %arrayidx, align 1
24 %arrayidx3 = getelementptr inbounds i8, ptr %A, i64 %indvars.iv
25 store i8 %add, ptr %arrayidx3, align 1
26 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
27 %exitcond = icmp ne i64 %indvars.iv.next, %wide.trip.count
28 br i1 %exitcond, label %for.body, label %for.end.loopexit
30 for.end.loopexit: ; preds = %for.body
31 %inc.lcssa.wide = phi i64 [ %indvars.iv.next, %for.body ]
32 %1 = trunc i64 %inc.lcssa.wide to i32
35 for.end: ; preds = %for.end.loopexit, %entry
36 %i.0.lcssa = phi i32 [ 0, %entry ], [ %1, %for.end.loopexit ]