summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLouis Gerbarg <lgg@apple.com>2014-04-17 20:51:50 +0000
committerLouis Gerbarg <lgg@apple.com>2014-04-17 20:51:50 +0000
commit5540570374a374e702bce1c2fa4208ebe9433d74 (patch)
treeb38874f2f08f19eefc9fe435bb4552a750ab3a9a /test
parent4af58f145d7dececbd866c7f8e942cbfc5801d90 (diff)
downloadllvm-5540570374a374e702bce1c2fa4208ebe9433d74.tar.gz
llvm-5540570374a374e702bce1c2fa4208ebe9433d74.tar.bz2
llvm-5540570374a374e702bce1c2fa4208ebe9433d74.tar.xz
Improve ARM64 vector creation
This patch improves the performance of vector creation in caseiswhere where several of the lanes in the vector are a constant floating point value. It also includes new patterns to fold together some of the instructions when the value is 0.0f. Test cases included. rdar://16349427 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM64/vector-insertion.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGen/ARM64/vector-insertion.ll b/test/CodeGen/ARM64/vector-insertion.ll
new file mode 100644
index 0000000000..c9ca74929e
--- /dev/null
+++ b/test/CodeGen/ARM64/vector-insertion.ll
@@ -0,0 +1,33 @@
+; RUN: llc -march=arm64 -mcpu=generic < %s | FileCheck %s
+
+define void @test0f(float* nocapture %x, float %a) #0 {
+entry:
+ %0 = insertelement <4 x float> <float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float %a, i32 0
+ %1 = bitcast float* %x to <4 x float>*
+ store <4 x float> %0, <4 x float>* %1, align 16
+ ret void
+
+ ; CHECK-LABEL: test0f
+ ; CHECK: movi.2d v[[TEMP:[0-9]+]], #0000000000000000
+ ; CHECK: ins.s v[[TEMP]][0], v{{[0-9]+}}[0]
+ ; CHECK: str q[[TEMP]], [x0]
+ ; CHECK: ret
+
+
+}
+
+
+define void @test1f(float* nocapture %x, float %a) #0 {
+entry:
+ %0 = insertelement <4 x float> <float undef, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, float %a, i32 0
+ %1 = bitcast float* %x to <4 x float>*
+ store <4 x float> %0, <4 x float>* %1, align 16
+ ret void
+
+ ; CHECK-LABEL: test1f
+ ; CHECK: fmov s[[TEMP:[0-9]+]], #1.000000e+00
+ ; CHECK: dup.4s v[[TEMP2:[0-9]+]], v[[TEMP]][0]
+ ; CHECK: ins.s v[[TEMP2]][0], v0[0]
+ ; CHECK: str q[[TEMP2]], [x0]
+ ; CHECK: ret
+}