summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/vec_shuffle.ll
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-10-29 22:02:50 +0000
committerBob Wilson <bob.wilson@apple.com>2010-10-29 22:02:50 +0000
commit4cac5facc3a95a81ffa2c85baae001a7c509146c (patch)
treea7b8642ef9d0d1b7e4c02a26a227fea462466138 /test/Transforms/InstCombine/vec_shuffle.ll
parent3df518e67edaf358154af394cc99d21435b7b118 (diff)
downloadllvm-4cac5facc3a95a81ffa2c85baae001a7c509146c.tar.gz
llvm-4cac5facc3a95a81ffa2c85baae001a7c509146c.tar.bz2
llvm-4cac5facc3a95a81ffa2c85baae001a7c509146c.tar.xz
Make instcombine a little more aggressive in combining vector shuffles.
Allow splats even if they don't match either of the original shuffles, possibly due to undef entries in the shuffles masks. Radar 8597790. Also fix some 80-column violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/vec_shuffle.ll')
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index 5132a8ff9b..d4977fb807 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -87,3 +87,13 @@ define <4 x i8> @test9(<16 x i8> %tmp6) nounwind {
%tmp9 = shufflevector <4 x i8> %tmp7, <4 x i8> undef, <4 x i32> < i32 3, i32 1, i32 2, i32 0 > ; <<4 x i8>> [#uses=1]
ret <4 x i8> %tmp9
}
+
+; Redundant vector splats should be removed. Radar 8597790.
+define <4 x i32> @test10(<4 x i32> %tmp5) nounwind {
+; CHECK: @test10
+; CHECK-NEXT: shufflevector
+; CHECK-NEXT: ret
+ %tmp6 = shufflevector <4 x i32> %tmp5, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
+ %tmp7 = shufflevector <4 x i32> %tmp6, <4 x i32> undef, <4 x i32> zeroinitializer
+ ret <4 x i32> %tmp7
+}