This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Reload patch v4
- To: Bernd Schmidt <crux at Pool dot Informatik dot RWTH-Aachen dot DE>
- Subject: Re: Reload patch v4
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 14 Oct 1998 11:26:09 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <Pine.SOL.3.90.981008140305.2965D-100000@matula.informatik.rwth-aa
chen.de>you write:
> > Right, but do we see all stores into the spill reg?
>
> forget_old_reloads is called from reload_as_needed for every insn that it
> sees, not just those which need reloads. The situation we are worrying
> about at the moment should always look mostly like this:
It's also called from other places like emit_reload_insns.
> - insn 1 uses hard reg A as reload register; and it's marked as usable for
> inheritance
> - insn 2 stores hard reg A because it was allocated to a pseudo X
> whose lifetime starts here (there _must_ be a store here, since otherwise
> X would be live before this insn, and therefore so would A, and A could
> not have been used as a reload register in insn 1).
> - insn 3 uses hard reg A (for pseudo X); X dies here, which means that after
> this insn, A can again be used as reload reg
> - insn 4 uses hard reg A as reload register, the reloaded value from insn
> 1 would match, but we can't use it because A was used in between as a
> normal hard reg allocated as a pseudo.
Agreed.
> The question is, does the inheritance code notice that insns 2 and 3 make
> A unavailable for reload inheritance in insn 4? To decide that, we need
> to know how insns 2 and 3 will look like during reload_as_needed. Pseudo
> X is allocated to A, that means reg_renumber[X] == A, and alter_reg will
> have been called before reload_as_needed for pseudo X (all the interesting
> calls to alter_reg happen before reload_as_needed; those which happen
> during are only there to improve debugging output a bit).
I mis-read part of the alter_reg code -- I see that we do replace pseudos with
hard regs early enough that we should be basically OK.
> > You might also look at the call in emit_reload_insns -- I don't think
> > we've one register replacements at the time when we call
> > forget_old_reloads_1 from emit_reload_insns.
>
> Sorry, I'm not sure about the terminology. What do you mean by "register
> replacements"? If you mean calls to alter_reg which change those pseudos
> which were lucky into hard regs: those have been done already.
/* Replacing reloads.
If `replace_reloads' is nonzero, then as each reload is recorded
an entry is made for it in the table `replacements'.
Then later `subst_reloads' can look through that table and
perform all the replacements needed. */
/* Nonzero means record the places to replace. */
static int replace_reloads;
/* Each replacement is recorded with a structure like this. */
struct replacement
{
rtx *where; /* Location to store in */
rtx *subreg_loc; /* Location of SUBREG if WHERE is inside
a SUBREG; 0 otherwise. */
int what; /* which reload this is for */
enum machine_mode mode; /* mode it must have */
};
These may or may not be a problem. I just noticed the call and wanted you
to check on it.
jeff