[llvm] 0e912e2 - [X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 08:56:14 PST 2020
Author: Simon Pilgrim
Date: 2020-01-07T16:51:10Z
New Revision: 0e912e22b63d413a27596fc4457aec8a0a1af45c
URL: https://github.com/llvm/llvm-project/commit/0e912e22b63d413a27596fc4457aec8a0a1af45c
DIFF: https://github.com/llvm/llvm-project/commit/0e912e22b63d413a27596fc4457aec8a0a1af45c.diff
LOG: [X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 83751666a122..e19e66997711 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)) {
More information about the llvm-commits
mailing list