summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-26 11:16:17 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-26 11:16:17 +0000
commit9148c5d5495a25e8479f6a58e57f7058da1b4871 (patch)
treee2e727a241af38d07539999664fb5cbfbec089a2 /lib
parentfb5e6804f3aca40c78d88d6810ad22853816ae06 (diff)
downloadllvm-9148c5d5495a25e8479f6a58e57f7058da1b4871.tar.gz
llvm-9148c5d5495a25e8479f6a58e57f7058da1b4871.tar.bz2
llvm-9148c5d5495a25e8479f6a58e57f7058da1b4871.tar.xz
Merging r195343:
------------------------------------------------------------------------ r195343 | dsanders | 2013-11-21 03:40:14 -0800 (Thu, 21 Nov 2013) | 5 lines [mips][msa/dsp] Only do DSP combines if DSP is enabled. Fixes a crash (null pointer dereferenced) when MSA is enabled. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Mips/MipsSEISelLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsSEISelLowering.cpp b/lib/Target/Mips/MipsSEISelLowering.cpp
index eb9656acae..274cdc1f89 100644
--- a/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -751,6 +751,9 @@ static SDValue performDSPShiftCombine(unsigned Opc, SDNode *N, EVT Ty,
unsigned EltSize = Ty.getVectorElementType().getSizeInBits();
BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(N->getOperand(1));
+ if (!Subtarget->hasDSP())
+ return SDValue();
+
if (!BV ||
!BV->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
EltSize, !Subtarget->isLittle()) ||