This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Better estimations of costs in outof-ssa
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Jul 2005 09:05:51 -0700
- Subject: Re: Better estimations of costs in outof-ssa
- References: <20050728072227.GI791@kam.mff.cuni.cz>
On Thu, Jul 28, 2005 at 09:22:27AM +0200, Jan Hubicka wrote:
> ! {
> ! /* Base costs on BB frequencies bounded by 1. */
> ! int cost = EDGE_FREQUENCY (PHI_ARG_EDGE (phi, x));
> !
> ! if (!cost)
> ! cost = 1;
> ! if (optimize_size || !maybe_hot_bb_p (bb))
> ! cost = 1;
> ! /* Inserting copy on critical edge is more costy
> ! than inserting it elsewhere. */
> ! if (EDGE_CRITICAL_P (PHI_ARG_EDGE (phi, x)))
> ! cost *= 2;
> ! add_coalesce (cl, p, p2, cost);
Please factor out this thrice duplicated code.
r~