1 ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce
3 ; Check that we don't fall into an infinite loop.
4 define void @test() nounwind {
9 %0 = phi i32 [ 1, %entry ], [ 0, %for.body ]
15 define void @test2() nounwind {
19 for.body: ; preds = %for.body, %entry
20 %indvars.iv47 = phi i64 [ 0, %entry ], [ %indvars.iv.next48, %for.body ]
21 %0 = phi i32 [ 1, %entry ], [ 0, %for.body ]
22 %indvars.iv.next48 = add i64 %indvars.iv47, 1
23 br i1 undef, label %for.end, label %for.body
25 for.end: ; preds = %for.body
30 define void @start_model_rare() nounwind uwtable ssp {
32 br i1 undef, label %return, label %if.end
34 if.end: ; preds = %entry
35 br i1 undef, label %cond.false, label %cond.true
37 cond.true: ; preds = %if.end
40 cond.false: ; preds = %if.end
41 br i1 undef, label %cond.false28, label %cond.true20
43 cond.true20: ; preds = %cond.false
46 cond.false28: ; preds = %cond.false
49 for.body40: ; preds = %for.inc50, %cond.false28
50 %indvars.iv123 = phi i64 [ 3, %cond.false28 ], [ %indvars.iv.next124, %for.inc50 ]
51 %step.0121 = phi i32 [ 1, %cond.false28 ], [ %step.1, %for.inc50 ]
52 br i1 undef, label %if.then46, label %for.inc50
54 if.then46: ; preds = %for.body40
55 %inc47 = add nsw i32 %step.0121, 1
58 for.inc50: ; preds = %if.then46, %for.body40
59 %k.1 = phi i32 [ undef, %for.body40 ], [ %inc47, %if.then46 ]
60 %step.1 = phi i32 [ %step.0121, %for.body40 ], [ %inc47, %if.then46 ]
61 %indvars.iv.next124 = add i64 %indvars.iv123, 1
62 %lftr.wideiv = trunc i64 %indvars.iv.next124 to i32
63 %exitcond = icmp eq i32 %lftr.wideiv, 256
64 br i1 %exitcond, label %for.end52, label %for.body40
66 for.end52: ; preds = %for.inc50
69 return: ; preds = %entry