1 ; RUN: opt -S -jump-threading < %s | FileCheck %s
3 define i8 @test(i32 %a, i32 %length) {
6 ; CHECK: br label %backedge
10 ; CHECK-LABEL: backedge:
12 ; CHECK: br i1 %cont, label %backedge, label %exit
13 %iv = phi i32 [0, %entry], [%iv.next, %backedge]
14 ;; We can use an inductive argument to prove %iv is always positive
15 %cnd = icmp sge i32 %iv, 0
16 br i1 %cnd, label %backedge, label %exit
19 %iv.next = add nsw i32 %iv, 1
20 %cont = icmp slt i32 %iv.next, 400
21 br i1 %cont, label %loop, label %exit