[PATCH] D61076: [NFC][PowerPC] Return early if the element type is not byte-sized in combineBVOfConsecutiveLoads

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 09:50:14 PDT 2019


ZhangKang created this revision.
ZhangKang added reviewers: nemanjai, echristo, steven.zhang, hfinkel, hiraditya, jsji, efriedma.
Herald added a project: LLVM.

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`.


https://reviews.llvm.org/D61076

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -12173,6 +12173,11 @@
          "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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61076.196473.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/34d803a1/attachment.bin>


More information about the llvm-commits mailing list