diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1999-12-15 14:57:29 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1999-12-15 14:57:29 +0000 |
commit | 285f3cf09acda794f6e7bba9cb6d5163c94b5af4 (patch) | |
tree | 004232333d701e94fd104742dbd3de8db91043a0 /gcc/reload1.c | |
parent | 4940cd6041eaa51d8a9bb245d7be26ac0b68187d (diff) | |
download | gcc-285f3cf09acda794f6e7bba9cb6d5163c94b5af4.zip gcc-285f3cf09acda794f6e7bba9cb6d5163c94b5af4.tar.gz gcc-285f3cf09acda794f6e7bba9cb6d5163c94b5af4.tar.bz2 |
caller-save.c (insert_one_insn): Returns struct insn_chain *.
* caller-save.c (insert_one_insn): Returns struct insn_chain *.
Handle live_throughout / dead_or_set instead of live_before /
live_after.
(save_call_clobbered_regs): Get register livenessinformation from
chain->live_throughout.
(add_stored_regs): New function.
(insert_restore, insert_save): Add restored / saved registers to
dead_or_set.
* global.c (reg_dies): New parameter chain.
(reg_becomes_live): Third parameter is regs_set now.
Changed all callers.
(reg_dies): New parameter chain. Changed all callers.
(build_insn_chain): Set live_throughout instead of
live_before / live_after.
* reload.h (struct insn_chain): Replace members live_before /
live_after with live_throughout / dead_or_set.
* reload1.c (new_insn_chain): Handle live_throughout / dead_or_set
instead of live_before / live_after.
(maybe_fix_stack_asms, find_reload_regs, finish_spills): Likewise.
(order_regs_for_reload, find_reg, finish_spills): Likewise.
(choose_reload_regs_init): Likewise.
* stupid.c (current_chain, find_clobbered_regs): Delete.
(stupid_life_analysis): Set chain->live_throughout chain->dead_or_set
instead of chain->live_before / chain->live_after.
(mark_hard_ref): New function.
(stupid_mark_refs): Call mark_hard_ref. Clear chain->live_throughout.
From-SVN: r30957
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index bedcebb..dc69085 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -514,8 +514,8 @@ new_insn_chain () { c = (struct insn_chain *) obstack_alloc (&reload_obstack, sizeof (struct insn_chain)); - c->live_before = OBSTACK_ALLOC_REG_SET (&reload_obstack); - c->live_after = OBSTACK_ALLOC_REG_SET (&reload_obstack); + c->live_throughout = OBSTACK_ALLOC_REG_SET (&reload_obstack); + c->dead_or_set = OBSTACK_ALLOC_REG_SET (&reload_obstack); } else { @@ -1295,8 +1295,8 @@ maybe_fix_stack_asms () for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (allowed, i)) { - CLEAR_REGNO_REG_SET (chain->live_before, i); - CLEAR_REGNO_REG_SET (chain->live_after, i); + CLEAR_REGNO_REG_SET (chain->live_throughout, i); + CLEAR_REGNO_REG_SET (chain->dead_or_set, i); } } @@ -1516,8 +1516,8 @@ order_regs_for_reload (chain) /* Test the various reasons why we can't use a register for spilling in this insn. */ if (fixed_regs[i] - || REGNO_REG_SET_P (chain->live_before, i) - || REGNO_REG_SET_P (chain->live_after, i)) + || REGNO_REG_SET_P (chain->live_throughout, i) + || REGNO_REG_SET_P (chain->dead_or_set, i)) SET_HARD_REG_BIT (bad_spill_regs, i); } /* Now find out which pseudos are allocated to it, and update @@ -1525,12 +1525,12 @@ order_regs_for_reload (chain) CLEAR_REG_SET (&pseudos_counted); EXECUTE_IF_SET_IN_REG_SET - (chain->live_before, FIRST_PSEUDO_REGISTER, j, + (chain->live_throughout, FIRST_PSEUDO_REGISTER, j, { count_pseudo (j); }); EXECUTE_IF_SET_IN_REG_SET - (chain->live_after, FIRST_PSEUDO_REGISTER, j, + (chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, { count_pseudo (j); }); @@ -1645,12 +1645,12 @@ find_reg (chain, order, dumpfile) rl->regno = best_reg; EXECUTE_IF_SET_IN_REG_SET - (chain->live_before, FIRST_PSEUDO_REGISTER, j, + (chain->live_throughout, FIRST_PSEUDO_REGISTER, j, { count_spilled_pseudo (best_reg, rl->nregs, j); }); EXECUTE_IF_SET_IN_REG_SET - (chain->live_after, FIRST_PSEUDO_REGISTER, j, + (chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, { count_spilled_pseudo (best_reg, rl->nregs, j); }); @@ -3489,13 +3489,13 @@ finish_spills (global, dumpfile) for (chain = insns_need_reload; chain; chain = chain->next_need_reload) { EXECUTE_IF_SET_IN_REG_SET - (chain->live_before, FIRST_PSEUDO_REGISTER, i, + (chain->live_throughout, FIRST_PSEUDO_REGISTER, i, { ior_hard_reg_set (pseudo_forbidden_regs + i, &chain->used_spill_regs); }); EXECUTE_IF_SET_IN_REG_SET - (chain->live_after, FIRST_PSEUDO_REGISTER, i, + (chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, { ior_hard_reg_set (pseudo_forbidden_regs + i, &chain->used_spill_regs); @@ -3528,22 +3528,22 @@ finish_spills (global, dumpfile) HARD_REG_SET used_by_pseudos; HARD_REG_SET used_by_pseudos2; - AND_COMPL_REG_SET (chain->live_before, &spilled_pseudos); - AND_COMPL_REG_SET (chain->live_after, &spilled_pseudos); + AND_COMPL_REG_SET (chain->live_throughout, &spilled_pseudos); + AND_COMPL_REG_SET (chain->dead_or_set, &spilled_pseudos); /* Mark any unallocated hard regs as available for spills. That makes inheritance work somewhat better. */ if (chain->need_reload) { - REG_SET_TO_HARD_REG_SET (used_by_pseudos, chain->live_before); - REG_SET_TO_HARD_REG_SET (used_by_pseudos2, chain->live_after); + REG_SET_TO_HARD_REG_SET (used_by_pseudos, chain->live_throughout); + REG_SET_TO_HARD_REG_SET (used_by_pseudos2, chain->dead_or_set); IOR_HARD_REG_SET (used_by_pseudos, used_by_pseudos2); /* Save the old value for the sanity test below. */ COPY_HARD_REG_SET (used_by_pseudos2, chain->used_spill_regs); - compute_use_by_pseudos (&used_by_pseudos, chain->live_before); - compute_use_by_pseudos (&used_by_pseudos, chain->live_after); + compute_use_by_pseudos (&used_by_pseudos, chain->live_throughout); + compute_use_by_pseudos (&used_by_pseudos, chain->dead_or_set); COMPL_HARD_REG_SET (chain->used_spill_regs, used_by_pseudos); AND_HARD_REG_SET (chain->used_spill_regs, used_spill_regs); @@ -5033,12 +5033,12 @@ choose_reload_regs_init (chain, save_reload_reg_rtx) CLEAR_HARD_REG_SET (reg_used_in_insn); { HARD_REG_SET tmp; - REG_SET_TO_HARD_REG_SET (tmp, chain->live_before); + REG_SET_TO_HARD_REG_SET (tmp, chain->live_throughout); IOR_HARD_REG_SET (reg_used_in_insn, tmp); - REG_SET_TO_HARD_REG_SET (tmp, chain->live_after); + REG_SET_TO_HARD_REG_SET (tmp, chain->dead_or_set); IOR_HARD_REG_SET (reg_used_in_insn, tmp); - compute_use_by_pseudos (®_used_in_insn, chain->live_before); - compute_use_by_pseudos (®_used_in_insn, chain->live_after); + compute_use_by_pseudos (®_used_in_insn, chain->live_throughout); + compute_use_by_pseudos (®_used_in_insn, chain->dead_or_set); } for (i = 0; i < reload_n_operands; i++) { |