Home | History | Annotate | Download | only in LoopDeletion
      1 ; RUN: opt < %s -loop-deletion -S | FileCheck %s
      2 
      3 ; Checks whether dead loops with multiple exits can be eliminated
      4 
      5 ; CHECK:      entry:
      6 ; CHECK-NEXT:   br label %return
      7 
      8 ; CHECK:      return:
      9 ; CHECK-NEXT:   ret void
     10 
     11 define void @foo(i64 %n, i64 %m) nounwind {
     12 entry:
     13   br label %bb
     14 
     15 bb:
     16   %x.0 = phi i64 [ 0, %entry ], [ %t0, %bb2 ]
     17   %t0 = add i64 %x.0, 1
     18   %t1 = icmp slt i64 %x.0, %n
     19   br i1 %t1, label %bb2, label %return
     20 bb2:
     21   %t2 = icmp slt i64 %x.0, %m
     22   br i1 %t1, label %bb, label %return
     23 
     24 return:
     25   ret void
     26 }
     27