Home | History | Annotate | Download | only in LoopUnroll
      1 ; RUN: opt < %s -S -loop-unroll -unroll-max-iteration-count-to-analyze=100 -unroll-dynamic-cost-savings-discount=1000 -unroll-threshold=10 -unroll-percent-dynamic-cost-saved-threshold=50 | FileCheck %s
      2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
      3 
      4 define i64 @propagate_loop_phis() {
      5 ; CHECK-LABEL: @propagate_loop_phis(
      6 ; CHECK-NOT: br i1
      7 ; CHECK: ret i64 3
      8 entry:
      9   br label %loop
     10 
     11 loop:
     12   %iv = phi i64 [ 0, %entry ], [ %inc, %loop ]
     13   %x0 = phi i64 [ 0, %entry ], [ %x2, %loop ]
     14   %x1 = or i64 %x0, 1
     15   %x2 = or i64 %x1, 2
     16   %inc = add nuw nsw i64 %iv, 1
     17   %cond = icmp sge i64 %inc, 10
     18   br i1 %cond, label %loop.end, label %loop
     19 
     20 loop.end:
     21   %x.lcssa = phi i64 [ %x2, %loop ]
     22   ret i64 %x.lcssa
     23 }
     24