1 ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s
3 ; CHECK-LABEL: irce: in function test_01: constrained Loop at depth 2 containing:
5 define void @test_01(i64 %len) {
7 ; CHECK-LABEL: @test_01(
13 %entry_check = icmp eq i32 %idx.next, 0
14 br i1 %entry_check, label %exit, label %loop
17 %idx = phi i32 [ 1, %entry ], [ %idx.next, %check ]
18 %idx_ext = sext i32 %idx to i64
22 %iv = phi i64 [ 0, %loop ], [ %iv.next, %inner_backedge ]
23 %iv.next = add nuw nsw i64 %iv, 1
24 %inner_check = icmp slt i64 %iv.next, %idx_ext
25 br i1 %inner_check, label %inner, label %outer_check
28 %iv_next_check = icmp slt i64 %iv.next, 100
29 br i1 %iv_next_check, label %inner_backedge, label %exit
32 %cond = icmp eq i64 %iv.next, 100
33 br i1 %cond, label %exit, label %inner_loop
36 %idx.next = add i32 %idx, 1
37 %loopdone = icmp slt i32 %idx.next, 2
38 br i1 %loopdone, label %check, label %exit