aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/vec_shuffle.ll
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-05-31 00:59:42 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-05-31 00:59:42 +0000
commit903f26d904cb7eba9b57ed85b2dc6147a8811bd7 (patch)
tree6fa1f13a1dac4643e88e6104a63504a0c194b18b /test/Transforms/InstCombine/vec_shuffle.ll
parent6f6ec56b12aff45977b5ea1433739179198d4b81 (diff)
downloadexternal_llvm-903f26d904cb7eba9b57ed85b2dc6147a8811bd7.zip
external_llvm-903f26d904cb7eba9b57ed85b2dc6147a8811bd7.tar.gz
external_llvm-903f26d904cb7eba9b57ed85b2dc6147a8811bd7.tar.bz2
Reapply with r182909 with a fix to the calculation of the new indices for
insertelement instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/vec_shuffle.ll')
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index 8f78c2e..4b7a049 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -153,3 +153,24 @@ define <8 x i8> @test12a(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind {
ret <8 x i8> %tmp3
}
+define <2 x i8> @test13a(i8 %x1, i8 %x2) {
+; CHECK: @test13a
+; 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
+}
+
+define <2 x i8> @test13b(i8 %x) {
+; CHECK: @test13b
+; CHECK-NEXT: insertelement <2 x i8> undef, i8 %x, i32 1
+; CHECK-NEXT: ret
+ %A = insertelement <2 x i8> undef, i8 %x, i32 0
+ %B = shufflevector <2 x i8> %A, <2 x i8> undef, <2 x i32> <i32 undef, i32 0>
+ ret <2 x i8> %B
+}