Handle more cases in APInt::getLowBitsSet's fast path.

llvm-svn: 145249
This commit is contained in:
Benjamin Kramer 2011-11-28 16:56:38 +00:00
parent 7372248a98
commit 4c16431a67
1 changed files with 2 additions and 2 deletions

View File

@ -497,8 +497,8 @@ public:
if (loBitsSet == APINT_BITS_PER_WORD)
return APInt(numBits, -1ULL);
// For small values, return quickly.
if (numBits < APINT_BITS_PER_WORD)
return APInt(numBits, (1ULL << loBitsSet) - 1);
if (loBitsSet <= APINT_BITS_PER_WORD)
return APInt(numBits, -1ULL >> (APINT_BITS_PER_WORD - loBitsSet));
return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
}