summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2017-08-08 13:52:45 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2017-08-08 13:52:45 +0000
commitccf6aaba910a9669fbf123282e681686b8447d2e (patch)
treecee97a36f1fc056e5954f3bf7aa55cf64e63a9d3 /test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll
parent0e484a9fbc1c78de235b7973143a7b7fe97529c0 (diff)
[PowerPC] Don't crash on larger splats achieved through 1-byte splats
We've implemented a 1-byte splat using XXSPLTISB on P9. However, LLVM will produce a 1-byte splat even for wider element BUILD_VECTOR nodes. This patch prevents crashing in that situation. Differential Revision: https://reviews.llvm.org/D35650 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll')
-rw-r--r--test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll b/test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll
new file mode 100644
index 00000000000..2ae61f1bb57
--- /dev/null
+++ b/test/CodeGen/PowerPC/splat-larger-types-as-v16i8.ll
@@ -0,0 +1,20 @@
+; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-unknown < %s | FileCheck %s
+; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
+define <8 x i16> @test1() {
+entry:
+ ret <8 x i16> <i16 257, i16 257, i16 257, i16 257, i16 257, i16 257, i16 257, i16 257>
+; CHECK-LABEL: test1
+; CHECK: xxspltib 34, 1
+}
+define <8 x i16> @testAB() {
+entry:
+; CHECK-LABEL: testAB
+; CHECK: xxspltib 34, 171
+ ret <8 x i16> <i16 43947, i16 43947, i16 43947, i16 43947, i16 43947, i16 43947, i16 43947, i16 43947>
+}
+define <4 x i32> @testAB32() {
+entry:
+; CHECK-LABEL: testAB32
+; CHECK: xxspltib 34, 171
+ ret <4 x i32> <i32 2880154539, i32 2880154539, i32 2880154539, i32 2880154539>
+}