This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: find_mem_givs SMALL_REGISTER_CLASSES patch
- To: john at feith dot com (John Wehle)
- Subject: Re: find_mem_givs SMALL_REGISTER_CLASSES patch
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 28 Jun 1998 20:11:16 -0600
- cc: toon at moene dot indiv dot nluug dot nl, egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199806282219.SAA24498@jwlab.FEITH.COM>you write:
> > Basically, your patch wouldn't do the right thing on my m68k [if it
> > defined SMALL_REGISTER_CLASSES] in most of the cases. The reason
> > for this is that on the m68k, complicated addressing modes are
> > expensive, and post-increment addressing is free.
>
> Is the m68k likely to define SMALL_REGISTER_CLASSES? :-) In any event
> you raise a good point, though wouldn't the machine description be
> set up to discourage the use of a complicated addressing mode if it
> was expensive?
It's not that simple. :-)
Yes, the machine needs to specify that certain addressing modes are more
expensive than others. However, using those modes may (or may not) be a
win depending on other factors (register pressure in particular) and
whether or not exposing the complicated expression creates combinable
givs (or exposes common subexpressions for elimination by cse2).
> This goes right to the central questions of:
>
> 1) Do I have enough registers?
Right. And there's no good way to determine this in loop.
About the best you could do would be to estimate how many registers
a loop needs, then throttle creation of too many loop invariants
based on the computed register pressure. I suspect we'll need to
do something along these lines one day.
jeff