Home | History | Annotate | Download | only in IndVarSimplify
      1 ; The i induction variable looks like a wrap-around, but it really is just
      2 ; a simple affine IV.  Make sure that indvars eliminates it.
      3 
      4 ; RUN: opt < %s -indvars -S | grep phi | count 1
      5 
      6 define void @foo() {
      7 entry:
      8         br label %bb6
      9 
     10 bb6:            ; preds = %cond_true, %entry
     11         %j.0 = phi i32 [ 1, %entry ], [ %tmp5, %cond_true ]             ; <i32> [#uses=3]
     12         %i.0 = phi i32 [ 0, %entry ], [ %j.0, %cond_true ]              ; <i32> [#uses=1]
     13         %tmp7 = call i32 (...)* @foo2( )                ; <i32> [#uses=1]
     14         %tmp = icmp ne i32 %tmp7, 0             ; <i1> [#uses=1]
     15         br i1 %tmp, label %cond_true, label %return
     16 
     17 cond_true:              ; preds = %bb6
     18         %tmp2 = call i32 (...)* @bar( i32 %i.0, i32 %j.0 )              ; <i32> [#uses=0]
     19         %tmp5 = add i32 %j.0, 1         ; <i32> [#uses=1]
     20         br label %bb6
     21 
     22 return:         ; preds = %bb6
     23         ret void
     24 }
     25 
     26 declare i32 @bar(...)
     27 
     28 declare i32 @foo2(...)
     29 
     30