find_mem_givs SMALL_REGISTER_CLASSES patch

Jeffrey A Law law@cygnus.com
Sun Jun 28 19:15:00 GMT 1998


  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



More information about the Gcc-patches mailing list