1 ; RUN: opt -loop-vectorize -pass-remarks=loop-vectorize -S < %s 2>&1 | FileCheck %s
3 ; FIXME: Check for -pass-remarks-missed and -pass-remarks-analysis output when
4 ; addAcyclicInnerLoop emits analysis.
6 ; Check that opt does not crash on such input:
24 @b = common global i32 0, align 4
25 @a = common global i32 0, align 4
26 @c = common global i32 0, align 4
28 ; CHECK-NOT: vectorized loop
33 %tmp2 = load i32, i32* @b, align 4
34 %dec3 = add nsw i32 %tmp2, -1
35 store i32 %dec3, i32* @b, align 4
36 %tobool4 = icmp eq i32 %tmp2, 0
37 br i1 %tobool4, label %while.end, label %while.body.lr.ph
39 while.body.lr.ph: ; preds = %entry
40 %tmp1 = load i32, i32* @a, align 4
41 %and = and i32 %tmp1, 3
42 %switch = icmp eq i32 %and, 0
45 while.cond: ; preds = %do.cond
46 %dec = add nsw i32 %dec7, -1
47 %tobool = icmp eq i32 %dec7, 0
48 br i1 %tobool, label %while.cond.while.end_crit_edge, label %while.body
50 while.body: ; preds = %while.body.lr.ph, %while.cond
51 %dec7 = phi i32 [ %dec3, %while.body.lr.ph ], [ %dec, %while.cond ]
52 br i1 %switch, label %do.body, label %do.cond
54 do.body: ; preds = %do.cond, %while.body
55 %dec25 = phi i32 [ %dec2, %do.cond ], [ %tmp1, %while.body ]
58 do.cond: ; preds = %do.body, %while.body
59 %dec26 = phi i32 [ %dec25, %do.body ], [ %tmp1, %while.body ]
60 %dec2 = add nsw i32 %dec26, -1
61 %tobool3 = icmp eq i32 %dec2, 0
62 br i1 %tobool3, label %while.cond, label %do.body
64 while.cond.while.end_crit_edge: ; preds = %while.cond
65 store i32 0, i32* @c, align 4
66 store i32 -1, i32* @b, align 4
69 while.end: ; preds = %while.cond.while.end_crit_edge, %entry