diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-12 21:18:53 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-12 21:18:53 +0000 |
commit | 3870bc4805f4fad63ffd87f6b3202af8ea92b54b (patch) | |
tree | f57032a20fc6a6cdd0495ba2fc5e7cd63346bac1 /llvm/lib/Support | |
parent | 2ff60ca75efe07a59c8a1be2410ee57822ba71a3 (diff) | |
download | bcm5719-llvm-3870bc4805f4fad63ffd87f6b3202af8ea92b54b.tar.gz bcm5719-llvm-3870bc4805f4fad63ffd87f6b3202af8ea92b54b.zip |
Inline a trivial helper function.
llvm-svn: 152577
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index a60bff33063..e5423f153c3 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/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; } } |