From: Simon Pilgrim Date: Tue, 7 Jan 2020 15:52:15 +0000 (+0000) Subject: [X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e912e22b63d413a27596fc4457aec8a0a1af45c;p=platform%2Fupstream%2Fllvm.git [X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI. --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 8375166..e19e669 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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)) {