From 90bda3bffd185c213c94534d817bf24c92328d16 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 25 Jun 2014 15:41:39 +0000 Subject: [PATCH] Add some test files for r211710. llvm-svn: 211711 --- test/Assembler/upgrade-loop-metadata.ll | 41 +++++++++++++++++++++++ test/Bitcode/upgrade-loop-metadata.ll | 37 ++++++++++++++++++++ test/Bitcode/upgrade-loop-metadata.ll.bc | Bin 0 -> 640 bytes 3 files changed, 78 insertions(+) create mode 100644 test/Assembler/upgrade-loop-metadata.ll create mode 100644 test/Bitcode/upgrade-loop-metadata.ll create mode 100644 test/Bitcode/upgrade-loop-metadata.ll.bc diff --git a/test/Assembler/upgrade-loop-metadata.ll b/test/Assembler/upgrade-loop-metadata.ll new file mode 100644 index 00000000000..f664bdf476a --- /dev/null +++ b/test/Assembler/upgrade-loop-metadata.ll @@ -0,0 +1,41 @@ +; Test to make sure loop vectorizer metadata is automatically upgraded. +; +; Run using opt as well to ensure that the metadata is upgraded when parsing +; assembly. +; +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: opt -S < %s | FileCheck %s + +define void @_Z28loop_with_vectorize_metadatav() { +entry: + %i = alloca i32, align 4 + store i32 0, i32* %i, align 4 + br label %for.cond + +for.cond: ; preds = %for.inc, %entry + %0 = load i32* %i, align 4 + %cmp = icmp slt i32 %0, 16 + br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 + +for.body: ; preds = %for.cond + br label %for.inc + +for.inc: ; preds = %for.body + %1 = load i32* %i, align 4 + %inc = add nsw i32 %1, 1 + store i32 %inc, i32* %i, align 4 + br label %for.cond + +for.end: ; preds = %for.cond + ret void +} + +; CHECK: !{metadata !"llvm.loop.vectorize.unroll", i32 4} +; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8} +; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true} + +!0 = metadata !{metadata !"clang version 3.5.0 (trunk 211528)"} +!1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4, metadata !4} +!2 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4} +!3 = metadata !{metadata !"llvm.vectorizer.width", i32 8} +!4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true} diff --git a/test/Bitcode/upgrade-loop-metadata.ll b/test/Bitcode/upgrade-loop-metadata.ll new file mode 100644 index 00000000000..1a45056d397 --- /dev/null +++ b/test/Bitcode/upgrade-loop-metadata.ll @@ -0,0 +1,37 @@ +; Test to make sure loop vectorizer metadata is automatically upgraded. +; +; RUN: llvm-dis < %s.bc | FileCheck %s + +define void @_Z28loop_with_vectorize_metadatav() { +entry: + %i = alloca i32, align 4 + store i32 0, i32* %i, align 4 + br label %for.cond + +for.cond: ; preds = %for.inc, %entry + %0 = load i32* %i, align 4 + %cmp = icmp slt i32 %0, 16 + br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 + +for.body: ; preds = %for.cond + br label %for.inc + +for.inc: ; preds = %for.body + %1 = load i32* %i, align 4 + %inc = add nsw i32 %1, 1 + store i32 %inc, i32* %i, align 4 + br label %for.cond + +for.end: ; preds = %for.cond + ret void +} + +; CHECK: !{metadata !"llvm.loop.vectorize.unroll", i32 4} +; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8} +; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true} + +!0 = metadata !{metadata !"clang version 3.5.0 (trunk 211528)"} +!1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4, metadata !4} +!2 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4} +!3 = metadata !{metadata !"llvm.vectorizer.width", i32 8} +!4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true} diff --git a/test/Bitcode/upgrade-loop-metadata.ll.bc b/test/Bitcode/upgrade-loop-metadata.ll.bc new file mode 100644 index 0000000000000000000000000000000000000000..3f218cb7feb471411c175f735752242d1ba37ecc GIT binary patch literal 640 zcmZ>AK5$Qwhk;=(0|NthlL7-1kQM@B_D1E2jwe_=*#wL%Co#70sIqcM%CU4OH3+ye zIZfhrY7sCJvEY#Kvqj6{9;XKO$_n=48HGI082H}`@O^3EGv;xUJ9JR?+(MZ&16HuIX6ZA`wkMoz zdzfv{RP>Y-uvc>cozh-Vz+P3rTvpLupwKRP>LA~n1pc=V*xr2Ld(XfRw5t&4aSkBO zCcyST=X3XCoBgdm$KwSLJ#q1H`@>_%$ZWtU3Y2C@RA69G2GYVTuHf(l#j}a30aE}_ z+*t6415dNyK?8=(ER3wlI}{}@BusNuXo_rVY)d@I*mST%NunXLiQ#Y~0|PHm-!ub` zGsO(77kvcFm^>c3)IH#tAR~iw O0H>|!wnso70ssK_)wvx2 literal 0 HcmV?d00001