diff options
author | Jim Grosbach <grosbach@apple.com> | 2013-04-30 20:43:52 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2013-04-30 20:43:52 +0000 |
commit | 6548096a2e2b34e685680e6e1055b8e407c2c243 (patch) | |
tree | 01207a2ecc461f37c2a8e790c952afb18f27d9ee /test/Transforms/InstCombine | |
parent | b0caf5ff64962fd9ff2977d7c31d6bb88fb8a8a5 (diff) | |
download | external_llvm-6548096a2e2b34e685680e6e1055b8e407c2c243.zip external_llvm-6548096a2e2b34e685680e6e1055b8e407c2c243.tar.gz external_llvm-6548096a2e2b34e685680e6e1055b8e407c2c243.tar.bz2 |
InstCombine: Fold more shuffles of shuffles.
Always fold a shuffle-of-shuffle into a single shuffle when there's only one
input vector in the first place. Continue to be more conservative when there's
multiple inputs.
rdar://13402653
PR15866
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/vec_shuffle.ll | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll index 37d4d56..37c19f1 100644 --- a/test/Transforms/InstCombine/vec_shuffle.ll +++ b/test/Transforms/InstCombine/vec_shuffle.ll @@ -86,14 +86,14 @@ define <4 x i8> @test9(<16 x i8> %tmp6) nounwind { } ; Same as test9, but make sure that "undef" mask values are not confused with -; mask values of 2*N, where N is the mask length. These shuffles should not -; be folded (because [8,9,4,8] may not be a mask supported by the target). -define <4 x i8> @test9a(<16 x i8> %tmp6) nounwind { +; mask values of 2*N, where N is the mask length of the result. Make sure when +; folding these shuffles that 'undef' mask values stay that way in the result +; instead of getting mapped to the 2*N'th entry of the source. +define <4 x i8> @test9a(<16 x i8> %in, <16 x i8> %in2) nounwind { ; CHECK: @test9a -; CHECK-NEXT: shufflevector -; CHECK-NEXT: shufflevector +; CHECK-NEXT: shufflevector <16 x i8> %in, <16 x i8> %in2, <4 x i32> <i32 16, i32 9, i32 4, i32 undef> ; CHECK-NEXT: ret - %tmp7 = shufflevector <16 x i8> %tmp6, <16 x i8> undef, <4 x i32> < i32 undef, i32 9, i32 4, i32 8 > ; <<4 x i8>> [#uses=1] + %tmp7 = shufflevector <16 x i8> %in, <16 x i8> %in2, <4 x i32> < i32 undef, i32 9, i32 4, i32 16 > ; <<4 x i8>> [#uses=1] %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 } |