This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Sharing hard registers
- From: "David S. Miller" <davem at redhat dot com>
- To: law at redhat dot com
- Cc: jh at suse dot cz, apl at alum dot mit dot edu, echristo at redhat dot com, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Jun 2002 03:21:25 -0700 (PDT)
- Subject: Re: Sharing hard registers
- References: <20020614.030603.82192502.davem@redhat.com><3917.1024050239@porcupine.cygnus.com>
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.