This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix part of PR33928
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Bradley Lucier <lucier at math dot purdue dot edu>
- Date: Thu, 7 May 2009 20:24:16 +0200
- Subject: Re: [PATCH] fix part of PR33928
- References: <4A02FE1A.5090701@gnu.org>
Hi,
> This however causes higher register pressure and less scheduling freedom
> in the remainder of the RTL pipeline. The attached patch distinguishes
> invariant that are cheap addresses and are always used in MEMs, and
> gives a very low per-iteration cost to them.
the patch is ok.
> @@ -992,6 +1004,10 @@ get_inv_cost (struct invariant *inv, int
> inv->stamp = actual_stamp;
>
> (*regs_needed)++;
> + if (inv->cheap_address
> + && inv->def->n_addr_uses == inv->def->n_uses)
> + return;
> +
> (*comp_cost) += inv->cost;
>
> #ifdef STACK_REGS
I think this should be
if (!(inv->cheap_address
&& inv->def->n_addr_uses == inv->def->n_uses))
(*comp_cost) += inv->cost;
(otherwise, we won't compute the costs correctly for the memory
reference in that INV is used, if it is itself invariant),
Zdenek