This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix part of PR33928


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]