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]

Re: REG_EQUIV/regclass/local-alloc fix


  In message <19991122162934.63539@atrey.karlin.mff.cuni.cz>you write:
  > Hi
  > The reg-class uses REG_EQUIV notes to determine cases, where
  > pseudo (if allocated to register) will require extra cost
  > to load from memory, because it is actually copy of some memory
  > location.
Right.

  > This code is dead now, because REG_EQUIV are set by local-alloc
  > that runs after regclass.
No.  We make REG_EQUIV notes for stack slots which hold incoming parameters,
see function.c.  It is wise to use grep to search for this kind of stuff.

  > Also the code in local-alloc emits
  > some insns, that are not taken into account by reg-class, so
  > worse preferencing might result
Possibly.  But given that I'm not convinced that using register class
preferences is a better allocation heuristic than using weighted refs
it's not clear that this is a problem that is worth solving.

  > (and because I plan to use
  > regclass costs as base for register allocation instead of INSN_N_REFS,
  > it would result in wrong preferences too).
You mean REG_N_REFS here.

I'm not sure if this is a good idea though.  I'd need to see quite a bit
more discussion about the pros and cons of changing the register allocator
to work in this manner.  It would have to include tests on a wider variety of
targets than just the x86, including targets that have large general
register files -- in which case there is little for regclass to do since
everything is just a general register.

The major point behind using REG_N_REFS is to assign registers based on how
often they're likely to be used first -- the more often a pseudo is used the
more we gain by allocating it into a hard register instead of on the stack.


  > After some thinking I've decided to move whole REG_EQUIV stuff from
  > local-alloc to regclass.
I think you need to make a stronger argument that this is either cleaner
or that changing the register allocators to use regclass preferences is
better than weighted use count before we will seriously consider this
patch.

jeff


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