[PATCH] D22744: CodeExtractor : Add ability to preserve profile data.

River Riddle via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 16:53:00 PDT 2016


rriddle added a comment.




================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:693
@@ +692,3 @@
+  for (auto &Weight : ExitWeights) {
+    if (Weight.second.getFrequency() == 0) {
+      HasValidWeights = false;
----------------
rriddle wrote:
> davidxl wrote:
> > This check does not look correct. It is possible for the frequency to be zero
> Yeah, that was my understanding. Thanks for the sanity check! I need to add the weights without using the current methods given that they do not allow for weights of 0.
Although, can you help clarify on what I should be doing in the case of a 0 frequency? I am unsure on whether the branch weight can be set to a hard 0 or if it needs to be modified to always have a non zero weight? 


https://reviews.llvm.org/D22744





More information about the llvm-commits mailing list