diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-03 17:21:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-03 17:21:50 +0000 |
commit | 04c00fc844cfd3cb7df176d8251371ac5d0d7f2e (patch) | |
tree | dd529e9a35ae54dce983f5b9782a816af74bd1aa /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | d97f0389723a5aafafce5f1fddfc73206df7610f (diff) | |
download | bcm5719-llvm-04c00fc844cfd3cb7df176d8251371ac5d0d7f2e.tar.gz bcm5719-llvm-04c00fc844cfd3cb7df176d8251371ac5d0d7f2e.zip |
Add a missing check, which broke a bunch of vector tests.
llvm-svn: 27374
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5742aef6842..aacee99ed99 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2756,9 +2756,12 @@ SDOperand DAGCombiner::visitVBinOp(SDNode *N, ISD::NodeType IntOp, Ops.back().getOpcode() == ISD::ConstantFP) && "Scalar binop didn't fold!"); } - 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); + + if (Ops.size() == LHS.getNumOperands()-2) { + 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(); |