diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-06-15 07:39:30 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-06-15 07:39:30 +0000 |
commit | b512946c8932f373507943fe4d30156a1afd18eb (patch) | |
tree | c9cc0c7a93ee539a01637eb16e85ac19667e3c9b /gcc/web.c | |
parent | 5a474220d931fa67d58c5a1ce0e797b6834ac8f0 (diff) |
df.h (df_mw_hardreg, [...]): Add a link pointer.
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.
From-SVN: r211683
Diffstat (limited to 'gcc/web.c')
-rw-r--r-- | gcc/web.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/gcc/web.c b/gcc/web.c index 029919f8f00..0e9f5da5db5 100644 --- a/gcc/web.c +++ b/gcc/web.c @@ -93,8 +93,8 @@ union_match_dups (rtx insn, struct web_entry *def_entry, bool (*fun) (struct web_entry *, struct web_entry *)) { struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn); - df_ref *use_link = DF_INSN_INFO_USES (insn_info); - df_ref *def_link = DF_INSN_INFO_DEFS (insn_info); + df_ref use_link = DF_INSN_INFO_USES (insn_info); + df_ref def_link = DF_INSN_INFO_DEFS (insn_info); struct web_entry *dup_entry; int i; @@ -104,18 +104,19 @@ union_match_dups (rtx insn, struct web_entry *def_entry, { int op = recog_data.dup_num[i]; enum op_type type = recog_data.operand_type[op]; - df_ref *ref, *dupref; + df_ref ref, dupref; struct web_entry *entry; - for (dup_entry = use_entry, dupref = use_link; *dupref; dupref++) - if (DF_REF_LOC (*dupref) == recog_data.dup_loc[i]) + dup_entry = use_entry; + for (dupref = use_link; dupref; dupref = DF_REF_NEXT_LOC (dupref)) + if (DF_REF_LOC (dupref) == recog_data.dup_loc[i]) break; - if (*dupref == NULL && type == OP_INOUT) + if (dupref == NULL && type == OP_INOUT) { - - for (dup_entry = def_entry, dupref = def_link; *dupref; dupref++) - if (DF_REF_LOC (*dupref) == recog_data.dup_loc[i]) + dup_entry = def_entry; + for (dupref = def_link; dupref; dupref = DF_REF_NEXT_LOC (dupref)) + if (DF_REF_LOC (dupref) == recog_data.dup_loc[i]) break; } /* ??? *DUPREF can still be zero, because when an operand matches @@ -125,35 +126,36 @@ union_match_dups (rtx insn, struct web_entry *def_entry, even though it is there. Example: i686-pc-linux-gnu gcc.c-torture/compile/950607-1.c -O3 -fomit-frame-pointer -funroll-loops */ - if (*dupref == NULL - || DF_REF_REGNO (*dupref) < FIRST_PSEUDO_REGISTER) + if (dupref == NULL + || DF_REF_REGNO (dupref) < FIRST_PSEUDO_REGISTER) continue; ref = type == OP_IN ? use_link : def_link; entry = type == OP_IN ? use_entry : def_entry; - for (; *ref; ref++) + for (; ref; ref = DF_REF_NEXT_LOC (ref)) { - rtx *l = DF_REF_LOC (*ref); + rtx *l = DF_REF_LOC (ref); if (l == recog_data.operand_loc[op]) break; - if (l && DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) + if (l && DF_REF_REAL_LOC (ref) == recog_data.operand_loc[op]) break; } - if (!*ref && type == OP_INOUT) + if (!ref && type == OP_INOUT) { - for (ref = use_link, entry = use_entry; *ref; ref++) + entry = use_entry; + for (ref = use_link; ref; ref = DF_REF_NEXT_LOC (ref)) { - rtx *l = DF_REF_LOC (*ref); + rtx *l = DF_REF_LOC (ref); if (l == recog_data.operand_loc[op]) break; - if (l && DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) + if (l && DF_REF_REAL_LOC (ref) == recog_data.operand_loc[op]) break; } } - gcc_assert (*ref); - (*fun) (dup_entry + DF_REF_ID (*dupref), entry + DF_REF_ID (*ref)); + gcc_assert (ref); + (*fun) (dup_entry + DF_REF_ID (dupref), entry + DF_REF_ID (ref)); } } |