Home | History | Annotate | Download | only in LoopStrengthReduce
      1 ; RUN: opt < %s -loop-reduce -S | grep phi | count 1
      2 
      3 define void @foo(i32 %n) {
      4 entry:
      5   br label %loop
      6 
      7 loop:
      8   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
      9 
     10   ; These three instructions form an isolated cycle and can be deleted.
     11   %j = phi i32 [ 0, %entry ], [ %j.y, %loop ]
     12   %j.x = add i32 %j, 1
     13   %j.y = mul i32 %j.x, 2
     14 
     15   %i.next = add i32 %i, 1
     16   %c = icmp ne i32 %i.next, %n
     17   br i1 %c, label %loop, label %exit
     18 
     19 exit:
     20   ret void
     21 }
     22