35 lines · plain
1; RUN: opt < %s -S -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 -passes=loop-unroll -unroll-runtime-epilog=true | FileCheck %s -check-prefix=EPILOG2; RUN: opt < %s -S -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 -passes=loop-unroll -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG3 4define i32 @test(ptr nocapture %a, i32 %n) nounwind uwtable readonly {5entry:6 %cmp1 = icmp eq i32 %n, 07 br i1 %cmp1, label %for.end, label %for.body8 9for.body: ; preds = %for.body, %entry10 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]11 %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ]12 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv13 %0 = load i32, ptr %arrayidx, align 414 %add = add nsw i32 %0, %sum.0215 %indvars.iv.next = add i64 %indvars.iv, 116 %lftr.wideiv = trunc i64 %indvars.iv.next to i3217 %exitcond = icmp eq i32 %lftr.wideiv, %n18 br i1 %exitcond, label %for.end, label %for.body19 20for.end: ; preds = %for.body, %entry21 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]22 ret i32 %sum.0.lcssa23}24 25; EPILOG-LABEL: @test26; EPILOG: for.body:27; EPILOG: br i1 %niter.ncmp.7, label %for.end.loopexit{{.*}}, label %for.body28; EPILOG: for.body.epil{{.*}}:29 30; PROLOG-LABEL: @test31; PROLOG: for.body.prol{{.*}}:32; PROLOG: for.body:33; PROLOG: br i1 %exitcond.7, label %for.end.loopexit{{.*}}, label %for.body34 35