Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt < %s -analyze -scalar-evolution |& grep {/u 3}
      2 ; XFAIL: *
      3 
      4 ; This is a tricky testcase for unsigned wrap detection which ScalarEvolution
      5 ; doesn't yet know how to do.
      6 
      7 define i32 @f(i32 %x) nounwind readnone {
      8 entry:
      9 	%0 = icmp ugt i32 %x, 999		; <i1> [#uses=1]
     10 	br i1 %0, label %bb2, label %bb.nph
     11 
     12 bb.nph:		; preds = %entry
     13 	br label %bb
     14 
     15 bb:		; preds = %bb.nph, %bb1
     16 	%indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb1 ]		; <i32> [#uses=2]
     17 	%tmp = mul i32 %indvar, 3		; <i32> [#uses=1]
     18 	%x_addr.04 = add i32 %tmp, %x		; <i32> [#uses=1]
     19 	%1 = add i32 %x_addr.04, 3		; <i32> [#uses=2]
     20 	br label %bb1
     21 
     22 bb1:		; preds = %bb
     23 	%2 = icmp ugt i32 %1, 999		; <i1> [#uses=1]
     24 	%indvar.next = add i32 %indvar, 1		; <i32> [#uses=1]
     25 	br i1 %2, label %bb1.bb2_crit_edge, label %bb
     26 
     27 bb1.bb2_crit_edge:		; preds = %bb1
     28 	%.lcssa = phi i32 [ %1, %bb1 ]		; <i32> [#uses=1]
     29 	br label %bb2
     30 
     31 bb2:		; preds = %bb1.bb2_crit_edge, %entry
     32 	%x_addr.0.lcssa = phi i32 [ %.lcssa, %bb1.bb2_crit_edge ], [ %x, %entry ]		; <i32> [#uses=1]
     33 	ret i32 %x_addr.0.lcssa
     34 }
     35