APInt: microoptimize a few methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120912 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2010-12-04 18:05:36 +00:00
parent bd7d2622a2
commit fd6d53fbad
2 changed files with 9 additions and 10 deletions

View File

@ -759,10 +759,6 @@ APInt APInt::getLoBits(unsigned numBits) const {
BitWidth - numBits);
}
bool APInt::isPowerOf2() const {
return (!!*this) && !(*this & (*this - APInt(BitWidth,1)));
}
unsigned APInt::countLeadingZerosSlowCase() const {
// Treat the most significand word differently because it might have
// meaningless bits set beyond the precision.