Only to vector shuffle for {x,x,y,y} cases when SCALAR_TO_VECTOR is free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-03-24 18:45:20 +00:00
parent da91bdcfb0
commit 73d7b6029a

View File

@ -3209,7 +3209,8 @@ SDOperand SelectionDAGLegalize::ExpandBUILD_VECTOR(SDNode *Node) {
SDOperand ShuffleMask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT, MaskVec);
// If the target supports VECTOR_SHUFFLE and this shuffle mask, use it.
if (TLI.isShuffleLegal(Node->getValueType(0), ShuffleMask)) {
if (TLI.isShuffleLegal(Node->getValueType(0), ShuffleMask) &&
TLI.isOperationLegal(ISD::SCALAR_TO_VECTOR, Node->getValueType(0))) {
std::vector<SDOperand> Ops;
for(std::map<SDOperand,std::vector<unsigned> >::iterator I=Values.begin(),
E = Values.end(); I != E; ++I) {