blob: d3112b82d1d535145dca93f7aaf96c9d383558e5 [file] [log] [blame]
Gil Rapaport638d4532017-03-23 20:02:23 +00001; RUN: opt < %s -loop-vectorize -force-vector-interleave=2 -force-vector-width=1 -S | FileCheck --enable-var-scope %s
2
3; Make sure we attach memcheck metadata to scalarized memory operations even if
4; we're only unrolling.
5
6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7
8; CHECK-LABEL: vector.memcheck:
9; CHECK-LABEL: vector.body:
10; CHECK: load i32, {{.*}} !alias.scope ![[$MD1:[0-9]+]]
11; CHECK-LABEL: middle.block:
12; CHECK-DAG: ![[$MD1]] = !{![[MD2:[0-9]+]]}
13; CHECK-DAG: ![[MD2]] = distinct !{![[MD2]], ![[MD3:[0-9]+]]}
14; CHECK-DAG: ![[MD3]] = distinct !{![[MD3]], !"LVerDomain"}
15
16; Function Attrs: norecurse nounwind uwtable
17define void @test(i32* nocapture readonly %a, i32* nocapture %b) local_unnamed_addr #0 {
18entry:
19 br label %for.body
20
21for.body: ; preds = %for.body, %entry
22 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
23 %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
24 %0 = load i32, i32* %arrayidx, align 4
25 %add = add nsw i32 %0, 77
26 %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv
27 store i32 %add, i32* %arrayidx2, align 4
28 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
29 %exitcond = icmp eq i64 %indvars.iv.next, 10000
30 br i1 %exitcond, label %for.end, label %for.body
31
32for.end: ; preds = %for.body
33 ret void
34}
35
36attributes #0 = { norecurse nounwind uwtable }