[patch] Hash table changes from cxx-conversion branch

Richard Biener richard.guenther@gmail.com
Wed Mar 27 09:38:00 GMT 2013


On Sat, Mar 23, 2013 at 11:36 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> This patch is a consolodation of the hash_table patches to the
> cxx-conversion branch.
>
> Update various hash tables from htab_t to hash_table.
> Modify types and calls to match.

Ugh.  Can you split it up somewhat ... like split target bits away
at least?  Targets may prefer to keep the old hashes for ease of
branch maintainance.

> * config/arm/arm.c'arm_libcall_uses_aapcs_base::libcall_htab
>
> Fold libcall_eq and libcall_hash into new struct libcall_hasher.
>
> * config/ia64/ia64.c'bundle_state_table
>
> Fold bundle_state_hash and bundle_state_eq_p into new struct
> bundle_state_hasher.
>
> * config/mips/mips.c'mips_offset_table
>
> Fold mips_lo_sum_offset_hash and mips_lo_sum_offset_eq into new
> struct mips_lo_sum_offset_hasher.
>
> In mips_reorg_process_insns, change call to for_each_rtx to pass
> a pointer to the hash_table rather than a htab_t.  This change
> requires then dereferencing that pointer in mips_record_lo_sum to
> obtain the hash_table.
>
> * config/sol2.c'solaris_comdat_htab
>
> Fold comdat_hash and comdat_eq into new struct comdat_entry_hasher.
>
> * config/i386/winnt.c'i386_pe_section_type_flags::htab
>
> * config/i386/winnt.c'i386_find_on_wrapper_list::wrappers
>
> Fold wrapper_strcmp into new struct wrapped_symbol_hasher.
>
> * tree-ssa-coalesce.c'coalesce_list_d.list
>
> Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new
> struct coalesce_pair_hasher.
>
> Removed struct coalesce_pair_iterator, as did not meet the hash_table
> iterator interface and it provided no significant code reduction.
> This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR.

Individual bits I looked at follow:

> * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table.
>
> Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new
> struct coalesce_pair_hasher.
>
> Removed struct coalesce_pair_iterator, as did not meet the hash_table
> iterator interface and it provided no significant code reduction.
> This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR.

Ok.

> * statistics.c'statistics_hashes
>
> Fold hash_statistics_eq into new struct stats_counter_hasher.

Ok.

> * hash-table.h'hash_table
>
> Add documentation.
> Add nested class iterator and methods to hash_table.
> Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators.
> Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT.

Ok.

> * tree-ssa-sccvn.c'vn_tables_s.nary
>
> Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher.
> Add typedef vn_nary_op_table_type.
> Add typedef vn_nary_op_iterator_type.
>
> * tree-ssa-sccvn.c'vn_tables_s.phis
>
> Fold vn_phi_hash, free_phi into new struct vn_phi_hasher.
> Add typedef vn_phi_table_type.
> Add typedef vn_phi_iterator_type.
>
> * tree-ssa-sccvn.c'vn_tables_s.references
>
> Fold vn_reference_hash, vn_reference_op_eq, free_reference
>   into new struct vn_reference_hasher.
> Add typedef vn_reference_table_type.
> Add typedef vn_reference_iterator_type.
>
> * tree-ssa-sccvn.c'constant_value_ids
>
> Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher.

Ok.

> * tree-into-ssa.c'var_infos
>
> Fold var_info_hash, var_info_eq into new struct var_info_hasher.

Ok.

> * tree-vectorizer.h'_loop_vec_info::peeling_htab
>
> * tree-vectorizer.h
>
> New struct peel_info_hasher.
>
> * tree-vect-loop.c
>
> Update dependent calls and types to match.
>
> * tree-vect-data-refs.c
>
> Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher.

Ok.

> * tree-ssa-structalias.c'pointer_equiv_class_table
> * tree-ssa-structalias.c'location_equiv_class_table
>
> Fold equiv_class_label_hash and equiv_class_label_eq into new
> struct equiv_class_hasher.
>
> * tree-ssa-structalias.c'shared_bitmap_table
>
> Fold shared_bitmap_hash and shared_bitmap_eq into new struct
> shared_bitmap_hasher.

Ok.

> * tree-ssa-live.c'var_map_base_init::tree_to_index
>
> New struct tree_int_map_hasher.

I think this wants to be generalized - we have the common tree_map/tree_decl_map
and tree_int_map maps in tree.h - those (and its users) should be tackled
in a separate patch by providing common hashtable trails implementations.

> * tree-ssa-reassoc.c'undistribute_ops_list::ctable
>
> Fold oecount_hash and oecount_eq into new struct oecount_hasher.

Ok.

> * tree-ssa-loop-im.c'memory_accesses.refs
>
> Fold memref_hash and memref_eq into new struct mem_ref_hasher.

Ok.

> Remove unused:
>
> htab_t scop::original_pddrs
> SCOP_ORIGINAL_PDDRS
>
> Remove unused:
>
> insert_loop_close_phis
> insert_guard_phis
> debug_ivtype_map
> ivtype_map_elt_info
> new_ivtype_map_elt

Unused function/type removal are obvious changes.

> Remove unused:
> dse.c bitmap clear_alias_sets
> dse.c bitmap disqualified_clear_alias_sets
> dse.c alloc_pool clear_alias_mode_pool
> dse.c dse_step2_spill
> dse.c dse_step5_spill
> graphds.h htab_t graph::indices

See above.

Thanks,
Richard.



More information about the Gcc-patches mailing list