[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2017-04-22 19:59:11 +00:00
parent db0b3ce4eb
commit e14494685b
+2 -1
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 {