[X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI.

This commit is contained in:
Simon Pilgrim 2020-01-07 15:52:15 +00:00
parent 46ac6a4dcd
commit 0e912e22b6
1 changed files with 2 additions and 2 deletions

View File

@ -37308,8 +37308,9 @@ static SDValue combineExtractVectorElt(SDNode *N, SelectionDAG &DAG,
EVT VT = N->getValueType(0);
SDLoc dl(InputVector);
bool IsPextr = N->getOpcode() != ISD::EXTRACT_VECTOR_ELT;
unsigned NumSrcElts = SrcVT.getVectorNumElements();
if (CIdx && CIdx->getAPIntValue().uge(SrcVT.getVectorNumElements()))
if (CIdx && CIdx->getAPIntValue().uge(NumSrcElts))
return IsPextr ? DAG.getConstant(0, dl, VT) : DAG.getUNDEF(VT);
// Integer Constant Folding.
@ -37405,7 +37406,6 @@ static SDValue combineExtractVectorElt(SDNode *N, SelectionDAG &DAG,
};
if (all_of(InputVector->uses(), IsBoolExtract) &&
BoolExtracts.size() > 1) {
unsigned NumSrcElts = SrcVT.getVectorNumElements();
EVT BCVT = EVT::getIntegerVT(*DAG.getContext(), NumSrcElts);
if (SDValue BC =
combineBitcastvxi1(DAG, BCVT, InputVector, dl, Subtarget)) {