summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/insert-const-shuf.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/insert-const-shuf.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/insert-const-shuf.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/insert-const-shuf.ll b/llvm/test/Transforms/InstCombine/insert-const-shuf.ll
index 60f272f1096..3e301e336af 100644
--- a/llvm/test/Transforms/InstCombine/insert-const-shuf.ll
+++ b/llvm/test/Transforms/InstCombine/insert-const-shuf.ll
@@ -26,6 +26,15 @@ define <4 x float> @twoInserts(<4 x float> %x) {
ret <4 x float> %ins2
}
+define <4 x i32> @shuffleRetain(<4 x i32> %base) {
+; CHECK-LABEL: @shuffleRetain(
+; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> %base, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 1>, <4 x i32> <i32 1, i32 2, i32 undef, i32 7>
+; CHECK-NEXT: ret <4 x i32> [[SHUF]]
+;
+ %shuf = shufflevector <4 x i32> %base, <4 x i32> <i32 4, i32 3, i32 2, i32 1>, <4 x i32> <i32 1, i32 2, i32 undef, i32 7>
+ ret <4 x i32> %shuf
+}
+
; TODO: Transform an arbitrary shuffle with constant into a shuffle that is equivalant to a vector select.
define <4 x float> @disguisedSelect(<4 x float> %x) {
OpenPOWER on IntegriCloud