summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2013-11-21 11:40:14 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2013-11-21 11:40:14 +0000
commit6e664bcef3a5d493eb27ffd9a22ce69cec02b1a5 (patch)
tree8258ce843e5a4643c7db9ece5ef3df90a0e65fa6 /llvm/lib
parentb55c7e7cc4fd2dd8bfc1725953098b072d9f612a (diff)
downloadbcm5719-llvm-6e664bcef3a5d493eb27ffd9a22ce69cec02b1a5.tar.gz
bcm5719-llvm-6e664bcef3a5d493eb27ffd9a22ce69cec02b1a5.zip
[mips][msa/dsp] Only do DSP combines if DSP is enabled.
Fixes a crash (null pointer dereferenced) when MSA is enabled. llvm-svn: 195343
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/MipsSEISelLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
index eb9656acaef..274cdc1f89a 100644
--- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/llvm/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()) ||
OpenPOWER on IntegriCloud