diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-04-22 19:58:23 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-04-22 19:58:23 +0000 |
commit | 0d6964cf4af190a8dc11307e0e720b12abdf85c6 (patch) | |
tree | b2864749a08855f53190a233ff87150857c7a939 /llvm/lib/Target/Mips/MipsSEISelLowering.cpp | |
parent | 09a3912b5c0d30128f626a88096ddb3ce9404023 (diff) | |
download | bcm5719-llvm-0d6964cf4af190a8dc11307e0e720b12abdf85c6.tar.gz bcm5719-llvm-0d6964cf4af190a8dc11307e0e720b12abdf85c6.zip |
[mips] In performDSPShiftCombine, check that all elements in the vector are
shifted by the same amount and the shift amount is smaller than the element
size.
llvm-svn: 180039
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSEISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp index ca911f03dd1..23d2578b074 100644 --- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -327,9 +327,11 @@ static SDValue performDSPShiftCombine(unsigned Opc, SDNode *N, EVT Ty, unsigned EltSize = Ty.getVectorElementType().getSizeInBits(); BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(N->getOperand(1)); - if (!BV || !BV->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, - HasAnyUndefs, EltSize, - !Subtarget->isLittle())) + if (!BV || + !BV->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs, EltSize, + !Subtarget->isLittle()) || + (SplatBitSize != EltSize) || + !isUIntN(Log2_32(EltSize), SplatValue.getZExtValue())) return SDValue(); return DAG.getNode(Opc, N->getDebugLoc(), Ty, N->getOperand(0), |