[llvm] r359764 - [NFC][PowerPC] Return early if the element type is not byte-sized in combineBVOfConsecutiveLoads

Kang Zhang via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 01:15:13 PDT 2019


Author: zhangkang
Date: Thu May  2 01:15:13 2019
New Revision: 359764

URL: http://llvm.org/viewvc/llvm-project?rev=359764&view=rev
Log:
[NFC][PowerPC] Return early if the element type is not byte-sized in combineBVOfConsecutiveLoads

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

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=359764&r1=359763&r2=359764&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu May  2 01:15:13 2019
@@ -12201,6 +12201,11 @@ static SDValue combineBVOfConsecutiveLoa
          "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();




More information about the llvm-commits mailing list