Compare guessed and feedback frequencies during profile feedback stream-in
authorJan Hubicka <jh@suse.cz>
Sun, 28 Nov 2021 18:42:45 +0000 (19:42 +0100)
committerJan Hubicka <jh@suse.cz>
Sun, 28 Nov 2021 18:42:45 +0000 (19:42 +0100)
commit2899d49e3701a4df18a336a680a7095cc99a2229
tree3ffd9e2659002bf30d8c9f7179aa31b3b78f4bf7
parentd1471457fcda26cd24e0053b82f8eed35ddb8727
Compare guessed and feedback frequencies during profile feedback stream-in

This patch adds simple code to dump and compare frequencies of basic blocks
read from the profile feedback and frequencies guessed statically.
It dumps basic blocks in the order of decreasing frequencies from feedback
along with guessed frequencies and histograms.

It makes it to possible spot basic blocks in hot regions that are considered
cold by guessed profile or vice versa.

I am trying to figure out how realistic our profile estimate is compared to
read one on exchange2 (looking again into PR98782.  There IRA now places spills
into hot regions of code while with older (and worse) profile it did not.
Catch is that the function is very large and has 9 nested loops, so it is hard
to figure out how to improve the profile estimate and/or IRA.

gcc/ChangeLog:

2021-11-28  Jan Hubicka  <hubicka@ucw.cz>

* profile.c: Include sreal.h
(struct bb_stats): New.
(cmp_stats): New function.
(compute_branch_probabilities): Output bb stats.
gcc/profile.c