]> granicus.if.org Git - llvm/commitdiff
[X86] EltsFromConsecutiveLoads - ensure element reg/store sizes are the same size...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 10 Jul 2019 16:14:26 +0000 (16:14 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 10 Jul 2019 16:14:26 +0000 (16:14 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365655 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index de556ed8433a7552f76e5ac9b1c652bc3a24a7d3..c5f1234fe92e8a3143c5f2264f819874c728f5f5 100644 (file)
@@ -7562,8 +7562,10 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef<SDValue> Elts,
   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(EVT VT, ArrayRef<SDValue> Elts,
     }
   }
 
-  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(EVT VT, ArrayRef<SDValue> Elts,
         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;