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