diff options
author | Dan Gohman <gohman@apple.com> | 2007-07-30 19:09:17 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-07-30 19:09:17 +0000 |
commit | 4ff9fb14f6730afd60262da01a6176ef51485a58 (patch) | |
tree | 60f4c1ae0b4a6a42b11e000f334a9eff3ae9b84e /llvm/lib/CodeGen/SelectionDAG | |
parent | fedeaa304517b29ef3bb95519c5e8daef5569c73 (diff) | |
download | bcm5719-llvm-4ff9fb14f6730afd60262da01a6176ef51485a58.tar.gz bcm5719-llvm-4ff9fb14f6730afd60262da01a6176ef51485a58.zip |
Fix a bug in getCopyFromParts turned up in the testcase for PR1132.
llvm-svn: 40598
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ce09eb4f487..39535f1d1a1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -695,9 +695,9 @@ static SDOperand getCopyFromParts(SelectionDAG &DAG, } else if (NumParts > 0) { // If the intermediate type was expanded, build the intermediate operands // from the parts. - assert(NumIntermediates % NumParts == 0 && + assert(NumParts % NumIntermediates == 0 && "Must expand into a divisible number of parts!"); - unsigned Factor = NumIntermediates / NumParts; + unsigned Factor = NumParts / NumIntermediates; for (unsigned i = 0; i != NumIntermediates; ++i) Ops[i] = getCopyFromParts(DAG, &Parts[i * Factor], Factor, PartVT, IntermediateVT); @@ -708,7 +708,7 @@ static SDOperand getCopyFromParts(SelectionDAG &DAG, return DAG.getNode(MVT::isVector(IntermediateVT) ? ISD::CONCAT_VECTORS : ISD::BUILD_VECTOR, - ValueVT, &Ops[0], NumParts); + ValueVT, &Ops[0], NumIntermediates); } /// getCopyToParts - Create a series of nodes that contain the |