diff options
author | Michael Matz <matzmich@cs.tu-berlin.de> | 2000-11-30 21:40:33 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-11-30 13:40:33 -0800 |
commit | 25e4379fe54884cd49f653bc97ddf98f89d8c796 (patch) | |
tree | 85bc1efd0f69f6554f716ba134eaafceffa2538b /gcc/local-alloc.c | |
parent | 41c395330242369ea5d33c544ad41f8833df782c (diff) | |
download | gcc-25e4379fe54884cd49f653bc97ddf98f89d8c796.zip gcc-25e4379fe54884cd49f653bc97ddf98f89d8c796.tar.gz gcc-25e4379fe54884cd49f653bc97ddf98f89d8c796.tar.bz2 |
flow.c (make_edge): Early out, if no flags to set.
* flow.c (make_edge): Early out, if no flags to set.
(calculate_global_regs_live): Clear out garbage only when necessary.
* simplify-rtx.c (varray_type used_regs): New.
(clear_table): Use it to only clear necessary items.
(cselib_lookup, cselib_record_set): Remember newly set items.
(cselib_update_varray_sizes, cselib_init): Initialize and grow
used_regs.
* local-alloc.c (update_equiv_regs): New local `cleared_regs'.
Move clearing of dead regs out of insn-loop.
From-SVN: r37899
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r-- | gcc/local-alloc.c | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index ac2183e..62142f0 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -804,8 +804,11 @@ update_equiv_regs () rtx insn; int block; int loop_depth; + regset_head cleared_regs; + int clear_regnos = 0; reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv); + INIT_REG_SET (&cleared_regs); init_alias_analysis (); @@ -1135,7 +1138,6 @@ update_equiv_regs () INSN. Update the flow information. */ else if (PREV_INSN (insn) != equiv_insn) { - int l; rtx new_insn; new_insn = emit_insn_before (copy_rtx (PATTERN (equiv_insn)), @@ -1156,22 +1158,43 @@ update_equiv_regs () if (block >= 0 && insn == BLOCK_HEAD (block)) BLOCK_HEAD (block) = PREV_INSN (insn); - for (l = 0; l < n_basic_blocks; l++) - { - CLEAR_REGNO_REG_SET ( - BASIC_BLOCK (l)->global_live_at_start, - regno); - CLEAR_REGNO_REG_SET ( - BASIC_BLOCK (l)->global_live_at_end, - regno); - } + /* Remember to clear REGNO from all basic block's live + info. */ + SET_REGNO_REG_SET (&cleared_regs, regno); + clear_regnos++; } } } } + /* Clear all dead REGNOs from all basic block's live info. */ + if (clear_regnos) + { + int j, l; + if (clear_regnos > 8) + { + for (l = 0; l < n_basic_blocks; l++) + { + AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_start, + &cleared_regs); + AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_end, + &cleared_regs); + } + } + else + EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j, + { + for (l = 0; l < n_basic_blocks; l++) + { + CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_start, j); + CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_end, j); + } + }); + } + /* Clean up. */ end_alias_analysis (); + CLEAR_REG_SET (&cleared_regs); free (reg_equiv); } |