diff options
author | Duncan Sands <baldrick@free.fr> | 2011-09-23 13:59:22 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-09-23 13:59:22 +0000 |
commit | 4c19e12d28749c717d3b384962c9ec92796af1c9 (patch) | |
tree | f79e5a716b29b9d20593c80250e4e240a02d9043 /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | |
parent | c56d65f63cd632ef57d9f80b4539f15a2f937364 (diff) | |
download | llvm-4c19e12d28749c717d3b384962c9ec92796af1c9.tar.gz llvm-4c19e12d28749c717d3b384962c9ec92796af1c9.tar.bz2 llvm-4c19e12d28749c717d3b384962c9ec92796af1c9.tar.xz |
Tweak the handling of MERGE_VALUES nodes: remove the need for
DecomposeMERGE_VALUES to "know" that results are legalized in
a particular order, by passing it the number of the result
being legalized (the type legalization core provides this, it
just needs to be passed on).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index 7b566c6e1f..a4bb577433 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -946,24 +946,11 @@ bool DAGTypeLegalizer::CustomWidenLowerNode(SDNode *N, EVT VT) { return true; } -SDValue DAGTypeLegalizer::DecomposeMERGE_VALUES(SDNode *N) { - unsigned i; - // 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 is the one which needs to be handled; - // type legalization legalizes values in order. - SDValue IllegalValue = N->getOperand(i); - - // Continue replacing results. - unsigned e = N->getNumValues(); - for (++i; i != e; ++i) - ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i))); - - return IllegalValue; +SDValue DAGTypeLegalizer::DisintegrateMERGE_VALUES(SDNode *N, unsigned ResNo) { + for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) + if (i != ResNo) + ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i))); + return SDValue(N, ResNo); } /// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a type |