1 ; RUN: opt -S -loop-reduce -mcpu=corei7-avx -mtriple=x86_64-apple-macosx < %s | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 define void @indvar_expansion(ptr nocapture readonly %rowsptr) {
9 ; SCEVExpander used to create induction variables in the loop %for.cond while
10 ; expanding the recurrence start value of loop strength reduced values from
13 ; CHECK-LABEL: indvar_expansion
16 ; CHECK: br i1 {{.+}}, label %for.cond
19 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.cond ], [ 0, %entry ]
20 %cmp = icmp eq i8 undef, 0
21 %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
22 br i1 %cmp, label %for.cond, label %for.cond2
25 br i1 undef, label %for.cond2, label %for.body14.lr.ph
28 %sext = shl i64 %indvars.iv44, 32
29 %0 = ashr exact i64 %sext, 32
30 %1 = sub i64 undef, %indvars.iv44
31 %2 = and i64 %1, 4294967295
34 %n.mod.vf = and i64 %fold, 7
35 %n.vec = sub i64 %3, %n.mod.vf
36 %end.idx.rnd.down = add i64 %n.vec, %0
40 %index = phi i64 [ %index.next, %vector.body ], [ %0, %for.body14.lr.ph ]
41 %4 = getelementptr inbounds i8, ptr %rowsptr, i64 %index
42 %wide.load = load <4 x i8>, ptr %4, align 1
43 %index.next = add i64 %index, 8
44 %5 = icmp eq i64 %index.next, %end.idx.rnd.down
45 br i1 %5, label %for.end24, label %vector.body