1 ; RUN: opt -indvars -S < %s | FileCheck %s 2 3 @b = common global i32 0, align 4 4 5 define i32 @foo(i32 %x, i1 %y) { 6 bb0: 7 br label %bb1 8 9 bb1: 10 br i1 %y, label %bb14, label %bb8 11 12 bb8: 13 %i = phi i64 [ %i.next, %bb8 ], [ 0, %bb1 ] 14 %i.next = add i64 %i, 1 15 %div = udiv i32 1, %x 16 %c = icmp eq i64 %i.next, 6 17 br i1 %c, label %bb11, label %bb8 18 19 bb11: 20 br i1 %y, label %bb1, label %bb13 21 22 bb13: 23 store i32 %div, i32* @b, align 4 24 br label %bb14 25 26 bb14: 27 ret i32 0 28 } 29 30 ; CHECK-LABEL: @foo( 31 ; CHECK: bb8: 32 ; CHECK: udiv 33