[PATCH] D32451: Improve profile-guided heuristics to use estimated trip count.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 14:31:06 PDT 2017


Ayal added a comment.

In https://reviews.llvm.org/D32451#752865, @twoh wrote:

> I don't have a strong opinion about treating static trip count and profile-based trip count or not. I treated them separately because existing implementation sets OptForSize to true instead of returning false when it makes a profile-based decision. It would be great if someone can explain the reason behind that.


A similar OptForSize constraint appears in MachineBlockPlacement:

  // If the block is cold relative to the function entry don't waste space
  // aligning it.

You may want to take a look at revision 200294 and discussion thread http://lists.llvm.org/pipermail/llvm-dev/2014-February/069932.html

> @Ayal Yes, 'LoopEntryFreq < ColdEntryFreq' criteria kicks in if the loop latch has no associated frequencies but the function entry and loop preheader do. I actually observed such case in one of our internal code because loop transformations mess up the branch profile info. However, although I kept the criteria, I'm not sure about the effectiveness of that criteria as I wrote in the summary. Maybe we keep the criteria but modify it to 'LoopEntryFreq == 0' to disable vectorization for obviously cold loops.

It would probably be best to fix the messed-up branch-profile info. This also relates to your observations analyzing Video-SIMDBench. Could you provide reproducer(s)?


https://reviews.llvm.org/D32451





More information about the llvm-commits mailing list