1 ; RUN: opt < %s -passes=loop-vectorize -debug-only=loop-vectorize -S -disable-output 2>&1 | FileCheck %s
4 ; Make sure LV legal bails out when there is a non-int, non-ptr phi
5 ; CHECK-LABEL: 'invalid_phi_types'
6 ; CHECK: LV: Not vectorizing: Found a non-int non-pointer PHI.
7 define i32 @invalid_phi_types() {
12 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
13 %vec.sum.02 = phi <2 x i32> [ zeroinitializer, %entry ], [ <i32 8, i32 8>, %for.body ]
14 %inc = add nsw i32 %i.02, 1
15 %cmp = icmp slt i32 %inc, 16
16 br i1 %cmp, label %for.body, label %for.end
23 ; Make sure LV legal bails out when the loop doesn't have a legal pre-header.
25 ; CHECK: LV: Not vectorizing: Loop doesn't have a legal pre-header.
26 define void @inc(i32 %n, ptr %P) {
27 %1 = icmp sgt i32 %n, 0
28 br i1 %1, label %BB1, label %BB2
31 indirectbr ptr %P, [label %.lr.ph]
37 %indvars.iv = phi i32 [ %indvars.iv.next, %.lr.ph ], [ 0, %BB1 ], [ 0, %BB2 ]
38 %indvars.iv.next = add i32 %indvars.iv, 1
39 %exitcond = icmp eq i32 %indvars.iv.next, %n
40 br i1 %exitcond, label %._crit_edge, label %.lr.ph