Use isIntN and isUIntN to check for valid signed/unsigned numbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142395 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bob Wilson 2011-10-18 18:46:49 +00:00
parent 7f5f0dae33
commit 9d45de252c

View File

@ -4526,11 +4526,10 @@ static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG,
unsigned EltSize = VT.getVectorElementType().getSizeInBits();
unsigned HalfSize = EltSize / 2;
if (isSigned) {
int64_t SExtVal = C->getSExtValue();
if (SExtVal != SExtVal << (64 - HalfSize) >> (64 - HalfSize))
if (!isIntN(HalfSize, C->getSExtValue()))
return false;
} else {
if ((C->getZExtValue() >> HalfSize) != 0)
if (!isUIntN(HalfSize, C->getZExtValue()))
return false;
}
continue;