summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/vec-move-20.ll
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-11-12 08:12:20 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-11-12 08:12:20 +0000
commitc0ee028dc341ca586d2bf362f0c3b70b39e41c63 (patch)
tree853c357c331ef78ca43e232e32e9e19b3ffc9eeb /llvm/test/CodeGen/SystemZ/vec-move-20.ll
parent5014540a63afb4993dbff6c21e9cdf00ed4f9e36 (diff)
downloadbcm5719-llvm-c0ee028dc341ca586d2bf362f0c3b70b39e41c63.tar.gz
bcm5719-llvm-c0ee028dc341ca586d2bf362f0c3b70b39e41c63.zip
[SystemZ] Replicate the load with most uses in buildVector()
Iterate over all elements and count the number of uses among them for each used load. Then make sure to REPLICATE the load which has the most uses in order to minimize the number of needed element insertions. Review: Ulrich Weigand https://reviews.llvm.org/D54322 llvm-svn: 346637
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/vec-move-20.ll')
-rw-r--r--llvm/test/CodeGen/SystemZ/vec-move-20.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/vec-move-20.ll b/llvm/test/CodeGen/SystemZ/vec-move-20.ll
new file mode 100644
index 00000000000..ebf1b7db520
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/vec-move-20.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
+
+; Test a vector which is built with elements from two loads replicates the
+; load with most elements having its value.
+
+; CHECK: vlef
+; CHECK-NOT: vlvgf
+
+define void @update(i32* %src1, i32* %src2, <4 x i32>* %dst) {
+bb:
+ %tmp = load i32, i32* %src1
+ %tmp1 = load i32, i32* %src2
+ %tmp2 = insertelement <4 x i32> undef, i32 %tmp, i32 0
+ %tmp3 = insertelement <4 x i32> %tmp2, i32 %tmp1, i32 1
+ %tmp4 = insertelement <4 x i32> %tmp3, i32 %tmp1, i32 2
+ %tmp5 = insertelement <4 x i32> %tmp4, i32 %tmp1, i32 3
+ store <4 x i32> %tmp5, <4 x i32>* %dst
+ ret void
+}
OpenPOWER on IntegriCloud