From: Simon Pilgrim Date: Wed, 10 Jul 2019 12:22:59 +0000 (+0000) Subject: [X86] EltsFromConsecutiveLoads - LDBase is non-null. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d85c02f496e5479bcc41c721518354ec1875778a;p=llvm [X86] EltsFromConsecutiveLoads - LDBase is non-null. NFCI. Don't bother checking for LDBase != null - it should be (and we assert that it is). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365622 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1040cc6ae36..a33bf07cd72 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -7559,6 +7559,7 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef Elts, SDValue EltBase = peekThroughBitcasts(Elts[FirstLoadedElt]); LoadSDNode *LDBase = Loads[FirstLoadedElt]; EVT LDBaseVT = EltBase.getValueType(); + assert(LDBase && "Did not find base load for merging consecutive loads"); // Consecutive loads can contain UNDEFS but not ZERO elements. // Consecutive loads with UNDEFs and ZEROs elements require a @@ -7568,7 +7569,7 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef Elts, for (int i = FirstLoadedElt + 1; i <= LastLoadedElt; ++i) { if (LoadMask[i]) { SDValue Elt = peekThroughBitcasts(Elts[i]); - LoadSDNode* LD = Loads[i]; + LoadSDNode *LD = Loads[i]; if (!DAG.areNonVolatileConsecutiveLoads( LD, LDBase, Elt.getValueType().getStoreSizeInBits() / 8, i - FirstLoadedElt)) { @@ -7595,10 +7596,8 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef Elts, }; // Check if the base load is entirely dereferenceable. - bool IsDereferenceable = - LDBase && - LDBase->getPointerInfo().isDereferenceable( - VT.getSizeInBits() / 8, *DAG.getContext(), DAG.getDataLayout()); + bool IsDereferenceable = LDBase->getPointerInfo().isDereferenceable( + VT.getSizeInBits() / 8, *DAG.getContext(), DAG.getDataLayout()); // LOAD - all consecutive load/undefs (must start/end with a load or be // entirely dereferenceable). If we have found an entire vector of loads and @@ -7608,7 +7607,6 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef Elts, if (FirstLoadedElt == 0 && (LastLoadedElt == (int)(NumElems - 1) || IsDereferenceable) && (IsConsecutiveLoad || IsConsecutiveLoadWithZeros)) { - assert(LDBase && "Did not find base load for merging consecutive loads"); EVT EltVT = LDBase->getValueType(0); // Ensure that the input vector size for the merged loads matches the // cumulative size of the input elements.