mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-13 21:05:16 +00:00
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
This commit is contained in:
parent
675e754c61
commit
d344b884dd
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user