forked from OSchip/llvm-project
[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
This commit is contained in:
parent
585bfc8443
commit
761bb1b53d
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue