101 lines · plain
1; RUN: opt < %s -passes=loop-vectorize -mtriple x86_64 -S | FileCheck %s2 3%struct.ST4 = type { i32, i32, i32, i32 }4 5; The gaps between the memory access in this function are too large for6; interleaving.7 8; Test from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=75609define void @test1(ptr noalias %B) {10; CHECK-LABEL: @test111; CHECK-NEXT: entry:12; CHECK-NEXT: br label %for.body13 14; CHECK-LABEL: for.body:15; CHECK: store i3216; CHECK: store i3217; CHECK: store i3218; CHECK: store i3219; CHECK-NOT: store20;21entry:22 br label %for.body23 24for.body: ; preds = %for.body, %entry25 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]26 %p1 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 027 store i32 65536, ptr %p1, align 428 %p2 = getelementptr i32, ptr %p1, i32 -214748364829 store i32 65536, ptr %p2, align 430 %p3 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 231 store i32 10, ptr %p3, align 432 %p4 = getelementptr inbounds %struct.ST4, ptr %B, i64 %indvars.iv, i32 333 store i32 12, ptr %p4, align 434 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 135 %exitcond = icmp eq i64 %indvars.iv.next, 102436 br i1 %exitcond, label %for.cond.cleanup, label %for.body37 38for.cond.cleanup: ; preds = %for.body39 ret void40}41 42; Make sure interleave groups with a key being the special 'empty' value for43; the map do not cause a crash.44define void @test_gap_empty_key(ptr %p) {45; CHECK-LABEL: @test_gap_empty_key(ptr %p)46; CHECK-NEXT: entry:47; CHECK-NEXT: br label %for.body48 49; CHECK-LABEL: for.body:50; CHECK: store i3251; CHECK: store i3252; CHECK-NOT: store53;54entry:55 br label %for.body56 57for.body:58 %iv = phi i64 [ 1, %entry ], [ %iv.next, %for.body ]59 %iv.next = add nsw i64 %iv, 160 %arrayidx = getelementptr inbounds [3 x i32], ptr %p, i64 0, i64 %iv.next61 %G2 = getelementptr i32, ptr %arrayidx, i64 %iv.next62 %G9 = getelementptr i32, ptr %G2, i32 -214748364763 store i32 0, ptr %G264 store i32 1, ptr %G965 %cmp = icmp ule i64 %iv, 100066 br i1 false, label %for.body, label %exit67 68exit:69 ret void70}71 72; Make sure interleave groups with a key being the special 'tombstone' value for73; the map do not cause a crash.74define void @test_tombstone_key(ptr %p) {75; CHECK-LABEL: @test_tombstone_key(ptr %p)76; CHECK-NEXT: entry:77; CHECK-NEXT: br label %for.body78 79; CHECK-LABEL: for.body:80; CHECK: store i3281; CHECK: store i3282; CHECK-NOT: store83;84entry:85 br label %for.body86 87for.body:88 %iv = phi i64 [ 1, %entry ], [ %iv.next, %for.body ]89 %iv.next = add nsw i64 %iv, 190 %arrayidx = getelementptr inbounds [3 x i32], ptr %p, i64 0, i64 %iv.next91 %G2 = getelementptr i32, ptr %arrayidx, i64 %iv.next92 %G9 = getelementptr i32, ptr %G2, i32 -214748364893 store i32 0, ptr %G294 store i32 1, ptr %G995 %cmp = icmp ule i64 %iv, 100096 br i1 false, label %for.body, label %exit97 98exit:99 ret void100}101