Add a missing check, which broke a bunch of vector tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27374 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-04-03 17:21:50 +00:00
parent 03017c75c7
commit a4c5d8c6b4

View File

@ -2756,9 +2756,12 @@ SDOperand DAGCombiner::visitVBinOp(SDNode *N, ISD::NodeType IntOp,
Ops.back().getOpcode() == ISD::ConstantFP) && Ops.back().getOpcode() == ISD::ConstantFP) &&
"Scalar binop didn't fold!"); "Scalar binop didn't fold!");
} }
Ops.push_back(*(LHS.Val->op_end()-2));
Ops.push_back(*(LHS.Val->op_end()-1)); if (Ops.size() == LHS.getNumOperands()-2) {
return DAG.getNode(ISD::VBUILD_VECTOR, MVT::Vector, Ops); Ops.push_back(*(LHS.Val->op_end()-2));
Ops.push_back(*(LHS.Val->op_end()-1));
return DAG.getNode(ISD::VBUILD_VECTOR, MVT::Vector, Ops);
}
} }
return SDOperand(); return SDOperand();