]> granicus.if.org Git - llvm/commitdiff
[NFC][PowerPC] Return early if the element type is not byte-sized in combineBVOfConse...
authorKang Zhang <shkzhang@cn.ibm.com>
Thu, 2 May 2019 08:15:13 +0000 (08:15 +0000)
committerKang Zhang <shkzhang@cn.ibm.com>
Thu, 2 May 2019 08:15:13 +0000 (08:15 +0000)
Summary:
Based on the Eli Friedman's comments in https://reviews.llvm.org/D60811 , we'd better return early if the element type is not byte-sized in `combineBVOfConsecutiveLoads`.

Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D61076

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

lib/Target/PowerPC/PPCISelLowering.cpp

index f4524fa98462c7972ce0e30c33435f7a54262d13..52e9fc97b3c9ca812b2f3467253c5ed305566da5 100644 (file)
@@ -12201,6 +12201,11 @@ static SDValue combineBVOfConsecutiveLoads(SDNode *N, SelectionDAG &DAG) {
          "Should be called with a BUILD_VECTOR node");
 
   SDLoc dl(N);
+
+  // Return early for non byte-sized type, as they can't be consecutive.
+  if (!N->getValueType(0).getVectorElementType().isByteSized())
+    return SDValue();
+
   bool InputsAreConsecutiveLoads = true;
   bool InputsAreReverseConsecutive = true;
   unsigned ElemSize = N->getValueType(0).getScalarType().getStoreSize();