[PATCH] D35149: llvm-profdata: Reduce memory usage by using Error callback rather than member

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 9 19:05:59 PDT 2017


davidxl added inline comments.


================
Comment at: include/llvm/ProfileData/InstrProf.h:585
+  void merge(function_ref<void(instrprof_error)> Warn,
+             InstrProfValueSiteRecord &Input, uint64_t Weight = 1);
   /// Scale up value profile data counts.
----------------
It is better to get rid of the default weight and move Warn to be the last here.


================
Comment at: include/llvm/ProfileData/InstrProf.h:660
   /// \p Weight.
-  void scale(uint64_t Weight);
+  void scale(function_ref<void(instrprof_error)> Warn, uint64_t Weight);
 
----------------
can Warn be moved to the last for this one?


================
Comment at: include/llvm/ProfileData/InstrProf.h:729
   // Scale merged value counts by \p Weight.
-  void mergeValueProfData(uint32_t ValueKind, InstrProfRecord &Src,
+  void mergeValueProfData(function_ref<void(instrprof_error)> Warn,
+                          uint32_t ValueKind, InstrProfRecord &Src,
----------------
Same here


================
Comment at: include/llvm/ProfileData/InstrProf.h:734
   // Scale up value profile data count.
-  void scaleValueProfData(uint32_t ValueKind, uint64_t Weight);
+  void scaleValueProfData(function_ref<void(instrprof_error)> Warn,
+                          uint32_t ValueKind, uint64_t Weight);
----------------
Same here


https://reviews.llvm.org/D35149





More information about the llvm-commits mailing list