[PPC64LE] Fix lowering of BUILD_VECTOR and SHUFFLE_VECTOR for little endian
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 6 Jun 2014 14:06:26 +0000 (14:06 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 6 Jun 2014 14:06:26 +0000 (14:06 +0000)
commit6c9eb10784646b7025011e3ebf4a34b4241c79c2
tree27701d7d92f44cf3822e45a469eace2c795527b5
parent53b344dcca9427de2f33ce2c8d7f300218fe49e1
[PPC64LE] Fix lowering of BUILD_VECTOR and SHUFFLE_VECTOR for little endian

This patch fixes a couple of lowering issues for little endian
PowerPC.  The code for lowering BUILD_VECTOR contains a number of
optimizations that are only valid for big endian.  For now, we disable
those optimizations for correctness.  In the future, we will add
analogous optimizations that are correct for little endian.

When lowering a SHUFFLE_VECTOR to a VPERM operation, we again need to
make the now-familiar transformation of swapping the input operands
and complementing the permute control vector.  Correctness of this
transformation is tested by the accompanying test case.

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