1 ; RUN: opt < %s -loop-deletion -S | FileCheck %s
2 ; RUN: opt < %s -passes='loop(loop-deletion)' -S | FileCheck %s
4 ; ScalarEvolution can prove the loop iteration is finite, even though
5 ; it can't represent the exact trip count as an expression. That's
6 ; good enough to let the loop be deleted.
9 ; CHECK-NEXT: br label %return
12 ; CHECK-NEXT: ret void
14 define void @foo(i64 %n, i64 %m) nounwind {
19 %x.0 = phi i64 [ 0, %entry ], [ %t0, %bb ]
21 %t1 = icmp slt i64 %x.0, %n
22 %t3 = icmp sgt i64 %x.0, %m
24 br i1 %t4, label %bb, label %return