summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHao Liu <Hao.Liu@arm.com>2014-01-08 03:06:15 +0000
committerHao Liu <Hao.Liu@arm.com>2014-01-08 03:06:15 +0000
commit9e0fd27ce7cd1a7b1a316760de7cf4795799af26 (patch)
treef1cd511714086451117a7b032671a928d3dbc3d5 /test
parent476136e951595540917a6bc6f05817540986b8fb (diff)
downloadllvm-9e0fd27ce7cd1a7b1a316760de7cf4795799af26.tar.gz
llvm-9e0fd27ce7cd1a7b1a316760de7cf4795799af26.tar.bz2
llvm-9e0fd27ce7cd1a7b1a316760de7cf4795799af26.tar.xz
Fix a bug about generating undef operand when optimising shuffle vector and insert element in instruction combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index 3ee43dc63a..a409a911ef 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -228,3 +228,20 @@ define <4 x float> @test15b(<4 x float> %LHS, <4 x float> %RHS) {
ret <4 x float> %tmp5
}
+define <1 x i32> @test16a(i32 %ele) {
+; CHECK-LABEL: @test16a(
+; CHECK-NEXT: ret <1 x i32> <i32 2>
+ %tmp0 = insertelement <2 x i32> <i32 1, i32 undef>, i32 %ele, i32 1
+ %tmp1 = shl <2 x i32> %tmp0, <i32 1, i32 1>
+ %tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> undef, <1 x i32> <i32 0>
+ ret <1 x i32> %tmp2
+}
+
+define <4 x i8> @test16b(i8 %ele) {
+; CHECK-LABEL: @test16b(
+; CHECK-NEXT: ret <4 x i8> <i8 2, i8 2, i8 2, i8 2>
+ %tmp0 = insertelement <8 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 undef, i8 1>, i8 %ele, i32 6
+ %tmp1 = shl <8 x i8> %tmp0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
+ %tmp2 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
+ ret <4 x i8> %tmp2
+} \ No newline at end of file