1 ; RUN: opt < %s -loop-reduce -S | grep phi | count 1
3 ; This should only result in one PHI node!
5 ; void foo(double *D, double *E, double F) {
10 define void @foo(double* %D, double* %E, double %F) {
12 %tmp.24 = icmp eq double* %D, %E ; <i1> [#uses=1]
13 br i1 %tmp.24, label %return, label %no_exit
14 no_exit: ; preds = %no_exit, %entry
15 %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=2]
16 %D_addr.0.0.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=2]
17 %D_addr.0.0 = getelementptr double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1]
18 %inc.rec = add i32 %D_addr.0.0.rec, 1 ; <i32> [#uses=1]
19 %inc = getelementptr double* %D, i32 %inc.rec ; <double*> [#uses=1]
20 store double %F, double* %D_addr.0.0
21 %tmp.2 = icmp eq double* %inc, %E ; <i1> [#uses=1]
22 %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
23 br i1 %tmp.2, label %return, label %no_exit
24 return: ; preds = %no_exit, %entry