[llvm] r365655 - [X86] EltsFromConsecutiveLoads - ensure element reg/store sizes are the same size. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 09:14:26 PDT 2019


Author: rksimon
Date: Wed Jul 10 09:14:26 2019
New Revision: 365655

URL: http://llvm.org/viewvc/llvm-project?rev=365655&view=rev
Log:
[X86] EltsFromConsecutiveLoads - ensure element reg/store sizes are the same size. NFCI.

This renames the type so it doesn't sound like its based off the load size - as we're moving towards supporting combining loads of different sizes.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=365655&r1=365654&r2=365655&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 10 09:14:26 2019
@@ -7562,8 +7562,10 @@ static SDValue EltsFromConsecutiveLoads(
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
   int FirstLoadedElt = LoadMask.countTrailingZeros();
   SDValue EltBase = peekThroughBitcasts(Elts[FirstLoadedElt]);
+  EVT EltBaseVT = EltBase.getValueType();
+  assert(EltBaseVT.getSizeInBits() == EltBaseVT.getStoreSizeInBits() &&
+         "Register/Memory size mismatch");
   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.
@@ -7650,7 +7652,7 @@ static SDValue EltsFromConsecutiveLoads(
     }
   }
 
-  unsigned BaseSize = LDBaseVT.getStoreSizeInBits();
+  unsigned BaseSize = EltBaseVT.getStoreSizeInBits();
   int LoadSize = (1 + LastLoadedElt - FirstLoadedElt) * BaseSize;
 
   // If the upper half of a ymm/zmm load is undef then just load the lower half.
@@ -7702,7 +7704,7 @@ static SDValue EltsFromConsecutiveLoads(
         continue;
 
       bool Match = true;
-      SmallVector<SDValue, 8> RepeatedLoads(SubElems, DAG.getUNDEF(LDBaseVT));
+      SmallVector<SDValue, 8> RepeatedLoads(SubElems, DAG.getUNDEF(EltBaseVT));
       for (unsigned i = 0; i != NumElems && Match; ++i) {
         if (!LoadMask[i])
           continue;




More information about the llvm-commits mailing list