> > However i do not quite follow the old or new logic here. > So if I have only one unknown edge out (or in) from BB and I know > its count, I can determine count of that edge by Kirhoff law. > > But then the old code computes number of edges out of the BB > and if it is only one it updates the count of destinating BB. > I think it should be be testing number of in-edgs of the > destinating bb which seems a bug you are fixing. > (and if it is indeed bug, I think we should fix it first before dealing > with deduplication).
Also I wonder, the code uses POST_DOMINATORS so somewhere it needs to include fake edges for infinite loops and noreturns. Are fake edges still present when annotating edges? If so, we probably want to ignore them. Also it would proably help to check what edges have profile_probabilyt::zero () and profile_probability::always (). Those can come from static profile when we are pretty sure about the outcome (for example, for EH edges or for user annotated cold paths) and unless we have good data from AFDO showing they are wrong, we could trust them similarly to afdo anotations. Honza