summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-05-30 04:33:38 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-05-30 04:33:38 +0000
commite97b102e2b597751c9e9edce74d3d69bba317dcd (patch)
treef46b279af3ba53b2d80dcb9a0ef0dc2ecd76f961 /test/Transforms/InstCombine
parent7486d92a6c949a193bb75c0ffa0170eeb2fabb80 (diff)
downloadllvm-e97b102e2b597751c9e9edce74d3d69bba317dcd.tar.gz
llvm-e97b102e2b597751c9e9edce74d3d69bba317dcd.tar.bz2
llvm-e97b102e2b597751c9e9edce74d3d69bba317dcd.tar.xz
Swizzle vector inputs if it helps us eliminate shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index 8f78c2e6bd..9dc29e4c6c 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -153,3 +153,15 @@ define <8 x i8> @test12a(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind {
ret <8 x i8> %tmp3
}
+define <2 x i8> @test13(i8 %x1, i8 %x2) {
+; CHECK: @test13
+; CHECK-NEXT: insertelement {{.*}} undef, i8 %x1, i32 1
+; CHECK-NEXT: insertelement {{.*}} i8 %x2, i32 0
+; CHECK-NEXT: add {{.*}} <i8 7, i8 5>
+; CHECK-NEXT: ret
+ %A = insertelement <2 x i8> undef, i8 %x1, i32 0
+ %B = insertelement <2 x i8> %A, i8 %x2, i32 1
+ %C = add <2 x i8> %B, <i8 5, i8 7>
+ %D = shufflevector <2 x i8> %C, <2 x i8> undef, <2 x i32> <i32 1, i32 0>
+ ret <2 x i8> %D
+}