File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
compiler-rt/include/profile
llvm/include/llvm/ProfileData Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -232,14 +232,14 @@ constexpr int MantissaBits = 12;
232232constexpr int ExponentBits = 4 ;
233233constexpr uint16_t MaxMantissa = (1U << MantissaBits) - 1 ;
234234constexpr uint16_t MaxExponent = (1U << ExponentBits) - 1 ;
235+ constexpr uint64_t MaxRepresentableValue = static_cast <uint64_t >(MaxMantissa)
236+ << MaxExponent;
235237
236238// Encodes a 64-bit unsigned integer into a 16-bit scaled integer format.
237239inline uint16_t encodeHistogramCount (uint64_t Count) {
238240 if (Count == 0 )
239241 return 0 ;
240242
241- const uint64_t MaxRepresentableValue = static_cast <uint64_t >(MaxMantissa)
242- << MaxExponent;
243243 if (Count > MaxRepresentableValue)
244244 Count = MaxRepresentableValue;
245245
Original file line number Diff line number Diff line change @@ -232,14 +232,14 @@ constexpr int MantissaBits = 12;
232232constexpr int ExponentBits = 4 ;
233233constexpr uint16_t MaxMantissa = (1U << MantissaBits) - 1 ;
234234constexpr uint16_t MaxExponent = (1U << ExponentBits) - 1 ;
235+ constexpr uint64_t MaxRepresentableValue = static_cast <uint64_t >(MaxMantissa)
236+ << MaxExponent;
235237
236238// Encodes a 64-bit unsigned integer into a 16-bit scaled integer format.
237239inline uint16_t encodeHistogramCount (uint64_t Count) {
238240 if (Count == 0 )
239241 return 0 ;
240242
241- const uint64_t MaxRepresentableValue = static_cast <uint64_t >(MaxMantissa)
242- << MaxExponent;
243243 if (Count > MaxRepresentableValue)
244244 Count = MaxRepresentableValue;
245245
You can’t perform that action at this time.
0 commit comments