diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2009-03-04 17:47:01 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2009-03-04 17:47:01 +0000 |
| commit | 5b15d01ff36a749d839b2ae149a66e91e3fa8ea2 (patch) | |
| tree | 92c9b6146e1e0ed04044fac486d4149fa324bf9f /llvm | |
| parent | 5b9e9682f186ce772de8beb160fc912b60ae5148 (diff) | |
| download | bcm5719-llvm-5b15d01ff36a749d839b2ae149a66e91e3fa8ea2.tar.gz bcm5719-llvm-5b15d01ff36a749d839b2ae149a66e91e3fa8ea2.zip | |
Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.
It is an error to call APInt::zext with a size that is equal to the value's
current size, so use zextOrTrunc instead.
llvm-svn: 66039
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 886e726408c..71560fe2ae6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -5583,9 +5583,9 @@ bool BuildVectorSDNode::isConstantSplat(APInt &SplatValue, if (OpVal.getOpcode() == ISD::UNDEF) SplatUndef |= APInt::getBitsSet(sz, BitPos, BitPos +EltBitSize); else if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal)) - SplatValue |= APInt(CN->getAPIntValue()).zext(sz) << BitPos; + SplatValue |= APInt(CN->getAPIntValue()).zextOrTrunc(sz) << BitPos; else if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(OpVal)) - SplatValue |= CN->getValueAPF().bitcastToAPInt().zext(sz) << BitPos; + SplatValue |= CN->getValueAPF().bitcastToAPInt().zextOrTrunc(sz) <<BitPos; else return false; } |

