]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement flat loop profile detection
authorJan Hubicka <jh@suse.cz>
Fri, 21 Jul 2023 15:34:31 +0000 (17:34 +0200)
committerJan Hubicka <jh@suse.cz>
Fri, 21 Jul 2023 15:34:31 +0000 (17:34 +0200)
commitea272814c23d2b88dc846b225c041594ae6be3e3
treee59541c8aa7fd3a0a96692c626cc2bfe037aac88
parent3291f9e6cba2ea6a170ba4fc7ddbb57218d3f9f6
Implement flat loop profile detection

This patch adds maybe_flat_loop_profile which can be used in loop profile udpate
to detect situation where the profile may be unrealistically flat and should
not be dwonscalled after vectorizing, unrolling and other transforms that
assume that loop has high iteration count even if the CFG profile says
otherwise.

Profile is flat if it was statically detected and at that time we had
no idea about actual number of iterations or we artificially capped them.
So the function considers flat all profiles that have guessed or lower
reliability in their count and there is no nb_iteration_bounds/estimate
which would prove that the profile iteration count is high enough.

gcc/ChangeLog:

* cfgloop.h (maybe_flat_loop_profile): Declare
* cfgloopanal.cc (maybe_flat_loop_profile): New function.
* tree-cfg.cc (print_loop_info): Print info about flat profiles.
gcc/cfgloop.h
gcc/cfgloopanal.cc
gcc/tree-cfg.cc