[PATCH] D39980: Add heuristics for irreducible loop metadata under PGO

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 16:04:08 PST 2017


davidxl added inline comments.


================
Comment at: include/llvm/Analysis/BlockFrequencyInfoImpl.h:1184
     }
+    // As a heuristic, if some headers don't have a weight, give them the
+    // minimium weight seen. If no headers have a weight, give them even weight
----------------
yamauchi wrote:
> davidxl wrote:
> > What is the intuition behind this heuristic?
> The idea is to not to disrupt the existing trends too much by using a weight that's in the general range of the other headers' weights (eg. don't want to use a weight of 1000000 when the others have weights in the range of 1-10). The average weight, as opposed to the minimum, would also work in that regard. But based on the performance data, the minimum seems to work better. *Maybe* because the average could be off-base if there are major outliers (a few very hot headers) and the cold headers may be more common than warm/hot headers. Added more to the comment.
Perhaps add a // FIXME to for better update in the passes that drop the header weight


https://reviews.llvm.org/D39980





More information about the llvm-commits mailing list