mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-14 05:30:25 +08:00
ira.c (pseudo_move_insn): Delete.
gcc/ * ira.c (pseudo_move_insn): Delete. (find_moveable_pseudos): Don't set it. (move_unallocated_pseudos): Use DF_REG_DEF_CHAIN to find the definitions of the original pseudo. Delete all of them. From-SVN: r187582
This commit is contained in:
parent
a7c6c6d64d
commit
a36b270612
@ -1,3 +1,10 @@
|
||||
2012-05-16 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* ira.c (pseudo_move_insn): Delete.
|
||||
(find_moveable_pseudos): Don't set it.
|
||||
(move_unallocated_pseudos): Use DF_REG_DEF_CHAIN to find
|
||||
the definitions of the original pseudo. Delete all of them.
|
||||
|
||||
2012-05-16 Olivier Hainque <hainque@adacore.com>
|
||||
|
||||
* config/rs6000/rs6000-opts.h (enum processor_type): Add
|
||||
|
26
gcc/ira.c
26
gcc/ira.c
@ -3621,9 +3621,6 @@ int first_moveable_pseudo, last_moveable_pseudo;
|
||||
first_moveable_pseudo. */
|
||||
/* The original home register. */
|
||||
static VEC (rtx, heap) *pseudo_replaced_reg;
|
||||
/* The move instruction we added to move the value to its original home
|
||||
register. */
|
||||
static VEC (rtx, heap) *pseudo_move_insn;
|
||||
|
||||
/* Look for instances where we have an instruction that is known to increase
|
||||
register pressure, and whose result is not used immediately. If it is
|
||||
@ -3667,9 +3664,7 @@ find_moveable_pseudos (void)
|
||||
bitmap_initialize (&interesting, 0);
|
||||
|
||||
first_moveable_pseudo = max_regs;
|
||||
VEC_free (rtx, heap, pseudo_move_insn);
|
||||
VEC_free (rtx, heap, pseudo_replaced_reg);
|
||||
VEC_safe_grow (rtx, heap, pseudo_move_insn, max_regs);
|
||||
VEC_safe_grow (rtx, heap, pseudo_replaced_reg, max_regs);
|
||||
|
||||
df_analyze ();
|
||||
@ -3965,10 +3960,8 @@ find_moveable_pseudos (void)
|
||||
if (validate_change (def_insn, DF_REF_LOC (def), newreg, 0))
|
||||
{
|
||||
unsigned nregno = REGNO (newreg);
|
||||
rtx move = emit_insn_before (gen_move_insn (def_reg, newreg),
|
||||
use_insn);
|
||||
emit_insn_before (gen_move_insn (def_reg, newreg), use_insn);
|
||||
nregno -= max_regs;
|
||||
VEC_replace (rtx, pseudo_move_insn, nregno, move);
|
||||
VEC_replace (rtx, pseudo_replaced_reg, nregno, def_reg);
|
||||
}
|
||||
}
|
||||
@ -4011,27 +4004,32 @@ move_unallocated_pseudos (void)
|
||||
for (i = first_moveable_pseudo; i < last_moveable_pseudo; i++)
|
||||
if (reg_renumber[i] < 0)
|
||||
{
|
||||
df_ref def = DF_REG_DEF_CHAIN (i);
|
||||
int idx = i - first_moveable_pseudo;
|
||||
rtx other_reg = VEC_index (rtx, pseudo_replaced_reg, idx);
|
||||
rtx def_insn = DF_REF_INSN (def);
|
||||
rtx move_insn = VEC_index (rtx, pseudo_move_insn, idx);
|
||||
rtx set;
|
||||
rtx def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i));
|
||||
/* The use must follow all definitions of OTHER_REG, so we can
|
||||
insert the new definition immediately after any of them. */
|
||||
df_ref other_def = DF_REG_DEF_CHAIN (REGNO (other_reg));
|
||||
rtx move_insn = DF_REF_INSN (other_def);
|
||||
rtx newinsn = emit_insn_after (PATTERN (def_insn), move_insn);
|
||||
rtx set;
|
||||
int success;
|
||||
|
||||
if (dump_file)
|
||||
fprintf (dump_file, "moving def of %d (insn %d now) ",
|
||||
REGNO (other_reg), INSN_UID (def_insn));
|
||||
|
||||
delete_insn (move_insn);
|
||||
while ((other_def = DF_REG_DEF_CHAIN (REGNO (other_reg))))
|
||||
delete_insn (DF_REF_INSN (other_def));
|
||||
delete_insn (def_insn);
|
||||
|
||||
set = single_set (newinsn);
|
||||
success = validate_change (newinsn, &SET_DEST (set), other_reg, 0);
|
||||
gcc_assert (success);
|
||||
if (dump_file)
|
||||
fprintf (dump_file, " %d) rather than keep unallocated replacement %d\n",
|
||||
INSN_UID (newinsn), i);
|
||||
delete_insn (move_insn);
|
||||
delete_insn (def_insn);
|
||||
SET_REG_N_REFS (i, 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user