diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-11 19:32:35 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-11 19:32:35 +0000 |
commit | 0f90695e31405bffe7fb487183f4d106ee6a1e60 (patch) | |
tree | e5aae4771b669db070df43b7b6522ab7d4cfe110 /llvm/lib/Support/APInt.cpp | |
parent | f6978230b81c9db48829c0017a540a8751b778f9 (diff) | |
download | bcm5719-llvm-0f90695e31405bffe7fb487183f4d106ee6a1e60.tar.gz bcm5719-llvm-0f90695e31405bffe7fb487183f4d106ee6a1e60.zip |
Replace a hand-coded leading one counting loop with the magic from MathExtras.h.
llvm-svn: 152545
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 031bbb88824..a60bff33063 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -723,14 +723,7 @@ unsigned APInt::countLeadingZerosSlowCase() const { } static unsigned countLeadingOnes_64(uint64_t V, unsigned skip) { - unsigned Count = 0; - if (skip) - V <<= skip; - while (V && (V & (1ULL << 63))) { - Count++; - V <<= 1; - } - return Count; + return CountLeadingOnes_64(V << skip); } unsigned APInt::countLeadingOnes() const { |