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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 13:20:57 PST 2018


davidxl added inline comments.


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:63
   uint32_t Hotness : 3;
   uint32_t RelBlockFreq : 29;
+  static constexpr int32_t ScaleShift = 8;
----------------
Document that it is RelativeBlockFrequency scaled by 2^8

Also should all the uses of RelBlockFreq scale it back?


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:65
+  static constexpr int32_t ScaleShift = 8;
   static constexpr uint64_t MaxRelBlockFreq = (1 << 29) - 1;
 
----------------
Should this be scaled up too?


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:86
+    Scaled64 Temp(BlockFreq, ScaleShift);
+    Temp /= Scaled64::get(EntryFreq);
+
----------------
EntryFreq can be zero.


Repository:
  rL LLVM

https://reviews.llvm.org/D43520





More information about the llvm-commits mailing list