More profile updating clenaups
commitb278d3080ef23835438ec625b9841c6353c72e32
authorJan Hubicka <jh@suse.cz>
Wed, 2 Aug 2023 07:44:06 +0000 (2 09:44 +0200)
committerJan Hubicka <jh@suse.cz>
Wed, 2 Aug 2023 07:44:06 +0000 (2 09:44 +0200)
tree5a9c532790444ca049d4103f517ec6c174aff610
parent2e93b92c1ec5fbbbe10765c6e059c3c90d564245
More profile updating clenaups

This patch commonizes loop_count_in computatoin with
expected_loop_iterations_by_profile (and moves it to cfgloopanal.cc rather than
manip) and fixes roundoff error in scale_loop_profile.  I alos noticed that
I managed to misapply the template change to gcc.dg/unroll-1.c.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

* cfgloop.h (loop_count_in): Declare.
* cfgloopanal.cc (expected_loop_iterations_by_profile): Use count_in.
(loop_count_in): Move here from ...
* cfgloopmanip.cc (loop_count_in): ... here.
(scale_loop_profile): Improve dumping; cast iteration bound to sreal.

gcc/testsuite/ChangeLog:

* gcc.dg/unroll-1.c: Fix template.
gcc/cfgloop.h
gcc/cfgloopanal.cc
gcc/cfgloopmanip.cc
gcc/testsuite/gcc.dg/unroll-1.c