blob: d0afd28d978a48566239754e774afacd3c2487eb [file] [log] [blame]
Renato Golin86a6c3f2014-09-01 10:00:17 +00001; RUN: opt < %s -loop-vectorize -S 2>&1 | FileCheck %s
2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Renato Golin86a6c3f2014-09-01 10:00:17 +00003
4; This test makes sure we don't duplicate the loop vectorizer's metadata
5; while marking them as already vectorized (by setting width = 1), even
6; at lower optimization levels, where no extra cleanup is done
7
8define void @_Z3fooPf(float* %a) {
9entry:
10 br label %for.body
11
12for.body: ; preds = %for.body, %entry
13 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
David Blaikie79e6c742015-02-27 19:29:02 +000014 %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv
David Blaikiea79ac142015-02-27 21:17:42 +000015 %p = load float, float* %arrayidx, align 4
Renato Golin86a6c3f2014-09-01 10:00:17 +000016 %mul = fmul float %p, 2.000000e+00
17 store float %mul, float* %arrayidx, align 4
18 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
19 %exitcond = icmp eq i64 %indvars.iv.next, 1024
20 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
21
22for.end: ; preds = %for.body
23 ret void
24}
25
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000026!0 = !{!0, !1}
27!1 = !{!"llvm.loop.vectorize.width", i32 4}
Renato Golin86a6c3f2014-09-01 10:00:17 +000028; CHECK-NOT: !{metadata !"llvm.loop.vectorize.width", i32 4}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000029; CHECK: !{!"llvm.loop.interleave.count", i32 1}