projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
016a82b
)
[APInt] Remove unnecessary min with BitWidth from countTrailingOnesSlowCase.
author
Craig Topper
<craig.topper@gmail.com>
Sat, 22 Apr 2017 19:59:11 +0000
(19:59 +0000)
committer
Craig Topper
<craig.topper@gmail.com>
Sat, 22 Apr 2017 19:59:11 +0000
(19:59 +0000)
The unused upper bits are guaranteed to be 0 so we don't need to worry about accidentally counting them.
llvm-svn: 301091
llvm/lib/Support/APInt.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/APInt.cpp
b/llvm/lib/Support/APInt.cpp
index
95b8345
..
9bb364a
100644
(file)
--- 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 {