[PATCH] D36025: Do not want to use BFI to get profile count for sample pgo

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 16:36:09 PDT 2017


eraman added a comment.

In https://reviews.llvm.org/D36025#824907, @danielcdh wrote:

> In https://reviews.llvm.org/D36025#824892, @eraman wrote:
>
> > If the profile count based on BFI is completely reliable that you are discarding it, then shouldn't BFI->getProfileCount also return 0 for sampled profiling? I think this can end up in surprising behavior.
>
>
> We only want to do this on callsites, as we still rely on BFI to get other block frequencies.


So, either the BFI based count is usable in sample PGO or not. If it is the latter, I think it should not be used at all. If it is usable (but not very accurate), then there is no harm in using in call.

Do we use the profile count of a non-call instruction anywhere for sample PGO? If we don't, may be assert in BFI->getProfileCount when we use sample PGO? Or alternatively, annotate all call instructions so that you can assert that every call has a metadata (which could be 0)?


https://reviews.llvm.org/D36025





More information about the llvm-commits mailing list