50 lines · plain
1; RUN: opt -S -loop-reduce -mcpu=corei7-avx -mtriple=x86_64-apple-macosx < %s | FileCheck %s2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4 5define void @indvar_expansion(ptr nocapture readonly %rowsptr, i1 %arg) {6entry:7 br label %for.cond8 9; SCEVExpander used to create induction variables in the loop %for.cond while10; expanding the recurrence start value of loop strength reduced values from11; %vector.body.12 13; CHECK-LABEL: indvar_expansion14; CHECK: for.cond:15; CHECK-NOT: phi i316; CHECK: br i1 {{.+}}, label %for.cond17 18for.cond:19 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.cond ], [ 0, %entry ]20 %cmp = icmp eq i8 undef, 021 %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 122 br i1 %cmp, label %for.cond, label %for.cond223 24for.cond2:25 br i1 %arg, label %for.cond2, label %for.body14.lr.ph26 27for.body14.lr.ph:28 %sext = shl i64 %indvars.iv44, 3229 %0 = ashr exact i64 %sext, 3230 %1 = sub i64 undef, %indvars.iv4431 %2 = and i64 %1, 429496729532 %3 = add i64 %2, 133 %fold = add i64 %1, 134 %n.mod.vf = and i64 %fold, 735 %n.vec = sub i64 %3, %n.mod.vf36 %end.idx.rnd.down = add i64 %n.vec, %037 br label %vector.body38 39vector.body:40 %index = phi i64 [ %index.next, %vector.body ], [ %0, %for.body14.lr.ph ]41 %4 = getelementptr inbounds i8, ptr %rowsptr, i64 %index42 %wide.load = load <4 x i8>, ptr %4, align 143 %index.next = add i64 %index, 844 %5 = icmp eq i64 %index.next, %end.idx.rnd.down45 br i1 %5, label %for.end24, label %vector.body46 47for.end24:48 ret void49}50