forked from OSchip/llvm-project
[DAGCombiner] In visitINSERT_VECTOR_ELT, move check for BUILD_VECTOR being legal below code that just canonicalizes INSERT_VECTOR_ELT without creating BUILD_VECTORS.
llvm-svn: 294108
This commit is contained in:
parent
e49cdfbeea
commit
ceaf9c1633
|
@ -12777,10 +12777,6 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
|
||||||
|
|
||||||
EVT VT = InVec.getValueType();
|
EVT VT = InVec.getValueType();
|
||||||
|
|
||||||
// If we can't generate a legal BUILD_VECTOR, exit
|
|
||||||
if (LegalOperations && !TLI.isOperationLegal(ISD::BUILD_VECTOR, VT))
|
|
||||||
return SDValue();
|
|
||||||
|
|
||||||
// Check that we know which element is being inserted
|
// Check that we know which element is being inserted
|
||||||
if (!isa<ConstantSDNode>(EltNo))
|
if (!isa<ConstantSDNode>(EltNo))
|
||||||
return SDValue();
|
return SDValue();
|
||||||
|
@ -12807,6 +12803,10 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we can't generate a legal BUILD_VECTOR, exit
|
||||||
|
if (LegalOperations && !TLI.isOperationLegal(ISD::BUILD_VECTOR, VT))
|
||||||
|
return SDValue();
|
||||||
|
|
||||||
// Check that the operand is a BUILD_VECTOR (or UNDEF, which can essentially
|
// Check that the operand is a BUILD_VECTOR (or UNDEF, which can essentially
|
||||||
// be converted to a BUILD_VECTOR). Fill in the Ops vector with the
|
// be converted to a BUILD_VECTOR). Fill in the Ops vector with the
|
||||||
// vector elements.
|
// vector elements.
|
||||||
|
|
Loading…
Reference in New Issue