forked from OSchip/llvm-project
[X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI.
This commit is contained in:
parent
46ac6a4dcd
commit
0e912e22b6
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue