[PPC64LE] Recognize shufflevector patterns for little endian
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 10 Jun 2014 14:35:01 +0000 (14:35 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 10 Jun 2014 14:35:01 +0000 (14:35 +0000)
commitb02d95cb66157aa49bf5e50a8778c182a7b8604e
tree887ab39b90982a0c8a4057313ed17f5a30dfc270
parent0db9526c1a04603e66465f112e9cd7a9eb231f80
[PPC64LE] Recognize shufflevector patterns for little endian

Various masks on shufflevector instructions are recognizable as
specific PowerPC instructions (vector pack, vector merge, etc.).
There is existing code in PPCISelLowering.cpp to recognize the correct
patterns for big endian code.  The masks for these instructions are
different for little endian code due to the big-endian numbering
employed by these instructions.  This patch adds the recognition code
for little endian.

I've added a new test case test/CodeGen/PowerPC/vec_shuffle_le.ll for
this.  The existing recognizer test (vec_shuffle.ll) is unnecessarily
verbose and difficult to read, so I felt it was better to add a new
test rather than modify the old one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210536 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstrAltivec.td
test/CodeGen/PowerPC/vec_shuffle_le.ll [new file with mode: 0644]