summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-03-08 15:02:23 +0000
committerSanjay Patel <spatel@rotateright.com>2017-03-08 15:02:23 +0000
commit62906af379fb6f27b57e28ed3224a50c4242e35c (patch)
tree23cf2b2e17ae8aaa308c8cb5ded1c284347c370d /llvm/test/Transforms/InstCombine
parent9ef577803870369dcfc0f2074e2302215679269b (diff)
downloadbcm5719-llvm-62906af379fb6f27b57e28ed3224a50c4242e35c.tar.gz
bcm5719-llvm-62906af379fb6f27b57e28ed3224a50c4242e35c.zip
[InstCombine] avoid crashing on shuffle shrinkage when input type is not same as result type
llvm-svn: 297280
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/trunc.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/trunc.ll b/llvm/test/Transforms/InstCombine/trunc.ll
index ba72908d3c4..5597b578f01 100644
--- a/llvm/test/Transforms/InstCombine/trunc.ll
+++ b/llvm/test/Transforms/InstCombine/trunc.ll
@@ -520,3 +520,16 @@ define <3 x i31> @wide_splat3(<3 x i33> %x) {
ret <3 x i31> %trunc
}
+; TODO: The shuffle extends the length of the input vector. Should we shrink this?
+
+define <8 x i8> @wide_lengthening_splat(<4 x i16> %v) {
+; CHECK-LABEL: @wide_lengthening_splat(
+; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i16> %v, <4 x i16> undef, <8 x i32> zeroinitializer
+; CHECK-NEXT: [[TR:%.*]] = trunc <8 x i16> [[SHUF]] to <8 x i8>
+; CHECK-NEXT: ret <8 x i8> [[TR]]
+;
+ %shuf = shufflevector <4 x i16> %v, <4 x i16> %v, <8 x i32> zeroinitializer
+ %tr = trunc <8 x i16> %shuf to <8 x i8>
+ ret <8 x i8> %tr
+}
+
OpenPOWER on IntegriCloud