Hi,
> 
> We can look into this. We do compare manually the IR dumps from both and it 
> is not ideal.
> What we should do is an additional (optional) pass that runs after 
> auto-profile to compare the annotations 
> using the profile-use. We will have to filter out any functions/path that 
> runs less than a threshold to reduce noise.
> Functions that are fully inlined are also not having any profile. 

With -fprofile-use there is already logic to compare static profile
prediction heuristics with the real data.  This is implemented by
running static profile predictor whithin profile pass if 
-fdump-ipa-profile-details is enabled and dump staistics which can be
then summarized by contrib/analyze_brprob.py pass.

We could use same strategy here.
combine_predictions_for_bb can dump banch probabilities with AFDO
quality as a fake predictor which will give us idea about coverage of
AFDO data and its quality.

We probably want to compare the AFDO counts to real counts and quantify
how far are from precise data.  I would start by remembering info about
basic blocks being hot/cold by AFDO and dumping info when real data show
that block is hot even if count is divided say by 1000 and AFDO still
marked it cold.  
Grepping the dump file can then point us to most important profile
problems.  Eventually we can get something more fancy...

With -fno-auto-profile-inlining it should be possible to produce two
binaries.  One with -g for auto-profile and one with -fprofile-generate
and then load both profiles to the compiler with -fauto-profile=xxx 
-fprofile-use
I think in this case read FDO should just overwrite auto-profile giving
us place to dump stats.

Honza
> 
> Thanks,
> Kugan
>  
> 
> > 
> > Honza
> 
> 

Reply via email to