Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
      2 
      3 ; CHECK: Loop %bb: backedge-taken count is (7 + (-1 * %argc))
      4 
      5 define i32 @main(i32 %argc, i8** %argv) nounwind {
      6 entry:
      7 	%0 = icmp ugt i32 %argc, 7		; <i1> [#uses=1]
      8 	br i1 %0, label %bb2, label %bb.nph
      9 
     10 bb.nph:		; preds = %entry
     11 	br label %bb
     12 
     13 bb:		; preds = %bb.nph, %bb1
     14 	%indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb1 ]		; <i32> [#uses=2]
     15 	%argc_addr.04 = add i32 %indvar, %argc		; <i32> [#uses=1]
     16 	tail call void (...)* @Test() nounwind
     17 	%1 = add i32 %argc_addr.04, 1		; <i32> [#uses=1]
     18 	br label %bb1
     19 
     20 bb1:		; preds = %bb
     21 	%phitmp = icmp ugt i32 %1, 7		; <i1> [#uses=1]
     22 	%indvar.next = add i32 %indvar, 1		; <i32> [#uses=1]
     23 	br i1 %phitmp, label %bb1.bb2_crit_edge, label %bb
     24 
     25 bb1.bb2_crit_edge:		; preds = %bb1
     26 	br label %bb2
     27 
     28 bb2:		; preds = %bb1.bb2_crit_edge, %entry
     29 	ret i32 0
     30 }
     31 
     32 declare void @Test(...)
     33