From: Evan Cheng Date: Fri, 16 May 2008 17:19:05 +0000 (+0000) Subject: If the result of a BIT_CONVERT is a v1* vector, it doesn't mean its source is a v1... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=446efddfcd655131bd0ceeacce9c1166e30ed479;p=oota-llvm.git If the result of a BIT_CONVERT is a v1* vector, it doesn't mean its source is a v1* vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51192 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 155b1a33acc..3290311df2b 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -7109,10 +7109,13 @@ SDOperand SelectionDAGLegalize::ScalarizeVectorOp(SDOperand Op) { Result = Node->getOperand(0); assert(Result.getValueType() == NewVT); break; - case ISD::BIT_CONVERT: - Result = DAG.getNode(ISD::BIT_CONVERT, NewVT, - ScalarizeVectorOp(Op.getOperand(0))); + case ISD::BIT_CONVERT: { + SDOperand Op0 = Op.getOperand(0); + if (MVT::getVectorNumElements(Op0.getValueType()) == 1) + Op0 = ScalarizeVectorOp(Op0); + Result = DAG.getNode(ISD::BIT_CONVERT, NewVT, Op0); break; + } case ISD::SELECT: Result = DAG.getNode(ISD::SELECT, NewVT, Op.getOperand(0), ScalarizeVectorOp(Op.getOperand(1)),