1 ; Test to make sure loop vectorizer metadata is automatically upgraded.
3 ; Run using opt as well to ensure that the metadata is upgraded when parsing
6 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
7 ; RUN: opt -S < %s | FileCheck %s
8 ; RUN: verify-uselistorder %s
10 define void @_Z28loop_with_vectorize_metadatav() {
12 %i = alloca i32, align 4
13 store i32 0, i32* %i, align 4
16 for.cond: ; preds = %for.inc, %entry
17 %0 = load i32* %i, align 4
18 %cmp = icmp slt i32 %0, 16
19 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1
21 for.body: ; preds = %for.cond
24 for.inc: ; preds = %for.body
25 %1 = load i32* %i, align 4
26 %inc = add nsw i32 %1, 1
27 store i32 %inc, i32* %i, align 4
30 for.end: ; preds = %for.cond
34 ; CHECK: !{metadata !"llvm.loop.interleave.count", i32 4}
35 ; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8}
36 ; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true}
38 !0 = metadata !{metadata !"clang version 3.5.0 (trunk 211528)"}
39 !1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4, metadata !4}
40 !2 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4}
41 !3 = metadata !{metadata !"llvm.vectorizer.width", i32 8}
42 !4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true}