[PATCH] D43520: [ThinLTO] Represent relative BF using a scaled representation .

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 12:35:31 PST 2018


eraman added inline comments.


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:65
+  static constexpr int32_t ScaleShift = 8;
   static constexpr uint64_t MaxRelBlockFreq = (1 << 29) - 1;
 
----------------
davidxl wrote:
> eraman wrote:
> > davidxl wrote:
> > > Should this be scaled up too?
> > No, this is just the max value of the digits in the 29 bit bit-field. 
> then the 'min' function here    Sum = std::min(Sum, uint64_t(MaxRelBlockFreq)); should use a scaled MaxRelBlockFreq, right?
No. The intent is to use a max of 29 bits including the integer and decimal(fractional) bits. Since I use a scale of 8, 8 bits will be used to represent values below 1 and I can use only 21 bits to represent the integral part. 


Repository:
  rL LLVM

https://reviews.llvm.org/D43520





More information about the llvm-commits mailing list