1; The loop canonicalization pass should guarantee that there is one backedge 2; for all loops. This allows the -indvars pass to recognize the %IV 3; induction variable in this testcase. 4 5; RUN: opt < %s -indvars -S | FileCheck %s 6; CHECK: Loop.backedge: 7; CHECK-NOT: br 8; CHECK: br label %Loop 9 10define i32 @test(i1 %C) { 11; <label>:0 12 br label %Loop 13Loop: ; preds = %BE2, %BE1, %0 14 %IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=2] 15 store i32 %IV, i32* null 16 %IV2 = add i32 %IV, 2 ; <i32> [#uses=2] 17 br i1 %C, label %BE1, label %BE2 18BE1: ; preds = %Loop 19 br label %Loop 20BE2: ; preds = %Loop 21 br label %Loop 22} 23 24