diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-15 07:39:30 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-15 07:39:30 +0000 |
commit | ddc2d0e33079b5cc3680457882d4dc29c66283e2 (patch) | |
tree | c9cc0c7a93ee539a01637eb16e85ac19667e3c9b /gcc/fwprop.c | |
parent | 7b416b3fde3b4bf1f86c6e306aed7849366b5444 (diff) | |
download | gcc-ddc2d0e33079b5cc3680457882d4dc29c66283e2.tar.gz |
gcc/
* df.h (df_mw_hardreg, df_base_ref): Add a link pointer.
(df_insn_info): Turn defs, uses, eq_uses and mw_hardregs into linked
lists.
(df_scan_bb_info): Likewise artificial_defs and artificial_uses.
(DF_REF_NEXT_LOC, DF_MWS_NEXT): New macros.
(FOR_EACH_INSN_INFO_DEF, FOR_EACH_INSN_INFO_USE)
(FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_MW)
(FOR_EACH_ARTIFICIAL_USE, FOR_EACH_ARTIFICIAL_DEF)
(df_get_artificial_defs, df_get_artificial_uses)
(df_single_def, df_single_use): Update accordingly.
(df_refs_chain_dump): Take the first element in a linked list as
parameter, rather than a pointer to an array of pointers.
* df-core.c (df_refs_chain_dump, df_mws_dump): Likewise.
* df-problems.c (df_rd_bb_local_compute_process_def): Likewise.
(df_chain_create_bb_process_use): Likewise.
(df_md_bb_local_compute_process_def): Likewise.
* fwprop.c (process_defs, process_uses): Likewise.
(register_active_defs, update_uses): Likewise.
(forward_propagate_asm): Update for new df_ref linking.
* df-scan.c (df_scan_free_ref_vec, df_scan_free_mws_vec): Delete.
(df_null_ref_rec, df_null_mw_rec): Likewise.
(df_scan_free_internal): Don't free df_ref and df_mw_hardreg lists
explicitly.
(df_scan_free_bb_info): Remove check for null artificial_defs.
(df_install_ref_incremental): Adjust for new df_ref linking.
Use a single-element insertion rather than a full sort.
(df_ref_chain_delete_du_chain): Take the first element
in a linked list as parameter, rather than a pointer to an array of
pointers.
(df_ref_chain_delete, df_mw_hardreg_chain_delete): Likewise.
(df_add_refs_to_table, df_refs_verify, df_mws_verify): Likewise.
(df_insn_info_delete): Remove check for null defs and call to
df_scan_free_mws_vec.
(df_insn_rescan): Initialize df_ref and df_mw_hardreg lists to
null rather than df_null_*_rec.
(df_insn_rescan_debug_internal): Likewise, and update null
checks in the same way. Remove check for null defs.
(df_ref_change_reg_with_loc_1): Fix choice of list for defs.
Move a single element rather doing a full sort.
(df_mw_hardreg_chain_delete_eq_uses): Adjust for new df_mw_hardreg
linking.
(df_notes_rescan): Likewise. Use a merge rather than a full sort.
Initialize df_ref and df_mw_hardreg lists to null rather than
df_null_*_rec.
(df_ref_compare): Take df_refs as parameter, transferring the
old interface to...
(df_ref_ptr_compare): ...this new function.
(df_sort_and_compress_refs): Update accordingly.
(df_mw_compare): Take df_mw_hardregs as parameter, transferring the
old interface to...
(df_mw_ptr_compare): ...this new function.
(df_sort_and_compress_mws): Update accordingly.
(df_install_refs, df_install_mws): Return a linked list rather than
an array of pointers.
(df_refs_add_to_chains): Assert that old lists are empty rather
than freeing them.
(df_insn_refs_verify): Don't handle null defs speciailly.
* web.c (union_match_dups): Update for new df_ref linking.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r-- | gcc/fwprop.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c index eb21d02e36f..a0b9c8b02ca 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -146,10 +146,9 @@ get_def_for_use (df_ref use) (DF_REF_PARTIAL | DF_REF_CONDITIONAL | DF_REF_MAY_CLOBBER) static void -process_defs (df_ref *def_rec, int top_flag) +process_defs (df_ref def, int top_flag) { - df_ref def; - while ((def = *def_rec++) != NULL) + for (; def; def = DF_REF_NEXT_LOC (def)) { df_ref curr_def = reg_defs[DF_REF_REGNO (def)]; unsigned int dregno; @@ -191,10 +190,9 @@ process_defs (df_ref *def_rec, int top_flag) is an artificial use vector. */ static void -process_uses (df_ref *use_rec, int top_flag) +process_uses (df_ref use, int top_flag) { - df_ref use; - while ((use = *use_rec++) != NULL) + for (; use; use = DF_REF_NEXT_LOC (use)) if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == top_flag) { unsigned int uregno = DF_REF_REGNO (use); @@ -849,11 +847,10 @@ static sparseset active_defs_check; too, for checking purposes. */ static void -register_active_defs (df_ref *use_rec) +register_active_defs (df_ref use) { - while (*use_rec) + for (; use; use = DF_REF_NEXT_LOC (use)) { - df_ref use = *use_rec++; df_ref def = get_def_for_use (use); int regno = DF_REF_REGNO (use); @@ -887,11 +884,10 @@ update_df_init (rtx def_insn, rtx insn) in the ACTIVE_DEFS array to match pseudos to their def. */ static inline void -update_uses (df_ref *use_rec) +update_uses (df_ref use) { - while (*use_rec) + for (; use; use = DF_REF_NEXT_LOC (use)) { - df_ref use = *use_rec++; int regno = DF_REF_REGNO (use); /* Set up the use-def chain. */ @@ -1135,7 +1131,7 @@ forward_propagate_asm (df_ref use, rtx def_insn, rtx def_set, rtx reg) { rtx use_insn = DF_REF_INSN (use), src, use_pat, asm_operands, new_rtx, *loc; int speed_p, i; - df_ref *use_vec; + df_ref uses; gcc_assert ((DF_REF_FLAGS (use) & DF_REF_IN_NOTE) == 0); @@ -1144,8 +1140,8 @@ forward_propagate_asm (df_ref use, rtx def_insn, rtx def_set, rtx reg) /* In __asm don't replace if src might need more registers than reg, as that could increase register pressure on the __asm. */ - use_vec = DF_INSN_USES (def_insn); - if (use_vec[0] && use_vec[1]) + uses = DF_INSN_USES (def_insn); + if (uses && DF_REF_NEXT_LOC (uses)) return false; update_df_init (def_insn, use_insn); |