public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Hash table changes from cxx-conversion branch
@ 2013-03-23 22:36 Lawrence Crowl
  2013-03-26 23:53 ` Lawrence Crowl
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-03-23 22:36 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 21397 bytes --]

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.

* 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.

* 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.

* statistics.c'statistics_hashes

Fold hash_statistics_eq into new struct stats_counter_hasher.

* tree-parloops.c'reduction
* tree-parloops.c'name_to_copy

Fold reduction_info_hash and reduction_info_eq into new struct
reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
into new struct name_to_copy_hasher.

* 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.

* 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.

* tree-into-ssa.c'var_infos

Fold var_info_hash, var_info_eq into new struct var_info_hasher.

* var-tracking.c'emit_note_data_def.vars
* var-tracking.c'shared_hash_def.htab
* var-tracking.c'changed_variables

Fold variable_htab_hash, variable_htab_eq, variable_htab_free
  into new struct variable_hasher.
Add typedef variable_table_type.
Add typedef variable_iterator_type.

* trans-mem.c'tm_log

Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.

* trans-mem.c'tm_memopt_value_numbers

Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.

* 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.

* tree-ssa-strlen.c'decl_to_stridxlist_htab

Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.

* tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab

Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
iv_inv_expr_hasher.

* tree-ssa-uncprop.c'equiv

Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.

Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.

Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.

* tree-ssa-phiopt.c'seen_ssa_names

Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.

* 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.

* tree-ssa-live.c'var_map_base_init::tree_to_index

New struct tree_int_map_hasher.

* tree-ssa-reassoc.c'undistribute_ops_list::ctable

Fold oecount_hash and oecount_eq into new struct oecount_hasher.

* tree-ssa-loop-im.c'memory_accesses.refs

Fold memref_hash and memref_eq into new struct mem_ref_hasher.

* tree-sra.c'candidates

Fold uid_decl_map_hash and uid_decl_map_eq into new struct
uid_decl_hasher.  This change moves the definitions from tree-ssa.c
into tree-sra.c and removes the declarations from tree-flow.h

tree-browser.c

Remove stale declaration of removed TB_parent_eq.
Fix template parameter for base class to match value_type.

gimple.h

Use gimplify_hasher::hash rather than gimple_tree_hash in the
  assertion check.
Change return values to match return type. (I.e. no conversions.)

* graphite-clast-to-gimple.c'ivs_params::newivs_index
* graphite-clast-to-gimple.c'ivs_params::params_index
* graphite-clast-to-gimple.c'print_generated_program::params_index
* graphite-clast-to-gimple.c'gloog::newivs_index
* graphite-clast-to-gimple.c'gloog::params_index
* graphite.c graphite_transform_loops::bb_pbb_mapping
* sese.c copy_bb_and_scalar_dependences::rename_map

Move hash table declarations to a new graphite-htab.h, because they
are used in few places.

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

* gimplify.c'gimplify_ctx::temp_htab

Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
gimplify-ctx.h, because they are used few places.

* cselib.c'cselib_hash_table
* gcse.c'pre_ldst_table
* gimple-ssa-strength-reduction.c'base_cand_map
* haifa-sched.c'delay_htab
* haifa-sched.c'delay_htab_i2
* ira-color.c'allocno_hard_regs_htab
* ira-costs.c'cost_classes_htab
* loop-invariant.c'merge_identical_invariants::eq
* loop-iv.c'bivs
* loop-unroll.c'opt_info::insns_to_split
* loop-unroll.c'opt_info::insns_with_var_to_expand
* passes.c'name_to_pass_map
* plugin.c'event_tab
* postreload-gcse.c'expr_table
* store-motion.c'store_motion_mems_table
* tree-cfg.c'discriminator_per_locus
* tree-scalar-evolution.c'resolve_mixers::cache
* tree-ssa-dom.c'avail_exprs

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

* attribs.c'scoped_attributes::attribute_hash
* bitmap.c'bitmap_desc_hash
* dwarf2cfi.c'trace_index
* dwarf2out.c'break_out_includes::cu_hash_table
* dwarf2out.c'copy_decls_for_unworthy_types::decl_table
* dwarf2out.c'optimize_external_refs::map
* dwarf2out.c'output_comp_unit::extern_map
* dwarf2out.c'output_comdat_type_unit::extern_map
* dwarf2out.c'output_macinfo::macinfo_htab
* dwarf2out.c'optimize_location_lists::htab
* dwarf2out.c'dwarf2out_finish::comdat_type_table
* except.c'ehspec_hash_type
* except.c'assign_filter_values::ttypes
* except.c'assign_filter_values::ehspec
* except.c'sjlj_assign_call_site_values::ar_hash
* except.c'convert_to_eh_region_ranges::ar_hash
* trans-mem.c'tm_new_mem_hash
* tree-browser.c'TB_up_ht
* tree-eh.c'finally_tree

Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
in alloc-pool.c to after the method definitions for its parameter
class.

* ggc-common.c'loc_hash
* ggc-common.c'ptr_hash

Add a new hash_table method elements_with_deleted to meet the needs of
gcc-common.c.

Correct many methods with parameter types compare_type to the correct
value_type.  (Correct code was unlikely to notice the change, but
incorrect code will.)

* tree-complex.c'complex_variable_components
* tree-parloops.c'eliminate_local_variables_stmt::decl_address
* tree-parloops.c'separate_decls_in_region::decl_copies

Move hash table declarations to a new tree-hasher.h, to resolve
compilation dependences and because they are used in few places.

* lto-streamer.h'output_block::string_hash_table
* lto-streamer-in.c'file_name_hash_table
* lto-streamer.c'tree_htab

The struct string_slot moves from data-streamer.h to lto-streamer.h to
resolve compilation dependences.


Index: gcc/ChangeLog

2013-03-22  Lawrence Crowl  <crowl@google.com>

	* Makefile.in: Update as needed below.

	* alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash):
	Move declaration to after the type's method definitons.

	* attribs.c (htab_t scoped_attributes::attribute_hash):
	Change type to hash_table.  Update dependent calls and types.

	* bitmap.c (htab_t bitmap_desc_hash):
	Change type to hash_table.  Update dependent calls and types.

	* cselib.c (htab_t cselib_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* data-streamer.h (struct string_slot): Move to lto-streamer.h.
	(hash_string_slot_node): Move implementation into lto-streamer.h
	struct string_slot_hasher.
	(eq_string_slot_node): Likewise.

	* data-streamer-out.c: Update output_block::string_hash_table
	dependent calls and types.

	* dse.c (bitmap clear_alias_sets): Remove unused.
	(bitmap disqualified_clear_alias_sets): Likewise.
	(alloc_pool clear_alias_mode_pool): Likewise.
	(dse_step2_spill): Likewise.
	(dse_step5_spill): Likewise.

	* dwarf2cfi.c (htab_t trace_index):
	Change type to hash_table.  Update dependent calls and types.

	* dwarf2out.c (htab_t break_out_includes::cu_hash_table):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t copy_decls_for_unworthy_types::decl_table): Likewise.
	(htab_t optimize_external_refs::map): Likewise.
	(htab_t output_comp_unit::extern_map): Likewise.
	(htab_t output_comdat_type_unit::extern_map): Likewise.
	(htab_t output_macinfo::macinfo_htab): Likewise.
	(htab_t optimize_location_lists::htab): Likewise.
	(htab_t dwarf2out_finish::comdat_type_table): Likewise.

	* except.c (htab_t ehspec_hash_type):
	Change type to hash_table.  Update dependent calls and types.
	(assign_filter_values::ttypes): Likewise.
	(assign_filter_values::ehspec): Likewise.
	(sjlj_assign_call_site_values::ar_hash): Likewise.
	(convert_to_eh_region_ranges::ar_hash): Likewise.

	* gcse.c (htab_t pre_ldst_table):
	Change type to hash_table.  Update dependent calls and types.

	* ggc-common.c (htab_t saving_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t loc_hash): Likewise.
	(htab_t ptr_hash): Likewise.
	(call_count): Rename ggc_call_count.
	(call_alloc): Rename ggc_call_alloc.
	(loc_descriptor): Rename make_loc_descriptor.
	(add_statistics): Rename ggc_add_statistics.

	* ggc-common.c (saving_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h.
	(push_gimplify_context): Likewise.
	(pop_gimplify_context): Likewise.
	(struct gimple_temp_hash_elt): Added.
	(struct gimplify_hasher): Likewise.
	(struct gimplify_ctx.temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple-fold.c: Include gimplify-ctx.h.

	* gimple-ssa-strength-reduction.c (htab_t base_cand_map):
	Change type to hash_table.  Update dependent calls and types.
	(base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to
	avoid potential global name collision.

	* gimplify.c: Include gimplify-ctx.h.
	(struct gimple_temp_hash_elt): Move to gimplify-ctx.h.
	(htab_t gimplify_ctx::temp_htab):
	Update dependent calls and types for new type hash_table.
	(gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h.
	(gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h.

	* gimplify-ctx.h: New.
	(struct gimple_temp_hash_elt): Move from gimplify.c.
	(class gimplify_hasher): New.
	(struct gimplify_ctx): Move from gimple.h.
	(htab_t gimplify_ctx::temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* graphds.h (htab_t graph::indices): Remove unused.

	* graphite-clast-to-gimple.c: Include graphite-htab.h.
	(htab_t ivs_params::newivs_index):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t ivs_params::params_index): Likewise.
	(htab_t print_generated_program::params_index): Likewise.
	(htab_t gloog::newivs_index): Likewise.
	(htab_t gloog::params_index): Likewise.

	* graphite.c: Include graphite-htab.h.
	(htab_t graphite_transform_loops::bb_pbb_mapping):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h.
	(bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h.
	(eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h.

	* graphite-dependences.c: Include graphite-htab.h.
	(loop_is_parallel_p): Change hash table type of parameter.

	* graphite-htab.h: New.
	(typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New.
	(extern find_pbb_via_hash): Move from graphite-poly.h.
	(extern loop_is_parallel_p): Move from graphite-poly.h.
	(extern get_loop_body_pbbs): Move from graphite-poly.h.

	* graphite-poly.h (htab_t scop::original_pddrs): Remove unused.
	(SCOP_ORIGINAL_PDDRS): Remove unused.
	(extern find_pbb_via_hash): Move to graphite-htab.h.
	(extern loop_is_parallel_p): Move to graphite-htab.h.
	(extern get_loop_body_pbbs): Move to graphite-htab.h.

	* haifa-sched.c (htab_t delay_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t delay_htab_i2): Likewise.

	* hash-table.h (class hash_table):
	Correct many methods with parameter types compare_type to the correct
	value_type.  (Correct code was unlikely to notice the change.)
	(hash_table::elements_with_deleted) New.
	(class hashtable::iterator): New.
	(hashtable::begin()): New.
	(hashtable::end()): New.
	(FOR_EACH_HASH_TABLE_ELEMENT): New.

	* ira-color.c (htab_t allocno_hard_regs_htab):
	Change type to hash_table.  Update dependent calls and types.

	* ira-costs.c (htab_t cost_classes_htab):
	Change type to hash_table.  Update dependent calls and types.

	* loop-invariant.c (htab_t merge_identical_invariants::eq):
	Change type to hash_table.  Update dependent calls and types.

	* loop-iv.c (htab_t bivs):
	Change type to hash_table.  Update dependent calls and types.

	* loop-unroll.c (htab_t opt_info::insns_to_split):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t opt_info::insns_with_var_to_expand): Likewise.

	* lto-streamer.h (struct string_slot): Move from data-streamer.h
	(struct string_slot_hasher): New.
	(htab_t output_block::string_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-in.c (freeing_string_slot_hasher): New.
	(htab_t file_name_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-out.c: Update output_block::string_hash_table dependent
	calls and types.

	* lto-streamer.c (htab_t tree_htab):
	Change type to hash_table.  Update dependent calls and types.

	* omp-low.c: Include gimplify-ctx.h.

	* passes.c (htab_t name_to_pass_map):
	Change type to hash_table.  Update dependent calls and types.
	(pass_traverse): Rename to passes_pass_traverse.

	* plugin.c (htab_t event_tab):
	Change type to hash_table.  Update dependent calls and types.

	* postreload-gcse.c (htab_t expr_table):
	Change type to hash_table.  Update dependent calls and types.
	(dump_hash_table_entry): Rename dump_expr_hash_table_entry.

	* sese.c (debug_rename_map_1): Make extern.
	(debug_ivtype_elt): Remove unused.
	(debug_ivtype_map_1): Remove unused.
	(debug_ivtype_map): Remove unused.
	(ivtype_map_elt_info): Remove unused.
	(eq_ivtype_map_elts): Remove unused.
	(htab_t copy_bb_and_scalar_dependences::rename_map):
	Change type to hash_table.  Update dependent calls and types.

	* sese.h (extern insert_loop_close_phis): Remove unused.
	(extern insert_guard_phis): Remove unused.
	(extern debug_ivtype_map): Remove unused.
	(extern ivtype_map_elt_info): Remove unused.
	(inline new_ivtype_map_elt): Remove unused.
	(extern debug_rename_map): Move to .c file.

	* statistics.c (statistics_hashes):
	Change type to hash_table.  Update dependent calls and types.

	* store-motion.c (htab_t store_motion_mems_table):
	Change type to hash_table.  Update dependent calls and types.

	* trans-mem.c (htab_t tm_new_mem_hash):
	Change type to hash_table.  Update dependent calls and types.

	* tree-browser.c (htab_t TB_up_ht):
	Change type to hash_table.  Update dependent calls and types.

	* tree-cfg.c (htab_t discriminator_per_locus):
	Change type to hash_table.  Update dependent calls and types.

	* tree-complex.c: Include tree-hasher.h
	(htab_t complex_variable_components):
	Change type to hash_table.  Update dependent calls and types.

	* tree-eh.c (htab_t finally_tree):
	Change type to hash_table.  Update dependent calls and types.

	* tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher
	struct int_tree_hasher.
	(extern int_tree_map_eq): Likewise.
	(uid_decl_map_hash): Removed.
	(extern decl_tree_map_eq): Likewise.

	* tree-hasher.h: New.
	(struct int_tree_hasher): New.
	(typedef int_tree_htab_type): New.

	* tree-inline.c: Include gimplify-ctx.h.

	* tree-into-ssa.c (var_infos):
	Change type to hash_table.  Update dependent calls and types.

	* tree-mudflap.c: Include gimplify-ctx.h.

	* tree-parloops.c: Include tree-hasher.h.
	(htab_t eliminate_local_variables_stmt::decl_address):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t separate_decls_in_region::decl_copies): Likewise.

	* tree-scalar-evolution.c (htab_t resolve_mixers::cache):
	Change type to hash_table.  Update dependent calls and types.

	* tree-sra.c (candidates):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher
	in tree-flow.h.
	(int_tree_map_hash): Likewise.

	* tree-ssa-coalesce.c (struct coalesce_list_d.list):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-dom.c (htab_t avail_exprs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-live.c (var_map_base_init::tree_to_index):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-im.c (struct mem_ref.refs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-phiopt.c (seen_ssa_names):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-reassoc.c (undistribute_ops_list::ctable):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-sccvn.c (vn_tables_s::nary):
	Change type to hash_table.  Update dependent calls and types.
	(vn_tables_s::phis): Likewise.
	(vn_tables_s::references): Likewise.

	* tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types.
	(vn_reference_eq): Update parameter and return types.

	* tree-ssa-strlen.c (decl_to_stridxlist_htab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-structalias.c (pointer_equiv_class_table):
	Change type to hash_table.  Update dependent calls and types.
	(location_equiv_class_table): Likewise.

	* tree-ssa-uncprop.c (equiv):
	Change type to hash_table.  Update dependent calls and types.

	* tree-vect-data-refs.c: Consequential changes for making
	peeling a hash_table.

	* tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update.
	(destroy_loop_vec_info): Dependent hash_table update.

	* tree-vectorizer.h (peeling_htab):
	Change type to hash_table.  Update dependent calls and types.

	* var-tracking.c (shared_hash_def::htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/arm/t-arm: Update for below.

	* config/arm/arm.c (arm_libcall_uses_aapcs_base::libcall_htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/i386/t-cygming: Update for below.

	* config/i386/t-interix: Update for below.

	* config/i386/winnt.c (i386_pe_section_type_flags::htab):
	Change type to hash_table.  Update dependent calls and types.
	(i386_find_on_wrapper_list::wrappers): Likewise.

	* config/ia64/t-ia64: Update for below.

	* config/ia64/ia64.c (bundle_state_table):
	Change type to hash_table.  Update dependent calls and types.

	* config/mips/mips.c (mips_reorg_process_insns::htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/sol2.c (solaris_comdat_htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/t-sol2: Update for above.

Patch attached compressed due to size.

-- 
Lawrence Crowl

[-- Attachment #2: patch.gz --]
[-- Type: application/x-gzip, Size: 100626 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-23 22:36 [patch] Hash table changes from cxx-conversion branch Lawrence Crowl
@ 2013-03-26 23:53 ` Lawrence Crowl
  2013-03-27  9:38 ` Richard Biener
  2013-03-27 13:59 ` Martin Jambor
  2 siblings, 0 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-03-26 23:53 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 21426 bytes --]

Merged with head of trunk.


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.

* 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.

* 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.

* statistics.c'statistics_hashes

Fold hash_statistics_eq into new struct stats_counter_hasher.

* tree-parloops.c'reduction
* tree-parloops.c'name_to_copy

Fold reduction_info_hash and reduction_info_eq into new struct
reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
into new struct name_to_copy_hasher.

* 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.

* 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.

* tree-into-ssa.c'var_infos

Fold var_info_hash, var_info_eq into new struct var_info_hasher.

* var-tracking.c'emit_note_data_def.vars
* var-tracking.c'shared_hash_def.htab
* var-tracking.c'changed_variables

Fold variable_htab_hash, variable_htab_eq, variable_htab_free
  into new struct variable_hasher.
Add typedef variable_table_type.
Add typedef variable_iterator_type.

* trans-mem.c'tm_log

Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.

* trans-mem.c'tm_memopt_value_numbers

Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.

* 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.

* tree-ssa-strlen.c'decl_to_stridxlist_htab

Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.

* tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab

Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
iv_inv_expr_hasher.

* tree-ssa-uncprop.c'equiv

Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.

Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.

Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.

* tree-ssa-phiopt.c'seen_ssa_names

Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.

* 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.

* tree-ssa-live.c'var_map_base_init::tree_to_index

New struct tree_int_map_hasher.

* tree-ssa-reassoc.c'undistribute_ops_list::ctable

Fold oecount_hash and oecount_eq into new struct oecount_hasher.

* tree-ssa-loop-im.c'memory_accesses.refs

Fold memref_hash and memref_eq into new struct mem_ref_hasher.

* tree-sra.c'candidates

Fold uid_decl_map_hash and uid_decl_map_eq into new struct
uid_decl_hasher.  This change moves the definitions from tree-ssa.c
into tree-sra.c and removes the declarations from tree-flow.h

tree-browser.c

Remove stale declaration of removed TB_parent_eq.
Fix template parameter for base class to match value_type.

gimple.h

Use gimplify_hasher::hash rather than gimple_tree_hash in the
  assertion check.
Change return values to match return type. (I.e. no conversions.)

* graphite-clast-to-gimple.c'ivs_params::newivs_index
* graphite-clast-to-gimple.c'ivs_params::params_index
* graphite-clast-to-gimple.c'print_generated_program::params_index
* graphite-clast-to-gimple.c'gloog::newivs_index
* graphite-clast-to-gimple.c'gloog::params_index
* graphite.c graphite_transform_loops::bb_pbb_mapping
* sese.c copy_bb_and_scalar_dependences::rename_map

Move hash table declarations to a new graphite-htab.h, because they
are used in few places.

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

* gimplify.c'gimplify_ctx::temp_htab

Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
gimplify-ctx.h, because they are used few places.

* cselib.c'cselib_hash_table
* gcse.c'pre_ldst_table
* gimple-ssa-strength-reduction.c'base_cand_map
* haifa-sched.c'delay_htab
* haifa-sched.c'delay_htab_i2
* ira-color.c'allocno_hard_regs_htab
* ira-costs.c'cost_classes_htab
* loop-invariant.c'merge_identical_invariants::eq
* loop-iv.c'bivs
* loop-unroll.c'opt_info::insns_to_split
* loop-unroll.c'opt_info::insns_with_var_to_expand
* passes.c'name_to_pass_map
* plugin.c'event_tab
* postreload-gcse.c'expr_table
* store-motion.c'store_motion_mems_table
* tree-cfg.c'discriminator_per_locus
* tree-scalar-evolution.c'resolve_mixers::cache
* tree-ssa-dom.c'avail_exprs

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

* attribs.c'scoped_attributes::attribute_hash
* bitmap.c'bitmap_desc_hash
* dwarf2cfi.c'trace_index
* dwarf2out.c'break_out_includes::cu_hash_table
* dwarf2out.c'copy_decls_for_unworthy_types::decl_table
* dwarf2out.c'optimize_external_refs::map
* dwarf2out.c'output_comp_unit::extern_map
* dwarf2out.c'output_comdat_type_unit::extern_map
* dwarf2out.c'output_macinfo::macinfo_htab
* dwarf2out.c'optimize_location_lists::htab
* dwarf2out.c'dwarf2out_finish::comdat_type_table
* except.c'ehspec_hash_type
* except.c'assign_filter_values::ttypes
* except.c'assign_filter_values::ehspec
* except.c'sjlj_assign_call_site_values::ar_hash
* except.c'convert_to_eh_region_ranges::ar_hash
* trans-mem.c'tm_new_mem_hash
* tree-browser.c'TB_up_ht
* tree-eh.c'finally_tree

Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
in alloc-pool.c to after the method definitions for its parameter
class.

* ggc-common.c'loc_hash
* ggc-common.c'ptr_hash

Add a new hash_table method elements_with_deleted to meet the needs of
gcc-common.c.

Correct many methods with parameter types compare_type to the correct
value_type.  (Correct code was unlikely to notice the change, but
incorrect code will.)

* tree-complex.c'complex_variable_components
* tree-parloops.c'eliminate_local_variables_stmt::decl_address
* tree-parloops.c'separate_decls_in_region::decl_copies

Move hash table declarations to a new tree-hasher.h, to resolve
compilation dependences and because they are used in few places.

* lto-streamer.h'output_block::string_hash_table
* lto-streamer-in.c'file_name_hash_table
* lto-streamer.c'tree_htab

The struct string_slot moves from data-streamer.h to lto-streamer.h to
resolve compilation dependences.


Index: gcc/ChangeLog

2013-03-26  Lawrence Crowl  <crowl@google.com>

	* Makefile.in: Update as needed below.

	* alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash):
	Move declaration to after the type's method definitons.

	* attribs.c (htab_t scoped_attributes::attribute_hash):
	Change type to hash_table.  Update dependent calls and types.

	* bitmap.c (htab_t bitmap_desc_hash):
	Change type to hash_table.  Update dependent calls and types.

	* cselib.c (htab_t cselib_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* data-streamer.h (struct string_slot): Move to lto-streamer.h.
	(hash_string_slot_node): Move implementation into lto-streamer.h
	struct string_slot_hasher.
	(eq_string_slot_node): Likewise.

	* data-streamer-out.c: Update output_block::string_hash_table
	dependent calls and types.

	* dse.c (bitmap clear_alias_sets): Remove unused.
	(bitmap disqualified_clear_alias_sets): Likewise.
	(alloc_pool clear_alias_mode_pool): Likewise.
	(dse_step2_spill): Likewise.
	(dse_step5_spill): Likewise.

	* dwarf2cfi.c (htab_t trace_index):
	Change type to hash_table.  Update dependent calls and types.

	* dwarf2out.c (htab_t break_out_includes::cu_hash_table):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t copy_decls_for_unworthy_types::decl_table): Likewise.
	(htab_t optimize_external_refs::map): Likewise.
	(htab_t output_comp_unit::extern_map): Likewise.
	(htab_t output_comdat_type_unit::extern_map): Likewise.
	(htab_t output_macinfo::macinfo_htab): Likewise.
	(htab_t optimize_location_lists::htab): Likewise.
	(htab_t dwarf2out_finish::comdat_type_table): Likewise.

	* except.c (htab_t ehspec_hash_type):
	Change type to hash_table.  Update dependent calls and types.
	(assign_filter_values::ttypes): Likewise.
	(assign_filter_values::ehspec): Likewise.
	(sjlj_assign_call_site_values::ar_hash): Likewise.
	(convert_to_eh_region_ranges::ar_hash): Likewise.

	* gcse.c (htab_t pre_ldst_table):
	Change type to hash_table.  Update dependent calls and types.

	* ggc-common.c (htab_t saving_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t loc_hash): Likewise.
	(htab_t ptr_hash): Likewise.
	(call_count): Rename ggc_call_count.
	(call_alloc): Rename ggc_call_alloc.
	(loc_descriptor): Rename make_loc_descriptor.
	(add_statistics): Rename ggc_add_statistics.

	* ggc-common.c (saving_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h.
	(push_gimplify_context): Likewise.
	(pop_gimplify_context): Likewise.
	(struct gimple_temp_hash_elt): Added.
	(struct gimplify_hasher): Likewise.
	(struct gimplify_ctx.temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple-fold.c: Include gimplify-ctx.h.

	* gimple-ssa-strength-reduction.c (htab_t base_cand_map):
	Change type to hash_table.  Update dependent calls and types.
	(base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to
	avoid potential global name collision.

	* gimplify.c: Include gimplify-ctx.h.
	(struct gimple_temp_hash_elt): Move to gimplify-ctx.h.
	(htab_t gimplify_ctx::temp_htab):
	Update dependent calls and types for new type hash_table.
	(gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h.
	(gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h.

	* gimplify-ctx.h: New.
	(struct gimple_temp_hash_elt): Move from gimplify.c.
	(class gimplify_hasher): New.
	(struct gimplify_ctx): Move from gimple.h.
	(htab_t gimplify_ctx::temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* graphds.h (htab_t graph::indices): Remove unused.

	* graphite-clast-to-gimple.c: Include graphite-htab.h.
	(htab_t ivs_params::newivs_index):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t ivs_params::params_index): Likewise.
	(htab_t print_generated_program::params_index): Likewise.
	(htab_t gloog::newivs_index): Likewise.
	(htab_t gloog::params_index): Likewise.

	* graphite.c: Include graphite-htab.h.
	(htab_t graphite_transform_loops::bb_pbb_mapping):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h.
	(bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h.
	(eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h.

	* graphite-dependences.c: Include graphite-htab.h.
	(loop_is_parallel_p): Change hash table type of parameter.

	* graphite-htab.h: New.
	(typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New.
	(extern find_pbb_via_hash): Move from graphite-poly.h.
	(extern loop_is_parallel_p): Move from graphite-poly.h.
	(extern get_loop_body_pbbs): Move from graphite-poly.h.

	* graphite-poly.h (htab_t scop::original_pddrs): Remove unused.
	(SCOP_ORIGINAL_PDDRS): Remove unused.
	(extern find_pbb_via_hash): Move to graphite-htab.h.
	(extern loop_is_parallel_p): Move to graphite-htab.h.
	(extern get_loop_body_pbbs): Move to graphite-htab.h.

	* haifa-sched.c (htab_t delay_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t delay_htab_i2): Likewise.

	* hash-table.h (class hash_table):
	Correct many methods with parameter types compare_type to the correct
	value_type.  (Correct code was unlikely to notice the change.)
	(hash_table::elements_with_deleted) New.
	(class hashtable::iterator): New.
	(hashtable::begin()): New.
	(hashtable::end()): New.
	(FOR_EACH_HASH_TABLE_ELEMENT): New.

	* ira-color.c (htab_t allocno_hard_regs_htab):
	Change type to hash_table.  Update dependent calls and types.

	* ira-costs.c (htab_t cost_classes_htab):
	Change type to hash_table.  Update dependent calls and types.

	* loop-invariant.c (htab_t merge_identical_invariants::eq):
	Change type to hash_table.  Update dependent calls and types.

	* loop-iv.c (htab_t bivs):
	Change type to hash_table.  Update dependent calls and types.

	* loop-unroll.c (htab_t opt_info::insns_to_split):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t opt_info::insns_with_var_to_expand): Likewise.

	* lto-streamer.h (struct string_slot): Move from data-streamer.h
	(struct string_slot_hasher): New.
	(htab_t output_block::string_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-in.c (freeing_string_slot_hasher): New.
	(htab_t file_name_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-out.c: Update output_block::string_hash_table dependent
	calls and types.

	* lto-streamer.c (htab_t tree_htab):
	Change type to hash_table.  Update dependent calls and types.

	* omp-low.c: Include gimplify-ctx.h.

	* passes.c (htab_t name_to_pass_map):
	Change type to hash_table.  Update dependent calls and types.
	(pass_traverse): Rename to passes_pass_traverse.

	* plugin.c (htab_t event_tab):
	Change type to hash_table.  Update dependent calls and types.

	* postreload-gcse.c (htab_t expr_table):
	Change type to hash_table.  Update dependent calls and types.
	(dump_hash_table_entry): Rename dump_expr_hash_table_entry.

	* sese.c (debug_rename_map_1): Make extern.
	(debug_ivtype_elt): Remove unused.
	(debug_ivtype_map_1): Remove unused.
	(debug_ivtype_map): Remove unused.
	(ivtype_map_elt_info): Remove unused.
	(eq_ivtype_map_elts): Remove unused.
	(htab_t copy_bb_and_scalar_dependences::rename_map):
	Change type to hash_table.  Update dependent calls and types.

	* sese.h (extern insert_loop_close_phis): Remove unused.
	(extern insert_guard_phis): Remove unused.
	(extern debug_ivtype_map): Remove unused.
	(extern ivtype_map_elt_info): Remove unused.
	(inline new_ivtype_map_elt): Remove unused.
	(extern debug_rename_map): Move to .c file.

	* statistics.c (statistics_hashes):
	Change type to hash_table.  Update dependent calls and types.

	* store-motion.c (htab_t store_motion_mems_table):
	Change type to hash_table.  Update dependent calls and types.

	* trans-mem.c (htab_t tm_new_mem_hash):
	Change type to hash_table.  Update dependent calls and types.

	* tree-browser.c (htab_t TB_up_ht):
	Change type to hash_table.  Update dependent calls and types.

	* tree-cfg.c (htab_t discriminator_per_locus):
	Change type to hash_table.  Update dependent calls and types.

	* tree-complex.c: Include tree-hasher.h
	(htab_t complex_variable_components):
	Change type to hash_table.  Update dependent calls and types.

	* tree-eh.c (htab_t finally_tree):
	Change type to hash_table.  Update dependent calls and types.

	* tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher
	struct int_tree_hasher.
	(extern int_tree_map_eq): Likewise.
	(uid_decl_map_hash): Removed.
	(extern decl_tree_map_eq): Likewise.

	* tree-hasher.h: New.
	(struct int_tree_hasher): New.
	(typedef int_tree_htab_type): New.

	* tree-inline.c: Include gimplify-ctx.h.

	* tree-into-ssa.c (var_infos):
	Change type to hash_table.  Update dependent calls and types.

	* tree-mudflap.c: Include gimplify-ctx.h.

	* tree-parloops.c: Include tree-hasher.h.
	(htab_t eliminate_local_variables_stmt::decl_address):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t separate_decls_in_region::decl_copies): Likewise.

	* tree-scalar-evolution.c (htab_t resolve_mixers::cache):
	Change type to hash_table.  Update dependent calls and types.

	* tree-sra.c (candidates):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher
	in tree-flow.h.
	(int_tree_map_hash): Likewise.

	* tree-ssa-coalesce.c (struct coalesce_list_d.list):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-dom.c (htab_t avail_exprs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-live.c (var_map_base_init::tree_to_index):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-im.c (struct mem_ref.refs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-phiopt.c (seen_ssa_names):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-reassoc.c (undistribute_ops_list::ctable):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-sccvn.c (vn_tables_s::nary):
	Change type to hash_table.  Update dependent calls and types.
	(vn_tables_s::phis): Likewise.
	(vn_tables_s::references): Likewise.

	* tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types.
	(vn_reference_eq): Update parameter and return types.

	* tree-ssa-strlen.c (decl_to_stridxlist_htab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-structalias.c (pointer_equiv_class_table):
	Change type to hash_table.  Update dependent calls and types.
	(location_equiv_class_table): Likewise.

	* tree-ssa-uncprop.c (equiv):
	Change type to hash_table.  Update dependent calls and types.

	* tree-vect-data-refs.c: Consequential changes for making
	peeling a hash_table.

	* tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update.
	(destroy_loop_vec_info): Dependent hash_table update.

	* tree-vectorizer.h (peeling_htab):
	Change type to hash_table.  Update dependent calls and types.

	* var-tracking.c (shared_hash_def::htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/arm/t-arm: Update for below.

	* config/arm/arm.c (arm_libcall_uses_aapcs_base::libcall_htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/i386/t-cygming: Update for below.

	* config/i386/t-interix: Update for below.

	* config/i386/winnt.c (i386_pe_section_type_flags::htab):
	Change type to hash_table.  Update dependent calls and types.
	(i386_find_on_wrapper_list::wrappers): Likewise.

	* config/ia64/t-ia64: Update for below.

	* config/ia64/ia64.c (bundle_state_table):
	Change type to hash_table.  Update dependent calls and types.

	* config/mips/mips.c (mips_reorg_process_insns::htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/sol2.c (solaris_comdat_htab):
	Change type to hash_table.  Update dependent calls and types.

	* config/t-sol2: Update for above.

Patch attached compressed due to size.

-- 
Lawrence Crowl

[-- Attachment #2: patch.gz --]
[-- Type: application/x-gzip, Size: 101522 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-23 22:36 [patch] Hash table changes from cxx-conversion branch Lawrence Crowl
  2013-03-26 23:53 ` Lawrence Crowl
@ 2013-03-27  9:38 ` Richard Biener
  2013-03-27 16:44   ` Lawrence Crowl
       [not found]   ` <CAGqM8fZC_DG2u17WD=tnnQq3nJ3MtAyJzUBU5+4D4WME2Sh-rQ@mail.gmail.com>
  2013-03-27 13:59 ` Martin Jambor
  2 siblings, 2 replies; 15+ messages in thread
From: Richard Biener @ 2013-03-27  9:38 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: gcc-patches List

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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-23 22:36 [patch] Hash table changes from cxx-conversion branch Lawrence Crowl
  2013-03-26 23:53 ` Lawrence Crowl
  2013-03-27  9:38 ` Richard Biener
@ 2013-03-27 13:59 ` Martin Jambor
  2 siblings, 0 replies; 15+ messages in thread
From: Martin Jambor @ 2013-03-27 13:59 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: gcc-patches List

Hi,

On Sat, Mar 23, 2013 at 03:36:35PM -0700, Lawrence Crowl wrote:
> This patch is a consolodation of the hash_table patches to the
> cxx-conversion branch.
> 

I can't approve anything but I am fine with

> 	* tree-sra.c (candidates):
> 	Change type to hash_table.  Update dependent calls and types.
> 
> 	* tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher
> 	in tree-flow.h.
> 	(int_tree_map_hash): Likewise.

Thanks,

Martin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-27  9:38 ` Richard Biener
@ 2013-03-27 16:44   ` Lawrence Crowl
  2013-03-28  3:45     ` Lawrence Crowl
  2013-03-28  9:34     ` Richard Biener
       [not found]   ` <CAGqM8fZC_DG2u17WD=tnnQq3nJ3MtAyJzUBU5+4D4WME2Sh-rQ@mail.gmail.com>
  1 sibling, 2 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-03-27 16:44 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List

On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
> On Mar 23, 2013 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.

I will do that.

> > * 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.

I will investigate for a separate patch.

> > 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.

It wasn't obvious that the functions could be removed.  :-)

Are you saying you don't want these notations in the description?

-- 
Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-27 16:44   ` Lawrence Crowl
@ 2013-03-28  3:45     ` Lawrence Crowl
  2013-03-28  9:34     ` Richard Biener
  1 sibling, 0 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-03-28  3:45 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

On 3/27/13, Lawrence Crowl <crowl@googlers.com> wrote:
> On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
> > On Mar 23, 2013 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.
>
> I will do that.

I have attached the separated patches and their descriptions.

-- 
Lawrence Crowl

[-- Attachment #2: htab_non_config.gz --]
[-- Type: application/x-gzip, Size: 102278 bytes --]

[-- Attachment #3: htab_config.gz --]
[-- Type: application/x-gzip, Size: 6031 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-27 16:44   ` Lawrence Crowl
  2013-03-28  3:45     ` Lawrence Crowl
@ 2013-03-28  9:34     ` Richard Biener
  2013-03-31 22:17       ` Lawrence Crowl
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Biener @ 2013-03-28  9:34 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: gcc-patches List

On Wed, Mar 27, 2013 at 5:44 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
>> On Mar 23, 2013 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.
>
> I will do that.
>
>> > * 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.
>
> I will investigate for a separate patch.
>
>> > 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.
>
> It wasn't obvious that the functions could be removed.  :-)
>
> Are you saying you don't want these notations in the description?

No, I was saying that removal of unused functions / types should be
committed separately and do not need approval as they are obvious.
If they are not obvious (I didn't look at that patch part), then posting
separately still helps ;)

Thanks,
Richard.

> --
> Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-28  9:34     ` Richard Biener
@ 2013-03-31 22:17       ` Lawrence Crowl
  2013-04-09  1:54         ` Lawrence Crowl
  0 siblings, 1 reply; 15+ messages in thread
From: Lawrence Crowl @ 2013-03-31 22:17 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]

On 3/28/13, Richard Biener <richard.guenther@gmail.com> wrote:
> On Mar 27, 2013 Lawrence Crowl <crowl@googlers.com> wrote:
> > On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
> > > On Mar 23, 2013 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.
> >
> > I will do that.
> >
> > > > * 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.
> >
> > I will investigate for a separate patch.
> >
> > > > 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.
> >
> > It wasn't obvious that the functions could be removed.  :-)
> >
> > Are you saying you don't want these notations in the description?
>
> No, I was saying that removal of unused functions / types should be
> committed separately and do not need approval as they are obvious.
> If they are not obvious (I didn't look at that patch part),
> then posting separately still helps ;)

I've split out the removals to separate patches.  The remaining
work is in two independent pieces.  The changes within the config
directory and the changes outside that directory.  The descriptions
and patch are attached compressed due to mailer size issues.

Okay for trunk?

-- 
Lawrence Crowl

[-- Attachment #2: htab_non_config.gz --]
[-- Type: application/x-gzip, Size: 99121 bytes --]

[-- Attachment #3: htab_config.gz --]
[-- Type: application/x-gzip, Size: 6232 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-03-31 22:17       ` Lawrence Crowl
@ 2013-04-09  1:54         ` Lawrence Crowl
  2013-04-09 11:13           ` Richard Biener
  0 siblings, 1 reply; 15+ messages in thread
From: Lawrence Crowl @ 2013-04-09  1:54 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List

Ping?

On 3/31/13, Lawrence Crowl <crowl@googlers.com> wrote:
> On 3/28/13, Richard Biener <richard.guenther@gmail.com> wrote:
>> On Mar 27, 2013 Lawrence Crowl <crowl@googlers.com> wrote:
>> > On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
>> > > On Mar 23, 2013 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.
>> >
>> > I will do that.
>> >
>> > > > * 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.
>> >
>> > I will investigate for a separate patch.
>> >
>> > > > 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.
>> >
>> > It wasn't obvious that the functions could be removed.  :-)
>> >
>> > Are you saying you don't want these notations in the description?
>>
>> No, I was saying that removal of unused functions / types should be
>> committed separately and do not need approval as they are obvious.
>> If they are not obvious (I didn't look at that patch part),
>> then posting separately still helps ;)
>
> I've split out the removals to separate patches.  The remaining
> work is in two independent pieces.  The changes within the config
> directory and the changes outside that directory.  The descriptions
> and patch are attached compressed due to mailer size issues.
>
> Okay for trunk?
>
> --
> Lawrence Crowl
>


-- 
Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-04-09  1:54         ` Lawrence Crowl
@ 2013-04-09 11:13           ` Richard Biener
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Biener @ 2013-04-09 11:13 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: gcc-patches List

On Mon, Apr 8, 2013 at 11:45 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> Ping?

You didn't commit the ones I already approved?  I don't want to go over
them again ...

Richard.

> On 3/31/13, Lawrence Crowl <crowl@googlers.com> wrote:
>> On 3/28/13, Richard Biener <richard.guenther@gmail.com> wrote:
>>> On Mar 27, 2013 Lawrence Crowl <crowl@googlers.com> wrote:
>>> > On 3/27/13, Richard Biener <richard.guenther@gmail.com> wrote:
>>> > > On Mar 23, 2013 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.
>>> >
>>> > I will do that.
>>> >
>>> > > > * 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.
>>> >
>>> > I will investigate for a separate patch.
>>> >
>>> > > > 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.
>>> >
>>> > It wasn't obvious that the functions could be removed.  :-)
>>> >
>>> > Are you saying you don't want these notations in the description?
>>>
>>> No, I was saying that removal of unused functions / types should be
>>> committed separately and do not need approval as they are obvious.
>>> If they are not obvious (I didn't look at that patch part),
>>> then posting separately still helps ;)
>>
>> I've split out the removals to separate patches.  The remaining
>> work is in two independent pieces.  The changes within the config
>> directory and the changes outside that directory.  The descriptions
>> and patch are attached compressed due to mailer size issues.
>>
>> Okay for trunk?
>>
>> --
>> Lawrence Crowl
>>
>
>
> --
> Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
       [not found]   ` <CAGqM8fZC_DG2u17WD=tnnQq3nJ3MtAyJzUBU5+4D4WME2Sh-rQ@mail.gmail.com>
@ 2013-04-24 23:18     ` Lawrence Crowl
  2013-04-25 14:19       ` Richard Biener
  2013-04-25 21:47       ` Diego Novillo
  0 siblings, 2 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-04-24 23:18 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List, Diego Novillo

[-- Attachment #1: Type: text/plain, Size: 6207 bytes --]

On 4/24/13, Lawrence Crowl <crowl@googlers.com> wrote:
> Updated hash table patch.  This patch does not include the config part,
> and does not include the entries already approved.
>
> The patch is attached due to size.

Trying again.  Patch attached compressed.  Introductory text below.

===

This patch is a consolodation of the hash_table patches to the
cxx-conversion branch for files not under gcc/config.

Update various hash tables from htab_t to hash_table.
Modify types and calls to match.

* tree-parloops.c'reduction
* tree-parloops.c'name_to_copy

Fold reduction_info_hash and reduction_info_eq into new struct
reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
into new struct name_to_copy_hasher.

* var-tracking.c'emit_note_data_def.vars
* var-tracking.c'shared_hash_def.htab
* var-tracking.c'changed_variables

Fold variable_htab_hash, variable_htab_eq, variable_htab_free
  into new struct variable_hasher.
Add typedef variable_table_type.
Add typedef variable_iterator_type.

* trans-mem.c'tm_log

Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.

* trans-mem.c'tm_memopt_value_numbers

Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.

* tree-ssa-strlen.c'decl_to_stridxlist_htab

Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.

* tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab

Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
iv_inv_expr_hasher.

* tree-ssa-uncprop.c'equiv

Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.

Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.

Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.

* tree-ssa-phiopt.c'seen_ssa_names

Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.

* 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.

* tree-ssa-live.c'var_map_base_init::tree_to_index

New struct tree_int_map_hasher.

* tree-sra.c'candidates

Fold uid_decl_map_hash and uid_decl_map_eq into new struct
uid_decl_hasher.  This change moves the definitions from tree-ssa.c
into tree-sra.c and removes the declarations from tree-flow.h

tree-browser.c

Remove stale declaration of removed TB_parent_eq.
Fix template parameter for base class to match value_type.

gimple.h

Use gimplify_hasher::hash rather than gimple_tree_hash in the
  assertion check.
Change return values to match return type. (I.e. no conversions.)

* graphite-clast-to-gimple.c'ivs_params::newivs_index
* graphite-clast-to-gimple.c'ivs_params::params_index
* graphite-clast-to-gimple.c'print_generated_program::params_index
* graphite-clast-to-gimple.c'gloog::newivs_index
* graphite-clast-to-gimple.c'gloog::params_index
* graphite.c graphite_transform_loops::bb_pbb_mapping
* sese.c copy_bb_and_scalar_dependences::rename_map

Move hash table declarations to a new graphite-htab.h, because they
are used in few places.

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

* gimplify.c'gimplify_ctx::temp_htab

Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
gimplify-ctx.h, because they are used few places.

* cselib.c'cselib_hash_table
* gcse.c'pre_ldst_table
* gimple-ssa-strength-reduction.c'base_cand_map
* haifa-sched.c'delay_htab
* haifa-sched.c'delay_htab_i2
* ira-color.c'allocno_hard_regs_htab
* ira-costs.c'cost_classes_htab
* loop-invariant.c'merge_identical_invariants::eq
* loop-iv.c'bivs
* loop-unroll.c'opt_info::insns_to_split
* loop-unroll.c'opt_info::insns_with_var_to_expand
* passes.c'name_to_pass_map
* plugin.c'event_tab
* postreload-gcse.c'expr_table
* store-motion.c'store_motion_mems_table
* tree-cfg.c'discriminator_per_locus
* tree-scalar-evolution.c'resolve_mixers::cache
* tree-ssa-dom.c'avail_exprs

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

* attribs.c'scoped_attributes::attribute_hash
* bitmap.c'bitmap_desc_hash
* dwarf2cfi.c'trace_index
* dwarf2out.c'break_out_includes::cu_hash_table
* dwarf2out.c'copy_decls_for_unworthy_types::decl_table
* dwarf2out.c'optimize_external_refs::map
* dwarf2out.c'output_comp_unit::extern_map
* dwarf2out.c'output_comdat_type_unit::extern_map
* dwarf2out.c'output_macinfo::macinfo_htab
* dwarf2out.c'optimize_location_lists::htab
* dwarf2out.c'dwarf2out_finish::comdat_type_table
* except.c'ehspec_hash_type
* except.c'assign_filter_values::ttypes
* except.c'assign_filter_values::ehspec
* except.c'sjlj_assign_call_site_values::ar_hash
* except.c'convert_to_eh_region_ranges::ar_hash
* trans-mem.c'tm_new_mem_hash
* tree-browser.c'TB_up_ht
* tree-eh.c'finally_tree

Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
in alloc-pool.c to after the method definitions for its parameter
class.

* ggc-common.c'loc_hash
* ggc-common.c'ptr_hash

Add a new hash_table method elements_with_deleted to meet the needs of
gcc-common.c.

Correct many methods with parameter types compare_type to the correct
value_type.  (Correct code was unlikely to notice the change, but
incorrect code will.)

* tree-complex.c'complex_variable_components
* tree-parloops.c'eliminate_local_variables_stmt::decl_address
* tree-parloops.c'separate_decls_in_region::decl_copies

Move hash table declarations to a new tree-hasher.h, to resolve
compilation dependences and because they are used in few places.

* lto-streamer.h'output_block::string_hash_table
* lto-streamer-in.c'file_name_hash_table
* lto-streamer.c'tree_htab

The struct string_slot moves from data-streamer.h to lto-streamer.h to
resolve compilation dependences.

Tested on x86_64.

-- 
Lawrence Crowl

[-- Attachment #2: patch.gz --]
[-- Type: application/x-gzip, Size: 78599 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-04-24 23:18     ` Lawrence Crowl
@ 2013-04-25 14:19       ` Richard Biener
  2013-04-26 10:57         ` Lawrence Crowl
  2013-04-25 21:47       ` Diego Novillo
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Biener @ 2013-04-25 14:19 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: gcc-patches List, Diego Novillo

On Wed, Apr 24, 2013 at 9:58 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> On 4/24/13, Lawrence Crowl <crowl@googlers.com> wrote:
>> Updated hash table patch.  This patch does not include the config part,
>> and does not include the entries already approved.
>>
>> The patch is attached due to size.
>
> Trying again.  Patch attached compressed.  Introductory text below.
>
> ===
>
> This patch is a consolodation of the hash_table patches to the
> cxx-conversion branch for files not under gcc/config.
>
> Update various hash tables from htab_t to hash_table.
> Modify types and calls to match.
>
> * tree-parloops.c'reduction
> * tree-parloops.c'name_to_copy
>
> Fold reduction_info_hash and reduction_info_eq into new struct
> reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
> into new struct name_to_copy_hasher.
>
> * var-tracking.c'emit_note_data_def.vars
> * var-tracking.c'shared_hash_def.htab
> * var-tracking.c'changed_variables
>
> Fold variable_htab_hash, variable_htab_eq, variable_htab_free
>   into new struct variable_hasher.
> Add typedef variable_table_type.
> Add typedef variable_iterator_type.
>
> * trans-mem.c'tm_log
>
> Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.
>
> * trans-mem.c'tm_memopt_value_numbers
>
> Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.
>
> * tree-ssa-strlen.c'decl_to_stridxlist_htab
>
> Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.
>
> * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab
>
> Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
> iv_inv_expr_hasher.
>
> * tree-ssa-uncprop.c'equiv
>
> Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.
>
> Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.
>
> Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
> with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.
>
> * tree-ssa-phiopt.c'seen_ssa_names
>
> Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.
>
> * 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.
>
> * tree-ssa-live.c'var_map_base_init::tree_to_index
>
> New struct tree_int_map_hasher.
>
> * tree-sra.c'candidates
>
> Fold uid_decl_map_hash and uid_decl_map_eq into new struct
> uid_decl_hasher.  This change moves the definitions from tree-ssa.c
> into tree-sra.c and removes the declarations from tree-flow.h
>
> tree-browser.c
>
> Remove stale declaration of removed TB_parent_eq.
> Fix template parameter for base class to match value_type.
>
> gimple.h
>
> Use gimplify_hasher::hash rather than gimple_tree_hash in the
>   assertion check.
> Change return values to match return type. (I.e. no conversions.)
>
> * graphite-clast-to-gimple.c'ivs_params::newivs_index
> * graphite-clast-to-gimple.c'ivs_params::params_index
> * graphite-clast-to-gimple.c'print_generated_program::params_index
> * graphite-clast-to-gimple.c'gloog::newivs_index
> * graphite-clast-to-gimple.c'gloog::params_index
> * graphite.c graphite_transform_loops::bb_pbb_mapping
> * sese.c copy_bb_and_scalar_dependences::rename_map
>
> Move hash table declarations to a new graphite-htab.h, because they
> are used in few places.
>
> 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
>
> * gimplify.c'gimplify_ctx::temp_htab
>
> Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
> gimplify-ctx.h, because they are used few places.
>
> * cselib.c'cselib_hash_table
> * gcse.c'pre_ldst_table
> * gimple-ssa-strength-reduction.c'base_cand_map
> * haifa-sched.c'delay_htab
> * haifa-sched.c'delay_htab_i2
> * ira-color.c'allocno_hard_regs_htab
> * ira-costs.c'cost_classes_htab
> * loop-invariant.c'merge_identical_invariants::eq
> * loop-iv.c'bivs
> * loop-unroll.c'opt_info::insns_to_split
> * loop-unroll.c'opt_info::insns_with_var_to_expand
> * passes.c'name_to_pass_map
> * plugin.c'event_tab
> * postreload-gcse.c'expr_table
> * store-motion.c'store_motion_mems_table
> * tree-cfg.c'discriminator_per_locus
> * tree-scalar-evolution.c'resolve_mixers::cache
> * tree-ssa-dom.c'avail_exprs
>
> 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
>
> * attribs.c'scoped_attributes::attribute_hash
> * bitmap.c'bitmap_desc_hash
> * dwarf2cfi.c'trace_index
> * dwarf2out.c'break_out_includes::cu_hash_table
> * dwarf2out.c'copy_decls_for_unworthy_types::decl_table
> * dwarf2out.c'optimize_external_refs::map
> * dwarf2out.c'output_comp_unit::extern_map
> * dwarf2out.c'output_comdat_type_unit::extern_map
> * dwarf2out.c'output_macinfo::macinfo_htab
> * dwarf2out.c'optimize_location_lists::htab
> * dwarf2out.c'dwarf2out_finish::comdat_type_table
> * except.c'ehspec_hash_type
> * except.c'assign_filter_values::ttypes
> * except.c'assign_filter_values::ehspec
> * except.c'sjlj_assign_call_site_values::ar_hash
> * except.c'convert_to_eh_region_ranges::ar_hash
> * trans-mem.c'tm_new_mem_hash
> * tree-browser.c'TB_up_ht
> * tree-eh.c'finally_tree
>
> Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
> in alloc-pool.c to after the method definitions for its parameter
> class.
>
> * ggc-common.c'loc_hash
> * ggc-common.c'ptr_hash
>
> Add a new hash_table method elements_with_deleted to meet the needs of
> gcc-common.c.
>
> Correct many methods with parameter types compare_type to the correct
> value_type.  (Correct code was unlikely to notice the change, but
> incorrect code will.)
>
> * tree-complex.c'complex_variable_components
> * tree-parloops.c'eliminate_local_variables_stmt::decl_address
> * tree-parloops.c'separate_decls_in_region::decl_copies
>
> Move hash table declarations to a new tree-hasher.h, to resolve
> compilation dependences and because they are used in few places.
>
> * lto-streamer.h'output_block::string_hash_table
> * lto-streamer-in.c'file_name_hash_table
> * lto-streamer.c'tree_htab
>
> The struct string_slot moves from data-streamer.h to lto-streamer.h to
> resolve compilation dependences.
>
> Tested on x86_64.

Please send context diffs - the following is an especially awkward example:

-/* Structure for passing some other parameters to function
-   emit_note_insn_var_location.  */
-typedef struct emit_note_data_def
+/* Return true if a decl_or_value DV is a DECL or NULL.  */
+static inline bool
+dv_is_decl_p (decl_or_value dv)
 {
-  /* The instruction which the note will be emitted before/after.  */
-  rtx insn;
+  return !dv || (int) TREE_CODE ((tree) dv) != (int) VALUE;
+}

The changes to the following files are ok (just in case I will not finish review
due to time constraints):

gcc/tree-ssa-loop-ivopts.c

I'll leave the var-tracking.c changes to respective maintainers, maybe
it's a good
idea to send that heavy reorg separately.

gcc/tree-ssa-strlen.c
gcc/loop-iv.c
gcc/trans-mem.c
gcc/lto-streamer.c
gcc/lto-streamer.h
gcc/loop-unroll.c
gcc/tree-parloops.c
gcc/tree-complex.c
gcc/gcse.c
gcc/gimple-ssa-strength-reduction.c
gcc/data-streamer-out.c
gcc/data-streamer.h
gcc/ira-costs.c
gcc/dwarf2cfi.c
gcc/tree-flow.h
gcc/lto-streamer-in.c
gcc/sese.c

-static int
-debug_rename_map_1 (void **slot, void *s ATTRIBUTE_UNUSED)
+int
+debug_rename_map_1 (rename_map_elt_s **slot, void *s ATTRIBUTE_UNUSED)
 {

...
 DEBUG_FUNCTION void
-debug_rename_map (htab_t rename_map)
+debug_rename_map (rename_map_type rename_map)
 {
-  htab_traverse (rename_map, debug_rename_map_1, NULL);
+  rename_map.traverse <void *, debug_rename_map_1> (NULL);
 }

aww ... one reason why I dislike template function arguments ;)
Functors are so much nicer.

gcc/sese.h
gcc/attribs.c
gcc/graphite-htab.h
gcc/tree-ssa-live.c
gcc/tree-scalar-evolution.c
gcc/graphite-dependences.c
gcc/except.c
gcc/alloc-pool.c
gcc/cselib.c
gcc/tree-ssa-phiopt.c
gcc/graphite-poly.h
gcc/gimplify.c
gcc/tree-ssa-dom.c
gcc/graphite.c
gcc/tree-browser.c
gcc/tree-sra.c
gcc/plugin.c
gcc/graphite-clast-to-gimple.c
gcc/graphite-clast-to-gimple.h
gcc/tree-ssa-uncprop.c
gcc/tree-hasher.h  -- I'd expected tree_int, int_tree and uid_decl
hashers to be here btw
gcc/gimple.h
gcc/tree-ssa.c
gcc/ggc-common.c
gcc/passes.c
gcc/lto-streamer-out.c
gcc/tree-cfg.c
gcc/store-motion.c
gcc/ira-color.c
gcc/tree-eh.c
gcc/dwarf2out.c
gcc/haifa-sched.c
gcc/bitmap.c
gcc/postreload-gcse.c
gcc/loop-invariant.c

Thus, the patch is ok apart from the var-tracking.c bits which I defer to
respective maintainers.

Btw, a hint on future such re-orgs - smaller patches are easily reviewed
when going through mail - large ones such as this are queued somewhere
for eventual review (that happens for me).  So I suggest to submit independent
bits independently and you get a high chance of getting very quick approvals.

Thanks,
Richard.

> Lawrence Crowlgcc/tree-eh.c

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-04-24 23:18     ` Lawrence Crowl
  2013-04-25 14:19       ` Richard Biener
@ 2013-04-25 21:47       ` Diego Novillo
  2013-04-26 11:00         ` Lawrence Crowl
  1 sibling, 1 reply; 15+ messages in thread
From: Diego Novillo @ 2013-04-25 21:47 UTC (permalink / raw)
  To: Lawrence Crowl; +Cc: Richard Biener, gcc-patches List

On 2013-04-24 15:58 , Lawrence Crowl wrote:
> * var-tracking.c'emit_note_data_def.vars
> * var-tracking.c'shared_hash_def.htab
> * var-tracking.c'changed_variables
>
> Fold variable_htab_hash, variable_htab_eq, variable_htab_free
>    into new struct variable_hasher.
> Add typedef variable_table_type.
> Add typedef variable_iterator_type.

This part is fine as well.


Diego.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-04-25 14:19       ` Richard Biener
@ 2013-04-26 10:57         ` Lawrence Crowl
  0 siblings, 0 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-04-26 10:57 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches List, Diego Novillo

On 4/25/13, Richard Biener <richard.guenther@gmail.com> wrote:
> Thus, the patch is ok apart from the var-tracking.c bits which
> I defer to respective maintainers.

Okay, I split out the var-tracking.c changes.  I've committed the
rest to trunk.

-- 
Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Hash table changes from cxx-conversion branch
  2013-04-25 21:47       ` Diego Novillo
@ 2013-04-26 11:00         ` Lawrence Crowl
  0 siblings, 0 replies; 15+ messages in thread
From: Lawrence Crowl @ 2013-04-26 11:00 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Richard Biener, gcc-patches List

On 4/25/13, Diego Novillo <dnovillo@google.com> wrote:
> On 2013-04-24 15:58 , Lawrence Crowl wrote:
>> * var-tracking.c'emit_note_data_def.vars
>> * var-tracking.c'shared_hash_def.htab
>> * var-tracking.c'changed_variables
>>
>> Fold variable_htab_hash, variable_htab_eq, variable_htab_free
>>    into new struct variable_hasher.
>> Add typedef variable_table_type.
>> Add typedef variable_iterator_type.
>
> This part is fine as well.

Committed to trunk.

-- 
Lawrence Crowl

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-04-26  0:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-23 22:36 [patch] Hash table changes from cxx-conversion branch Lawrence Crowl
2013-03-26 23:53 ` Lawrence Crowl
2013-03-27  9:38 ` Richard Biener
2013-03-27 16:44   ` Lawrence Crowl
2013-03-28  3:45     ` Lawrence Crowl
2013-03-28  9:34     ` Richard Biener
2013-03-31 22:17       ` Lawrence Crowl
2013-04-09  1:54         ` Lawrence Crowl
2013-04-09 11:13           ` Richard Biener
     [not found]   ` <CAGqM8fZC_DG2u17WD=tnnQq3nJ3MtAyJzUBU5+4D4WME2Sh-rQ@mail.gmail.com>
2013-04-24 23:18     ` Lawrence Crowl
2013-04-25 14:19       ` Richard Biener
2013-04-26 10:57         ` Lawrence Crowl
2013-04-25 21:47       ` Diego Novillo
2013-04-26 11:00         ` Lawrence Crowl
2013-03-27 13:59 ` Martin Jambor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).