1 ; RUN: opt < %s -passes=loop-vectorize -force-vector-interleave=2 -force-vector-width=1 -S | FileCheck --enable-var-scope %s
3 ; Make sure we attach memcheck metadata to scalarized memory operations even if
4 ; we're only unrolling.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
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"}
16 ; Function Attrs: norecurse nounwind uwtable
17 define void @test(ptr nocapture readonly %a, ptr nocapture %b) local_unnamed_addr #0 {
21 for.body: ; preds = %for.body, %entry
22 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
23 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
24 %l.1 = load i32, ptr %arrayidx, align 4
25 %arrayidx2 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv
26 %l.2 = load i32, ptr %arrayidx2
27 %add = add nsw i32 %l.1, %l.2
28 store i32 %add, ptr %arrayidx2, align 4
29 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
30 %exitcond = icmp eq i64 %indvars.iv.next, 10000
31 br i1 %exitcond, label %for.end, label %for.body
33 for.end: ; preds = %for.body
37 attributes #0 = { norecurse nounwind uwtable }