OSDN Git Service

[PowerPC][Power10] Exploit the xxsplti32dx instruction when lowering VECTOR_SHUFFLE.
authorAmy Kwan <amy.kwan1@ibm.com>
Tue, 7 Jul 2020 00:58:04 +0000 (19:58 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Tue, 7 Jul 2020 01:28:38 +0000 (20:28 -0500)
commitc13e3e2c2e0c774917bcc7f4f50c29c8133d3a55
tree6d02ecb9a3dbc560e8a3efacebf00e17acbd9fcc
parentab25ed26c67e5d540e6628fa5e5982e7e9b90a38
[PowerPC][Power10] Exploit the xxsplti32dx instruction when lowering VECTOR_SHUFFLE.

This patch aims to exploit the xxsplti32dx XT, IX, IMM32 instruction when lowering VECTOR_SHUFFLEs.
We implement lowerToXXSPLTI32DX when lowering vector shuffles to check if:
- Element size is 4 bytes
- The RHS is a constant vector (and constant splat of 4-bytes)
- The shuffle mask is a suitable mask for the XXSPLTI32DX instruction where it is one of the 32 masks:
<0, 4-7, 2, 4-7>
<4-7, 1, 4-7, 3>

Differential Revision: https://reviews.llvm.org/D83245
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
llvm/test/CodeGen/PowerPC/p10-splatImm32.ll [new file with mode: 0644]