[SystemZ] Improve handling of ZERO_EXTEND_VECTOR_INREG.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 26 Mar 2020 11:22:14 +0000 (12:22 +0100)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 30 Jun 2020 07:08:10 +0000 (09:08 +0200)
commitef7aad0db49f0a3623b42af991ba4ae48099a58d
treeb4960385b87791a1a614c9e08c327e553283efd0
parent2c663aa539c3c378599776f4a6849f1cbee5fb93
[SystemZ] Improve handling of ZERO_EXTEND_VECTOR_INREG.

Instead of doing multiple unpacks when zero extending vectors (e.g. v2i16 ->
v2i64), benchmarks have shown that it is better to do a VPERM (vector
permute) since that is only one sequential instruction on the critical path.

This patch achieves this by

1. Expand ZERO_EXTEND_VECTOR_INREG into a vector shuffle with a zero vector
   instead of (multiple) unpacks.

2. Improve SystemZ::GeneralShuffle to perform a single unpack as the last
   operation if Bytes matches it.

Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D78486
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/lib/Target/SystemZ/SystemZISelLowering.h
llvm/test/CodeGen/SystemZ/vec-move-16.ll
llvm/test/CodeGen/SystemZ/vec-move-23.ll
llvm/test/CodeGen/SystemZ/vec-move-24.ll [new file with mode: 0644]
llvm/test/CodeGen/SystemZ/vec-zext.ll