summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-22 19:59:11 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-22 19:59:11 +0000
commit3a29e3b8e72a050a84fd4acd83ffe4fb0cccfb34 (patch)
tree6aeb332750b4513adef191ad39a45f671a45de2d /llvm/lib/Support
parent016a82ba51d2a3574130423b27ffbdc24326ed5d (diff)
downloadbcm5719-llvm-3a29e3b8e72a050a84fd4acd83ffe4fb0cccfb34.tar.gz
bcm5719-llvm-3a29e3b8e72a050a84fd4acd83ffe4fb0cccfb34.zip
[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
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/APInt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 95b8345b9c6..9bb364af279 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -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 {
OpenPOWER on IntegriCloud