1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[APInt] Remove unnecessary min with BitWidth from countTrailingOnesSlowCase.

The unused upper bits are guaranteed to be 0 so we don't need to worry about accidentally counting them.

llvm-svn: 301091
This commit is contained in:
Craig Topper 2017-04-22 19:59:11 +00:00
parent 8f48b8e5d1
commit 0b06a173ec

View File

@ -688,7 +688,8 @@ unsigned APInt::countTrailingOnesSlowCase() const {
Count += APINT_BITS_PER_WORD;
if (i < getNumWords())
Count += llvm::countTrailingOnes(pVal[i]);
return std::min(Count, BitWidth);
assert(Count <= BitWidth);
return Count;
}
unsigned APInt::countPopulationSlowCase() const {