[llvm-commits] CVS: llvm/test/Transforms/GVNPRE/extractelement.ll insertelement.ll shufflevector.ll
Owen Anderson
resistor at mac.com
Tue Jun 26 21:06:55 PDT 2007
Changes in directory llvm/test/Transforms/GVNPRE:
extractelement.ll added (r1.1)
insertelement.ll added (r1.1)
shufflevector.ll added (r1.1)
---
Log message:
Add tests for performing GVNPRE on the three vector-specific instructions.
---
Diffs of the changes: (+54 -0)
extractelement.ll | 18 ++++++++++++++++++
insertelement.ll | 18 ++++++++++++++++++
shufflevector.ll | 18 ++++++++++++++++++
3 files changed, 54 insertions(+)
Index: llvm/test/Transforms/GVNPRE/extractelement.ll
diff -c /dev/null llvm/test/Transforms/GVNPRE/extractelement.ll:1.1
*** /dev/null Tue Jun 26 23:06:42 2007
--- llvm/test/Transforms/GVNPRE/extractelement.ll Tue Jun 26 23:06:32 2007
***************
*** 0 ****
--- 1,18 ----
+ ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+ define i32 @extract() {
+ entry: ; preds = %cond_false, %entry
+ %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
+ br i1 true, label %cond_true, label %cond_false
+
+ cond_true:
+ br label %end
+
+ cond_false:
+ %a = extractelement <2 x i32> %foo, i32 0
+ br label %end
+
+ end:
+ %b = extractelement <2 x i32> %foo, i32 0
+ ret i32 %b
+ }
Index: llvm/test/Transforms/GVNPRE/insertelement.ll
diff -c /dev/null llvm/test/Transforms/GVNPRE/insertelement.ll:1.1
*** /dev/null Tue Jun 26 23:06:55 2007
--- llvm/test/Transforms/GVNPRE/insertelement.ll Tue Jun 26 23:06:32 2007
***************
*** 0 ****
--- 1,18 ----
+ ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+ define i32 @extract() {
+ entry: ; preds = %cond_false, %entry
+ %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
+ br i1 true, label %cond_true, label %cond_false
+
+ cond_true:
+ br label %end
+
+ cond_false:
+ %a = insertelement <2 x i32> %foo, i32 0, i32 3
+ br label %end
+
+ end:
+ %b = insertelement <2 x i32> %foo, i32 0, i32 3
+ ret i32 0
+ }
Index: llvm/test/Transforms/GVNPRE/shufflevector.ll
diff -c /dev/null llvm/test/Transforms/GVNPRE/shufflevector.ll:1.1
*** /dev/null Tue Jun 26 23:06:55 2007
--- llvm/test/Transforms/GVNPRE/shufflevector.ll Tue Jun 26 23:06:32 2007
***************
*** 0 ****
--- 1,18 ----
+ ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+ define i32 @extract() {
+ entry: ; preds = %cond_false, %entry
+ %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
+ br i1 true, label %cond_true, label %cond_false
+
+ cond_true:
+ br label %end
+
+ cond_false:
+ %a = shufflevector <2 x i32> %foo, <2 x i32> undef, <2 x i32> < i32 0, i32 1 >
+ br label %end
+
+ end:
+ %b = shufflevector <2 x i32> %foo, <2 x i32> undef, <2 x i32> < i32 0, i32 1 >
+ ret i32 0
+ }
More information about the llvm-commits
mailing list