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 ; RUN: verify-uselistorder %s 9 10 define void @_Z28loop_with_vectorize_metadatav() { 11 entry: 12 %i = alloca i32, align 4 13 store i32 0, i32* %i, align 4 14 br label %for.cond 15 16 for.cond: ; preds = %for.inc, %entry 17 %0 = load i32, i32* %i, align 4 18 %cmp = icmp slt i32 %0, 16 19 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 20 21 for.body: ; preds = %for.cond 22 br label %for.inc 23 24 for.inc: ; preds = %for.body 25 %1 = load i32, i32* %i, align 4 26 %inc = add nsw i32 %1, 1 27 store i32 %inc, i32* %i, align 4 28 br label %for.cond 29 30 for.end: ; preds = %for.cond 31 ret void 32 } 33 34 ; CHECK: !{!"llvm.loop.interleave.count", i32 4} 35 ; CHECK: !{!"llvm.loop.vectorize.width", i32 8} 36 ; CHECK: !{!"llvm.loop.vectorize.enable", i1 true} 37 38 !0 = !{!"clang version 3.5.0 (trunk 211528)"} 39 !1 = !{!1, !2, !3, !4, !4} 40 !2 = !{!"llvm.vectorizer.unroll", i32 4} 41 !3 = !{!"llvm.vectorizer.width", i32 8} 42 !4 = !{!"llvm.vectorizer.enable", i1 true} 43