Home | History | Annotate | Download | only in IndVarSimplify
      1 ; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | not grep br
      2 ;
      3 ; Testcase distilled from 256.bzip2
      4 
      5 define i32 @main() {
      6 entry:
      7         br label %loopentry
      8 
      9 loopentry:              ; preds = %loopentry, %entry
     10         %indvar1 = phi i32 [ 0, %entry ], [ %indvar.next2, %loopentry ]         ; <i32> [#uses=1]
     11         %h.0 = phi i32 [ %tmp.2, %loopentry ], [ 4, %entry ]            ; <i32> [#uses=1]
     12         %tmp.1 = mul i32 %h.0, 3                ; <i32> [#uses=1]
     13         %tmp.2 = add i32 %tmp.1, 1              ; <i32> [#uses=2]
     14         %indvar.next2 = add i32 %indvar1, 1             ; <i32> [#uses=2]
     15         %exitcond3 = icmp ne i32 %indvar.next2, 4               ; <i1> [#uses=1]
     16         br i1 %exitcond3, label %loopentry, label %loopexit
     17 
     18 loopexit:               ; preds = %loopentry
     19         ret i32 %tmp.2
     20 }
     21 
     22