diff options
author | Craig Topper <craig.topper@intel.com> | 2017-11-17 07:03:57 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-11-17 07:03:57 +0000 |
commit | e9a6456ab3b6e39b3203e39ca64a8031db9c28cd (patch) | |
tree | 23d5360a5e0f5fc5ca4f7d0706f26203f3426c6c /llvm/lib/CodeGen | |
parent | 1ac6e8ae61cfaa5729284e4707b51d30f4a390e1 (diff) | |
download | bcm5719-llvm-e9a6456ab3b6e39b3203e39ca64a8031db9c28cd.tar.gz bcm5719-llvm-e9a6456ab3b6e39b3203e39ca64a8031db9c28cd.zip |
[SelectionDAG] Allow custom vector widening through ReplaceNodeResults to handle nodes with chain outputs.
Previously we were assuming all results were vectors and calling SetWidenedVector, but if its a chain result we should just replace uses instead.
This fixes an error found by expensive checks after r318368.
llvm-svn: 318509
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index 73e29969a21..85154ffb14d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -1027,8 +1027,13 @@ bool DAGTypeLegalizer::CustomWidenLowerNode(SDNode *N, EVT VT) { // Update the widening map. assert(Results.size() == N->getNumValues() && "Custom lowering returned the wrong number of results!"); - for (unsigned i = 0, e = Results.size(); i != e; ++i) - SetWidenedVector(SDValue(N, i), Results[i]); + for (unsigned i = 0, e = Results.size(); i != e; ++i) { + // If this is a chain output just replace it. + if (Results[i].getValueType() == MVT::Other) + ReplaceValueWith(SDValue(N, i), Results[i]); + else + SetWidenedVector(SDValue(N, i), Results[i]); + } return true; } |