[PATCH] D36976: [Inliner] Tweak the condition for determining cold callsites.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 12:02:31 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D36976#850558, @eraman wrote:

> Thinking about this a little more, this will end up treating non-cold callsites as cold. As an exmple, consider bar gets inlined to foo. Let entry_freq(foo) = 8, entry_freq(bar) = 8, callsite_freq(foo->bar) = 7. Now, any block in bar with freq == 1 will end up with a frequency of 0 after cloning and will be treated as cold even it's frequency relative to foo's entry is 1/7 which is not cold for the default value of cold-callsite-rel-freq (1/50). Rouding the freuenies while scaling will mitigate this a little bit, but still not sufficient. Need to think more.


I think you'll need to saturate at 1, and if necessary to preserve precision scale the caller up.


https://reviews.llvm.org/D36976





More information about the llvm-commits mailing list