diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-22 20:52:39 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-22 20:52:39 +0000 |
commit | a2c6f0b7da35eadcfafa42e5ad04647c2696fbb4 (patch) | |
tree | 9e698cb3b5286c709642b8db45a05193e856c5fc /gcc/rtlanal.c | |
parent | 0e37e3f07660892f3666527aedcb58c6b7cb5d37 (diff) | |
download | gcc-a2c6f0b7da35eadcfafa42e5ad04647c2696fbb4.tar.gz |
gcc/
* regs.h (end_hard_regno): New function.
(END_HARD_REGNO, END_REGNO): New macros.
(add_to_hard_reg_set): New function.
(remove_from_hard_reg_set): Likewise.
(in_hard_reg_set_p): Likewise.
(overlaps_hard_reg_set_p): Likewise.
* bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p.
(note_btr_set): Use END_HARD_REGNO.
* caller-save.c (setup_save_areas): Use end_hard_regno.
(mark_set_regs): Use END_HARD_REGNO.
(add_stored_regs): Use end_hard_regno.
(mark_referenced_regs): Use add_to_hard_reg_set.
* combine.c (update_table_tick): Use END_REGNO.
(record_value_for_reg): Likewise.
(record_dead_and_set_regs): Likewise.
(get_last_value_validate): Likewise.
(use_crosses_set_p): Likewise.
(reg_dead_at_p_1): Likewise.
(reg_dead_at_p): Likewise.
(mark_used_regs_combine): Use add_to_hard_reg_set.
(move_deaths): Use END_HARD_REGNO.
(reg_bitfield_target_p): Use end_hard_regno.
(distribute_notes): Use END_HARD_REGNO.
* cse.c (mention_regs): Use END_REGNO.
(insert): Use add_to_hard_reg_set.
(invalidate): Use END_HARD_REGNO.
(invalidate_for_call): Likewise.
(exp_equiv_p): Use END_REGNO.
(cse_insn): Likewise.
* cselib.c (cselib_invalidate_regno): Use end_hard_regno.
* df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO.
* df-scan.c (df_ref_record): Use END_HARD_REGNO.
* function.c (keep_stack_depressed): Use end_hard_regno.
* global.c (global_alloc): Use end_hard_regno.
(global_conflicts): Use add_to_hard_reg_set instead of
mark_reg_live_nc.
(find_reg): Likewise.
(mark_reg_store): Likewise.
(mark_reg_conflicts): Likewise.
(mark_reg_death): Use remove_from_hard_reg_set.
(mark_reg_live_nc): Delete.
(set_preference): Use end_hard_regno.
* local-alloc.c (mark_life): Use add_to_hard_reg_set and
remove_from_hard_reg_set.
(post_mark_life): Use add_to_hard_reg_set.
* mode-switching.c (reg_dies): Use remove_from_hard_reg_set.
(reg_becomes_live): Use add_to_hard_reg_set.
* recog.c (reg_fits_class_p): Use in_hard_reg_set_p.
(peep2_find_free_register): Use add_to_hard_reg_set.
* reg-stack.c (convert_regs_exit): Use END_HARD_REGNO.
* regclass.c (record_reg_classes): Use in_hard_reg_set_p.
* regrename.c (note_sets): Use add_to_hard_reg_set.
(clear_dead_regs): Use remove_from_hard_reg_set.
(regrename_optimize): Use add_to_hard_reg_set.
(find_oldest_value_reg): Use in_hard_reg_set_p.
* reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno.
(hard_reg_set_here_p): Use end_hard_regno.
(decompose): Likewise.
(reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO.
(find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno.
* reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set.
(mark_home_live): Use end_hard_regno.
(spill_hard_reg): Likewise.
(clear_reload_reg_in_use): Likewise.
* reorg.c (delete_prior_computation): Use END_REGNO.
* resource.c (update_live_status): Use END_HARD_REGNO.
(mark_referenced_resources): Use add_to_hard_reg_set.
(mark_set_resources): Likewise.
(mark_target_live_regs): Likewise. Use remove_from_hard_reg_set.
* rtlanal.c (refers_to_regno_p): Use END_REGNO.
(reg_overlap_mentioned_p): Likewise.
(dead_or_set_p): Likewise. Use an exclusive upper loop bound.
(covers_regno_no_parallel_p): Use END_REGNO.
(find_regno_note): Likewise.
(find_reg_fusage): Use END_HARD_REGNO.
* stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p.
* var-tracking.c (emit_note_insn_var_location): Use end_hard_regno.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124961 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index ce7018b5987..6a06f30abea 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1233,10 +1233,7 @@ refers_to_regno_p (unsigned int regno, unsigned int endregno, rtx x, && regno >= FIRST_VIRTUAL_REGISTER && regno <= LAST_VIRTUAL_REGISTER) return 1; - return (endregno > x_regno - && regno < x_regno + (x_regno < FIRST_PSEUDO_REGISTER - ? hard_regno_nregs[x_regno][GET_MODE (x)] - : 1)); + return endregno > x_regno && regno < END_REGNO (x); case SUBREG: /* If this is a SUBREG of a hard reg, we can see exactly which @@ -1343,8 +1340,7 @@ reg_overlap_mentioned_p (rtx x, rtx in) case REG: regno = REGNO (x); - endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? hard_regno_nregs[regno][GET_MODE (x)] : 1); + endregno = END_REGNO (x); do_reg: return refers_to_regno_p (regno, endregno, in, (rtx*) 0); @@ -1551,7 +1547,7 @@ note_uses (rtx *pbody, void (*fun) (rtx *, void *), void *data) int dead_or_set_p (rtx insn, rtx x) { - unsigned int regno, last_regno; + unsigned int regno, end_regno; unsigned int i; /* Can't use cc0_rtx below since this file is used by genattrtab.c. */ @@ -1561,10 +1557,8 @@ dead_or_set_p (rtx insn, rtx x) gcc_assert (REG_P (x)); regno = REGNO (x); - last_regno = (regno >= FIRST_PSEUDO_REGISTER ? regno - : regno + hard_regno_nregs[regno][GET_MODE (x)] - 1); - - for (i = regno; i <= last_regno; i++) + end_regno = END_REGNO (x); + for (i = regno; i < end_regno; i++) if (! dead_or_set_regno_p (insn, i)) return 0; @@ -1591,8 +1585,7 @@ covers_regno_no_parallel_p (rtx dest, unsigned int test_regno) return false; regno = REGNO (dest); - endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1 - : regno + hard_regno_nregs[regno][GET_MODE (dest)]); + endregno = END_REGNO (dest); return (test_regno >= regno && test_regno < endregno); } @@ -1713,11 +1706,7 @@ find_regno_note (rtx insn, enum reg_note kind, unsigned int regno) problem here. */ && REG_P (XEXP (link, 0)) && REGNO (XEXP (link, 0)) <= regno - && ((REGNO (XEXP (link, 0)) - + (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1 - : hard_regno_nregs[REGNO (XEXP (link, 0))] - [GET_MODE (XEXP (link, 0))])) - > regno)) + && END_REGNO (XEXP (link, 0)) > regno) return link; return 0; } @@ -1807,8 +1796,7 @@ find_reg_fusage (rtx insn, enum rtx_code code, rtx datum) if (regno < FIRST_PSEUDO_REGISTER) { - unsigned int end_regno - = regno + hard_regno_nregs[regno][GET_MODE (datum)]; + unsigned int end_regno = END_HARD_REGNO (datum); unsigned int i; for (i = regno; i < end_regno; i++) @@ -1837,13 +1825,12 @@ find_regno_fusage (rtx insn, enum rtx_code code, unsigned int regno) for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1)) { - unsigned int regnote; rtx op, reg; if (GET_CODE (op = XEXP (link, 0)) == code && REG_P (reg = XEXP (op, 0)) - && (regnote = REGNO (reg)) <= regno - && regnote + hard_regno_nregs[regnote][GET_MODE (reg)] > regno) + && REGNO (reg) <= regno + && END_HARD_REGNO (reg) > regno) return 1; } |