Sharing hard registers

David S. Miller davem@redhat.com
Fri Jun 14 03:26:00 GMT 2002


   From: law@redhat.com
   Date: Fri, 14 Jun 2002 04:23:59 -0600
   
   The latter is the reason why I think we can make shared hard regs
   work -- the compiler already has to deal with shared hard regs
   after reload.  The only code that should cause us problems is stuff
   generated in the prologue/epilogue expanders by the backend.

Ok.  The one issue is the fact that we can refer to a hard reg in many
different modes (whereas pseudos have a single mode in which they are
referred).

So if we allow hard reg sharing, it would be on a per-mode basis.  To
implement this we could have a table for each hard reg, similar to
some of the stuff you implemented already Jeff.  However, each entry
would be a list of REG objects.  When we try to gen a hard REG we
check the list, if we can't find one for the mode being requested we
allocate one and add it to the list.



More information about the Gcc-patches mailing list