aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-31 20:13:26 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-31 20:13:26 +0000
commitfcd75e5efb482f35cfc22fd4b64e047930130fd6 (patch)
tree334fe23a6a17c7ab3e0ac5f23db117b64a5f64f8 /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
parentd84192fe4f6495e43ee0ff2ac591c14ba36e1e9d (diff)
Misc cleanup; addresses Duncan's comments on r138877.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index af4f356652..04f6642c94 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -948,21 +948,22 @@ bool DAGTypeLegalizer::CustomWidenLowerNode(SDNode *N, EVT VT) {
SDValue DAGTypeLegalizer::DecomposeMERGE_VALUES(SDNode *N) {
unsigned i;
- // A MERGE_VALUES node can produce any number of values.
- // We know that the first illegal type needs to be handled.
+ // A MERGE_VALUES node can produce any number of values.
+ // Replace the results other than the first illegal one with the
+ // corresponding input operands.
for (i = 0; isTypeLegal(N->getValueType(i)); ++i)
ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i)));
- // The first illegal result must be the one that needs to be handled.
- SDValue BadValue = N->getOperand(i);
+ // The first illegal result is the one which needs to be handled;
+ // type legalization legalizes values in order.
+ SDValue IllegalValue = N->getOperand(i);
- // Legalize the rest of the results into the input operands whether they
- // are legal or not.
+ // Continue replacing results.
unsigned e = N->getNumValues();
for (++i; i != e; ++i)
ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i)));
- return BadValue;
+ return IllegalValue;
}
/// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a type