diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-09-06 06:50:03 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-09-06 06:50:03 +0000 |
| commit | 761bb1b53df9b775a0c081167dd2bc839e9bfd81 (patch) | |
| tree | f9a14c33e3dba991da499e2d36cb78e94603ede2 /llvm/lib/CodeGen | |
| parent | 585bfc844318870ebdb10ff99e4edc20013fe3da (diff) | |
| download | bcm5719-llvm-761bb1b53df9b775a0c081167dd2bc839e9bfd81.tar.gz bcm5719-llvm-761bb1b53df9b775a0c081167dd2bc839e9bfd81.zip | |
[DAGCombiner] When combining EXTRACT_SUBVECTOR of a BUILD_VECTOR, make sure we don't create a BUILD_VECTOR with an illegal type after type legalization.
llvm-svn: 312621
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index ae923e8ac07..c068e1df836 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -15180,8 +15180,9 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode* N) { unsigned NumElems = ExtractSize / EltSize; EVT ExtractVT = EVT::getVectorVT(*DAG.getContext(), InVT.getVectorElementType(), NumElems); - if (!LegalOperations || - TLI.isOperationLegal(ISD::BUILD_VECTOR, ExtractVT)) { + if ((!LegalOperations || + TLI.isOperationLegal(ISD::BUILD_VECTOR, ExtractVT)) && + (!LegalTypes || TLI.isTypeLegal(ExtractVT))) { unsigned IdxVal = (Idx->getZExtValue() * NVT.getScalarSizeInBits()) / EltSize; |

