[PowerPC] Enable splat generation for BUILD_VECTOR with little endian
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 3 Apr 2015 13:48:24 +0000 (13:48 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 3 Apr 2015 13:48:24 +0000 (13:48 +0000)
commit1c4b6de5edb308a4bea0cb75013e5a2cafcbe65e
tree2bd16fea6411249e5edba9cdc35246d3a6847c6f
parente5ecd3248854ce32df43fe8766849f5797b4a877
[PowerPC] Enable splat generation for BUILD_VECTOR with little endian

When enabling PPC64LE, I disabled some optimizations of BUILD_VECTOR
nodes for little endian because wrong results were produced.  I've
subsequently investigated and found this is due to a call to
BuildVectorSDNode::isConstantSplat that was always specifying
big-endian.  With this changed to correctly identify the target
endianness, the optimizations work as expected.

I found another case of a call to the same method with big-endian
hardcoded, in PPC::isAllNegativeZeroVector().  I discovered this was
an orphaned method with no callers, so I've just removed it.

The existing test/CodeGen/PowerPC/vec_constants.ll checks these
optimizations, so for testing I've just added a variant for little
endian.

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