Renato Golin | 86a6c3f | 2014-09-01 10:00:17 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -loop-vectorize -S 2>&1 | FileCheck %s |
| 2 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
Renato Golin | 86a6c3f | 2014-09-01 10:00:17 +0000 | [diff] [blame] | 3 | |
| 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 | |
| 8 | define void @_Z3fooPf(float* %a) { |
| 9 | entry: |
| 10 | br label %for.body |
| 11 | |
| 12 | for.body: ; preds = %for.body, %entry |
| 13 | %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 14 | %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 15 | %p = load float, float* %arrayidx, align 4 |
Renato Golin | 86a6c3f | 2014-09-01 10:00:17 +0000 | [diff] [blame] | 16 | %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 | |
| 22 | for.end: ; preds = %for.body |
| 23 | ret void |
| 24 | } |
| 25 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 26 | !0 = !{!0, !1} |
| 27 | !1 = !{!"llvm.loop.vectorize.width", i32 4} |
Renato Golin | 86a6c3f | 2014-09-01 10:00:17 +0000 | [diff] [blame] | 28 | ; CHECK-NOT: !{metadata !"llvm.loop.vectorize.width", i32 4} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 29 | ; CHECK: !{!"llvm.loop.interleave.count", i32 1} |