1 ; RUN: opt -disable-output -passes=loop-vectorize -pass-remarks-analysis='.*' -force-vector-width=2 2>&1 %s | FileCheck %s
3 ; Make sure LV does not crash when generating remarks for loops with non-unique
5 define i32 @test_non_unique_exit_blocks(ptr nocapture readonly align 4 dereferenceable(1024) %data, i32 %x) {
6 ; CHECK: loop not vectorized: could not determine number of loop iterations
11 for.header: ; preds = %for.cond.lr.ph, %for.body
12 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.latch ]
13 %iv.next = add nuw nsw i64 %iv, 1
14 %exitcond.not = icmp eq i64 %iv.next, 256
15 br i1 %exitcond.not, label %header.exit, label %for.latch
18 %arrayidx = getelementptr inbounds i32, ptr %data, i64 %iv
19 %lv = load i32, ptr %arrayidx, align 4
20 %cmp1 = icmp eq i32 %lv, %x
21 br i1 %cmp1, label %latch.exit, label %for.header
23 header.exit: ; preds = %for.body
26 latch.exit: ; preds = %for.body