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 | 0e94e91f8140a123512e7a658fcd9f54c7758c48 (patch) | |
tree | 965967fe13c76c4c1326fb2e1ec829e260ff8501 /lib/CodeGen | |
parent | e8c1cee8fd482ef5d3a9eb3f4dd2dcdc87c6c9c0 (diff) | |
download | external_llvm-0e94e91f8140a123512e7a658fcd9f54c7758c48.tar.gz external_llvm-0e94e91f8140a123512e7a658fcd9f54c7758c48.tar.bz2 external_llvm-0e94e91f8140a123512e7a658fcd9f54c7758c48.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 886e726408..71560fe2ae 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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; } |