From 529072a6dabbc6002d52f8712804666de58460c2 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 24 Jun 2014 00:26:10 +0000 Subject: [PATCH] BFI: Remove more float-like language from ScaledNumber git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211560 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/BlockFrequencyInfoImpl.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/include/llvm/Analysis/BlockFrequencyInfoImpl.h index 02ffbed83a0..f27f0aa13a6 100644 --- a/include/llvm/Analysis/BlockFrequencyInfoImpl.h +++ b/include/llvm/Analysis/BlockFrequencyInfoImpl.h @@ -146,9 +146,9 @@ public: static ScaledNumber getLargest() { return ScaledNumber(DigitsLimits::max(), ScaledNumbers::MaxScale); } - static ScaledNumber getFloat(uint64_t N) { return adjustToWidth(N, 0); } - static ScaledNumber getInverseFloat(uint64_t N) { - return getFloat(N).invert(); + static ScaledNumber get(uint64_t N) { return adjustToWidth(N, 0); } + static ScaledNumber getInverse(uint64_t N) { + return get(N).invert(); } static ScaledNumber getFraction(DigitsType N, DigitsType D) { return getQuotient(N, D); @@ -293,18 +293,18 @@ public: return ScaledNumbers::compare(Digits, Scale, X.Digits, X.Scale); } int compareTo(uint64_t N) const { - ScaledNumber Float = getFloat(N); - int Compare = compare(Float); + ScaledNumber Scaled = get(N); + int Compare = compare(Scaled); if (Width == 64 || Compare != 0) return Compare; // Check for precision loss. We know *this == RoundTrip. - uint64_t RoundTrip = Float.template toInt(); + uint64_t RoundTrip = Scaled.template toInt(); return N == RoundTrip ? 0 : RoundTrip < N ? -1 : 1; } int compareTo(int64_t N) const { return N < 0 ? 1 : compareTo(uint64_t(N)); } - ScaledNumber &invert() { return *this = ScaledNumber::getFloat(1) / *this; } + ScaledNumber &invert() { return *this = ScaledNumber::get(1) / *this; } ScaledNumber inverse() const { return ScaledNumber(*this).invert(); } private: @@ -390,7 +390,7 @@ SCALED_NUMBER_COMPARE_TO(>= ) template uint64_t ScaledNumber::scale(uint64_t N) const { if (Width == 64 || N <= DigitsLimits::max()) - return (getFloat(N) * *this).template toInt(); + return (get(N) * *this).template toInt(); // Defer to the 64-bit version. return ScaledNumber(Digits, Scale).scale(N);