diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-11-21 11:40:14 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-11-21 11:40:14 +0000 |
commit | 001a93bbcb12823df7e85957819f1f73f762244b (patch) | |
tree | 3d7a315c730a2a85b1c61969e258b4c7a47fa52e /lib/Target/Mips/MipsSEISelLowering.cpp | |
parent | ae89383daa64d4bce7facda54ba5a04a12b801a8 (diff) | |
download | llvm-001a93bbcb12823df7e85957819f1f73f762244b.tar.gz llvm-001a93bbcb12823df7e85957819f1f73f762244b.tar.bz2 llvm-001a93bbcb12823df7e85957819f1f73f762244b.tar.xz |
[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/trunk@195343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsSEISelLowering.cpp')
-rw-r--r-- | lib/Target/Mips/MipsSEISelLowering.cpp | 3 |
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()) || |