diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-08-31 18:36:04 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-08-31 18:36:04 +0000 |
commit | 62bb16cfd10dd271eab6c31d982bca4d79138602 (patch) | |
tree | b259a1dfc7a7eafafa519e30aa7fe8da892352ec /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | |
parent | d82175c1f03e6a83b4dbe53f884f72a2441d5c34 (diff) | |
download | llvm-62bb16cfd10dd271eab6c31d982bca4d79138602.tar.gz llvm-62bb16cfd10dd271eab6c31d982bca4d79138602.tar.bz2 llvm-62bb16cfd10dd271eab6c31d982bca4d79138602.tar.xz |
Fill in type legalization for MERGE_VALUES in all the various cases. Patch by Micah Villmow. (No testcase because the issue only showed up in an out-of-tree backend.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index 80f555bde9..af4f356652 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -946,6 +946,25 @@ 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. + // We know that the first illegal type needs to be handled. + 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); + + // Legalize the rest of the results into the input operands whether they + // are legal or not. + unsigned e = N->getNumValues(); + for (++i; i != e; ++i) + ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i))); + + return BadValue; +} + /// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a type /// which is split into two not necessarily identical pieces. void DAGTypeLegalizer::GetSplitDestVTs(EVT InVT, EVT &LoVT, EVT &HiVT) { |