1 ; RUN: opt -S -passes=loop-vectorize -force-vector-width=2 -force-vector-interleave=1 < %s | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 ; Make sure we can vectorize loops which contain lifetime markers.
8 ; CHECK: call void @llvm.lifetime.end
9 ; CHECK: store <2 x i32>
10 ; CHECK: call void @llvm.lifetime.start
12 define void @test(ptr %d) {
14 %arr = alloca [1024 x i32], align 16
15 call void @llvm.lifetime.start.p0(i64 4096, ptr %arr) #1
19 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
20 call void @llvm.lifetime.end.p0(i64 4096, ptr %arr) #1
21 %arrayidx = getelementptr inbounds i32, ptr %d, i64 %indvars.iv
22 %0 = load i32, ptr %arrayidx, align 8
23 store i32 100, ptr %arrayidx, align 8
24 call void @llvm.lifetime.start.p0(i64 4096, ptr %arr) #1
25 %indvars.iv.next = add i64 %indvars.iv, 1
26 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
27 %exitcond = icmp ne i32 %lftr.wideiv, 128
28 br i1 %exitcond, label %for.body, label %for.end
31 call void @llvm.lifetime.end.p0(i64 4096, ptr %arr) #1
35 ; CHECK-LABEL: @testbitcast(
36 ; CHECK: call void @llvm.lifetime.end
37 ; CHECK: store <2 x i32>
38 ; CHECK: call void @llvm.lifetime.start
40 define void @testbitcast(ptr %d) {
42 %arr = alloca [1024 x i32], align 16
43 call void @llvm.lifetime.start.p0(i64 4096, ptr %arr) #1
47 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
48 call void @llvm.lifetime.end.p0(i64 4096, ptr %arr) #1
49 %arrayidx = getelementptr inbounds i32, ptr %d, i64 %indvars.iv
50 %0 = load i32, ptr %arrayidx, align 8
51 store i32 100, ptr %arrayidx, align 8
52 call void @llvm.lifetime.start.p0(i64 4096, ptr %arr) #1
53 %indvars.iv.next = add i64 %indvars.iv, 1
54 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
55 %exitcond = icmp ne i32 %lftr.wideiv, 128
56 br i1 %exitcond, label %for.body, label %for.end
59 call void @llvm.lifetime.end.p0(i64 4096, ptr %arr) #1
63 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
65 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1