1 ; RUN: opt < %s -loop-reduce -S | grep phi | count 1 2 3 ; This testcase should have ONE stride 18 indvar, the other use should have a 4 ; loop invariant value (B) added to it inside of the loop, instead of having 5 ; a whole indvar based on B for it. 6 7 declare i1 @cond(i32) 8 9 define void @test(i32 %B) { 10 ; <label>:0 11 br label %Loop 12 Loop: ; preds = %Loop, %0 13 %IV = phi i32 [ 0, %0 ], [ %IVn, %Loop ] ; <i32> [#uses=3] 14 %C = mul i32 %IV, 18 ; <i32> [#uses=1] 15 %D = mul i32 %IV, 18 ; <i32> [#uses=1] 16 %E = add i32 %D, %B ; <i32> [#uses=1] 17 %cnd = call i1 @cond( i32 %E ) ; <i1> [#uses=1] 18 call i1 @cond( i32 %C ) ; <i1>:1 [#uses=0] 19 %IVn = add i32 %IV, 1 ; <i32> [#uses=1] 20 br i1 %cnd, label %Loop, label %Out 21 Out: ; preds = %Loop 22 ret void 23 } 24 25