Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
      2 
      3 ; This loop has no preheader, multiple backedges, etc., but ScalarEvolution
      4 ; should still be able to analyze it.
      5 
      6 ; CHECK: %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]
      7 ; CHECK-NEXT: -->  {5,+,1}<%loop>
      8 
      9 define void @foo(i1 %p, i1 %q, i1 %s, i1 %u) {
     10 entry:
     11   br i1 %p, label %loop, label %alt
     12 
     13 alt:
     14   br i1 %s, label %loop, label %exit
     15 
     16 loop:
     17   %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]
     18   %i.next = add i64 %i, 1
     19   br i1 %q, label %loop.a, label %loop.b
     20 
     21 loop.a:
     22   br label %loop
     23 
     24 loop.b:
     25   br i1 %u, label %loop, label %exit
     26 
     27 exit:
     28   ret void
     29 }
     30