summaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-03-12 21:18:53 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-03-12 21:18:53 +0000
commita185362095c0a6138216e61d4a767b930bcc7826 (patch)
tree2a6e854f77f2fb78f5e74687d746924b45f07cd9 /lib/Support/APInt.cpp
parentda253ae40f74d9a1cbd43d9992e047be352ce303 (diff)
downloadllvm-a185362095c0a6138216e61d4a767b930bcc7826.tar.gz
llvm-a185362095c0a6138216e61d4a767b930bcc7826.tar.bz2
llvm-a185362095c0a6138216e61d4a767b930bcc7826.tar.xz
Inline a trivial helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index a60bff3306..e5423f153c 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -722,13 +722,9 @@ unsigned APInt::countLeadingZerosSlowCase() const {
return Count;
}
-static unsigned countLeadingOnes_64(uint64_t V, unsigned skip) {
- return CountLeadingOnes_64(V << skip);
-}
-
unsigned APInt::countLeadingOnes() const {
if (isSingleWord())
- return countLeadingOnes_64(VAL, APINT_BITS_PER_WORD - BitWidth);
+ return CountLeadingOnes_64(VAL << (APINT_BITS_PER_WORD - BitWidth));
unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD;
unsigned shift;
@@ -739,13 +735,13 @@ unsigned APInt::countLeadingOnes() const {
shift = APINT_BITS_PER_WORD - highWordBits;
}
int i = getNumWords() - 1;
- unsigned Count = countLeadingOnes_64(pVal[i], shift);
+ unsigned Count = CountLeadingOnes_64(pVal[i] << shift);
if (Count == highWordBits) {
for (i--; i >= 0; --i) {
if (pVal[i] == -1ULL)
Count += APINT_BITS_PER_WORD;
else {
- Count += countLeadingOnes_64(pVal[i], 0);
+ Count += CountLeadingOnes_64(pVal[i]);
break;
}
}