[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 21 May 2015 20:48:49 +0000 (20:48 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 21 May 2015 20:48:49 +0000 (20:48 +0000)
commit63292d1bbabaebcfe3cc7d7fe5c0314b1d275a7d
tree4d7d29c5613b08285f9b3b97c2b4e1516fd42d0e
parentfabbc4985b85bf4adedff9f67f78172127ab154c
[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available

My recent patch to add support for ISA 2.07 vector pack/unpack
instructions didn't properly check for availability of the vpkudum
instruction when recognizing it as a special vector shuffle case.
This causes us to leave the vector shuffle in place (rather than
converting it to a vector permute) so that it can be recognized later
as a vpkudum, but that pattern is invalid for processors prior to
POWER8.  Thus LLVM crashes with an "unable to select" message.  We
observed this since one of our buildbots is configured to generate
code for a POWER7.

This patch fixes the problem by checking for availability of the
vpkudum instruction during custom lowering of vector shuffles.

I've added a test case variant for the vpkudum pattern when the
instruction isn't available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237952 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/vec_shuffle_p8vector.ll