diff options
author | Tim Northover <tnorthover@apple.com> | 2014-03-10 09:34:07 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-03-10 09:34:07 +0000 |
commit | 8ca089df49df6807b853dbcb18ab0d2d7dc76c62 (patch) | |
tree | 8e0f9a5243fccf1bf49f0428cfcf9d33ccb90248 /test | |
parent | 31da39e479056edc843b2f9d757dc200eed7797a (diff) | |
download | llvm-8ca089df49df6807b853dbcb18ab0d2d7dc76c62.tar.gz llvm-8ca089df49df6807b853dbcb18ab0d2d7dc76c62.tar.bz2 llvm-8ca089df49df6807b853dbcb18ab0d2d7dc76c62.tar.xz |
AArch64: fix LowerCONCAT_VECTORS for new CodeGen.
The function was making too many assumptions about its input:
1. The NEON_VDUP optimisation was far too aggressive, assuming (I
think) that the input would always be BUILD_VECTOR.
2. We were treating most unknown concats as legal (by returning Op
rather than SDValue()). I think only concats of pairs of vectors are
actually legal.
http://llvm.org/PR19094
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/AArch64/concatvector-bugs.ll (renamed from test/CodeGen/AArch64/concatvector-v8i8-bug.ll) | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/concatvector-v8i8-bug.ll b/test/CodeGen/AArch64/concatvector-bugs.ll index f8854c3b66..5889e22656 100644 --- a/test/CodeGen/AArch64/concatvector-v8i8-bug.ll +++ b/test/CodeGen/AArch64/concatvector-bugs.ll @@ -45,3 +45,24 @@ for.body130.us.us: ; preds = %for.body130.us.us, br label %for.body130.us.us } +declare <1 x i16> @llvm.aarch64.neon.vuqrshrn.v1i16(<1 x i32>, i32) + +define <8 x i16> @test_splat(i32 %l) nounwind { +; CHECK-LABEL: test_splat: +; CHECK: ret + %lhs = insertelement <1 x i32> undef, i32 %l, i32 0 + %shift = tail call <1 x i16> @llvm.aarch64.neon.vuqrshrn.v1i16(<1 x i32> %lhs, i32 11) + %vec = shufflevector <1 x i16> %shift, <1 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %vec +} + + +define <8 x i16> @test_notsplat(<8 x i16> %a, <8 x i16> %b, i32 %l) nounwind { +; CHECK-LABEL: test_notsplat: +; CHECK: ret +entry: + %lhs = insertelement <1 x i32> undef, i32 %l, i32 0 + %shift = tail call <1 x i16> @llvm.aarch64.neon.vuqrshrn.v1i16(<1 x i32> %lhs, i32 11) + %vec = shufflevector <1 x i16> %shift, <1 x i16> undef, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 0, i32 0, i32 0, i32 0> + ret <8 x i16> %vec +} |