1 ; RUN: opt < %s -passes=loop-vectorize -mtriple x86_64 -S | FileCheck %s
3 %struct.ST4 = type { i32, i32, i32, i32 }
5 ; The gaps between the memory access in this function are too large for
8 ; Test from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7560
9 define void @test1(ptr noalias %B) {
12 ; CHECK-NEXT: br label %for.body
14 ; CHECK-LABEL: for.body:
24 for.body: ; preds = %for.body, %entry
25 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
26 %p1 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 0
27 store i32 65536, ptr %p1, align 4
28 %p2 = getelementptr i32, ptr %p1, i32 -2147483648
29 store i32 65536, ptr %p2, align 4
30 %p3 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 2
31 store i32 10, ptr %p3, align 4
32 %p4 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 3
33 store i32 12, ptr %p4, align 4
34 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
35 %exitcond = icmp eq i64 %indvars.iv.next, 1024
36 br i1 %exitcond, label %for.cond.cleanup, label %for.body
38 for.cond.cleanup: ; preds = %for.body
42 ; Make sure interleave groups with a key being the special 'empty' value for
43 ; the map do not cause a crash.
44 define void @test_gap_empty_key() {
45 ; CHECK-LABEL: @test_gap_empty_key()
47 ; CHECK-NEXT: br label %for.body
49 ; CHECK-LABEL: for.body:
58 %iv = phi i64 [ 1, %entry ], [ %iv.next, %for.body ]
59 %iv.next = add nsw i64 %iv, 1
60 %arrayidx = getelementptr inbounds [3 x i32], ptr undef, i64 0, i64 %iv.next
61 %G2 = getelementptr i32, ptr %arrayidx, i64 %iv.next
62 %G9 = getelementptr i32, ptr %G2, i32 -2147483647
65 %cmp = icmp ule i64 %iv, 1000
66 br i1 false, label %for.body, label %exit
72 ; Make sure interleave groups with a key being the special 'tombstone' value for
73 ; the map do not cause a crash.
74 define void @test_tombstone_key() {
75 ; CHECK-LABEL: @test_tombstone_key()
77 ; CHECK-NEXT: br label %for.body
79 ; CHECK-LABEL: for.body:
88 %iv = phi i64 [ 1, %entry ], [ %iv.next, %for.body ]
89 %iv.next = add nsw i64 %iv, 1
90 %arrayidx = getelementptr inbounds [3 x i32], ptr undef, i64 0, i64 %iv.next
91 %G2 = getelementptr i32, ptr %arrayidx, i64 %iv.next
92 %G9 = getelementptr i32, ptr %G2, i32 -2147483648
95 %cmp = icmp ule i64 %iv, 1000
96 br i1 false, label %for.body, label %exit