ix86_address_cost

Jan Hubicka jh@suse.cz
Mon Nov 29 01:24:00 GMT 2004


> Hello,
> 
> > > what is the purpose of the following code in ix86_address_cost:
> > > 
> > >   /* More complex memory references are better.  */
> > >   if (parts.disp && parts.disp != const0_rtx)
> > >      cost--;
> > > ?
> > > 
> > > It in effect claims that [reg] is more expensive than [reg - 4].
> > > This leads ivopts to generate pretty weird code; for example on code
> > > of type
> > 
> > The main idea behind this hack is to force CSE to use complex addressing
> > modes (ie if it uses reg-4 instead of reg2, one might hope for that
> > "reg2=reg-4" statement will get dead and elliminated completely).
> > 
> > This would ineed be interesting thing to re-benchmark so we see if it
> > still does any good.
> 
> this seems like a quite terrible way how to persuade CSE to do this.  Would
> not it be better to add this "complicated address" bonus directly in
> CSE, and let address_cost do just what it is supposed to -- compute cost of
> the address?

I would fully agree here if it matters :))

Honza
> 
> Zdenek



More information about the Gcc mailing list