From: Evan Cheng Date: Fri, 24 Mar 2006 18:45:20 +0000 (+0000) Subject: Only to vector shuffle for {x,x,y,y} cases when SCALAR_TO_VECTOR is free. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=73d7b6029ac8b52a90f302d06831abcc04c77077;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index dfafb70585f..6acadc1349d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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 Ops; for(std::map >::iterator I=Values.begin(), E = Values.end(); I != E; ++I) {