aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-07-30 19:09:17 +0000
committerDan Gohman <gohman@apple.com>2007-07-30 19:09:17 +0000
commitbe444ed6dbc2a6f36feab84b527a21aa0df9f808 (patch)
tree32e7ca71cbd644ba0e8354d9c7432f71b44f82aa /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent45c8388e2a94502ded17dc493fe3fb10b04ce439 (diff)
Fix a bug in getCopyFromParts turned up in the testcase for PR1132.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index ce09eb4f48..39535f1d1a 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/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