xref: /llvm-project/llvm/test/Transforms/LoopVectorize/runtime-drop-crash.ll (revision 7d7577256b76e4293f455b8093504d5f7044ab4b)
1; RUN: opt -passes=loop-vectorize -force-vector-width=4 %s | FileCheck %s
2
3%struct.foo = type { [400 x double] }
4
5; Make sure we do not crash when dropping runtime checks.
6
7; CHECK-NOT: vector.body
8
9define void @barney(ptr %ptr) {
10entry:
11  br label %loop
12
13loop:
14  %tmp3 = phi i64 [ 0, %entry ], [ %tmp18, %loop ]
15  %tmp4 = getelementptr inbounds %struct.foo, ptr %ptr, i64 undef
16  store i64 0, ptr %tmp4, align 8
17  %tmp8 = add i64 1, %tmp3
18  %tmp10 = getelementptr inbounds %struct.foo, ptr %ptr, i64 %tmp8
19  store i64 1, ptr %tmp10, align 8
20  %tmp14 = add i64 undef, %tmp3
21  %tmp16 = getelementptr inbounds %struct.foo, ptr %ptr, i64 %tmp14
22  store i64 2, ptr %tmp16, align 8
23  %tmp18 = add nuw nsw i64 %tmp3, 4
24  %c = icmp ult i64 %tmp18, 400
25  br i1 %c, label %exit, label %loop
26
27exit:
28  ret void
29}
30