From: Kang Zhang Date: Thu, 2 May 2019 08:15:13 +0000 (+0000) Subject: [NFC][PowerPC] Return early if the element type is not byte-sized in combineBVOfConse... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de63356ef336e265a05b48dca1d64f5c3f1a1ba8;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359764 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index f4524fa9846..52e9fc97b3c 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -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();