1 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
2 ; PR11350: Check that SimplifyIndvar handles a cycle of useless self-phis.
5 ; CHECK-NOT: lcssa = phi
6 define void @test() nounwind {
8 br label %for.cond.preheader
10 for.cond.preheader: ; preds = %entry
11 br label %for.cond.outer
13 for.cond.outer: ; preds = %for.cond.preheader, %for.end
14 %p_41.addr.0.ph = phi i32 [ %p_41.addr.1.lcssa, %for.end ], [ 1, %for.cond.preheader ]
18 br i1 true, label %for.end, label %for.ph
20 for.ph: ; preds = %for.cond4.preheader
24 %p_41.addr.1.lcssa = phi i32 [ undef, %for.ph ], [ %p_41.addr.0.ph, %for.cond ]
25 %p_68.lobit.i = lshr i32 %p_41.addr.1.lcssa, 31
26 %cmp7 = icmp eq i32 %p_41.addr.1.lcssa, 0
27 %conv8 = zext i1 %cmp7 to i32
28 br label %for.cond.outer