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

llvm-svn: 27071
This commit is contained in:
Evan Cheng 2006-03-24 18:45:20 +00:00
parent 58a9622957
commit 68d9bf26c8
1 changed files with 2 additions and 1 deletions

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) {