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 | a4c5d8c6b4e91b880fcd1b8b293f330e3aa198a3 (patch) | |
tree | 25bed167131b846aa724f09016c964c238f79bb0 /lib | |
parent | 03017c75c777a8c039376e3979c58ab642f7887f (diff) | |
download | external_llvm-a4c5d8c6b4e91b880fcd1b8b293f330e3aa198a3.zip external_llvm-a4c5d8c6b4e91b880fcd1b8b293f330e3aa198a3.tar.gz external_llvm-a4c5d8c6b4e91b880fcd1b8b293f330e3aa198a3.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5742aef..aacee99 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/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(); |