blob: 9f7cdef51fe3e549b9ce5bb893755ac268cb9c02 [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"
3target triple = "x86_64-unknown-linux-gnu"
4
5; This test makes sure we don't duplicate the loop vectorizer's metadata
6; while marking them as already vectorized (by setting width = 1), even
7; at lower optimization levels, where no extra cleanup is done
8
9define void @_Z3fooPf(float* %a) {
10entry:
11 br label %for.body
12
13for.body: ; preds = %for.body, %entry
14 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
David Blaikie79e6c742015-02-27 19:29:02 +000015 %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv
David Blaikiea79ac142015-02-27 21:17:42 +000016 %p = load float, float* %arrayidx, align 4
Renato Golin86a6c3f2014-09-01 10:00:17 +000017 %mul = fmul float %p, 2.000000e+00
18 store float %mul, float* %arrayidx, align 4
19 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
20 %exitcond = icmp eq i64 %indvars.iv.next, 1024
21 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
22
23for.end: ; preds = %for.body
24 ret void
25}
26
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000027!0 = !{!0, !1}
28!1 = !{!"llvm.loop.vectorize.width", i32 4}
Renato Golin86a6c3f2014-09-01 10:00:17 +000029; CHECK-NOT: !{metadata !"llvm.loop.vectorize.width", i32 4}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000030; CHECK: !{!"llvm.loop.interleave.count", i32 1}