Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-05-29 Thread Lawrence Crowl
On 5/21/13, Diego Novillo dnovi...@google.com wrote:
 On May 13, 2013 Lawrence Crowl cr...@googlers.com wrote:
  I still have not heard from i386 or ia64 folks.  Anyone?

 The i386 bits look fine to me as well.  Please wait 48 hours to
 give the i386 maintainers a chance to object.

Committed.

-- 
Lawrence Crowl


Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-05-14 Thread Steve Ellcey
On Mon, 2013-05-13 at 15:03 -0700, Lawrence Crowl wrote:
 I still have not heard from i386 or ia64 folks.  Anyone?

The IA64 part looks OK to me.

Steve Ellcey
sell...@imgtec.com (sell...@mips.com)




Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-05-13 Thread Lawrence Crowl
I still have not heard from i386 or ia64 folks.  Anyone?

On 4/24/13, Lawrence Crowl cr...@googlers.com wrote:
 This patch is a consolodation of the hash_table patches to the
 cxx-conversion branch for files under gcc/config.

 Recipients:
 config/arm/arm.c - ni...@redhat.com, ramana.radhakrish...@arm.com
 config/ia64/ia64.c - wil...@tuliptree.org, sell...@mips.com
 config/mips/mips.c - rdsandif...@googlemail.com
 config/sol2.c - r...@cebitec.uni-bielefeld.de
 config/i386/winnt.c - c...@gcc.gnu.org, kti...@redhat.com
 global - rguent...@suse.de, dnovi...@google.com

 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.

 Tested on x86_64.  Tested with config-list.mk.


 Index: gcc/ChangeLog

 2013-04-24  Lawrence Crowl  cr...@google.com

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

 Index: gcc/config/ia64/ia64.c
 ===
 --- gcc/config/ia64/ia64.c(revision 198213)
 +++ gcc/config/ia64/ia64.c(working copy)
 @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3.
  #include target-def.h
  #include common/common-target.h
  #include tm_p.h
 -#include hashtab.h
 +#include hash-table.h
  #include langhooks.h
  #include gimple.h
  #include intl.h
 @@ -257,8 +257,6 @@ static struct bundle_state *get_free_bun
  static void free_bundle_state (struct bundle_state *);
  static void initiate_bundle_states (void);
  static void finish_bundle_states (void);
 -static unsigned bundle_state_hash (const void *);
 -static int bundle_state_eq_p (const void *, const void *);
  static int insert_bundle_state (struct bundle_state *);
  static void initiate_bundle_state_table (void);
  static void finish_bundle_state_table (void);
 @@ -8528,18 +8526,21 @@ finish_bundle_states (void)
  }
  }

 -/* Hash table of the bundle states.  The key is dfa_state and insn_num
 -   of the bundle states.  */
 +/* Hashtable helpers.  */

 -static htab_t bundle_state_table;
 +struct bundle_state_hasher : typed_noop_remove bundle_state
 +{
 +  typedef bundle_state value_type;
 +  typedef bundle_state compare_type;
 +  static inline hashval_t hash (const value_type *);
 +  static inline bool equal (const value_type *, const compare_type *);
 +};

  /* The function returns hash of BUNDLE_STATE.  */

 -static unsigned
 -bundle_state_hash (const void *bundle_state)
 +inline hashval_t
 +bundle_state_hasher::hash (const value_type *state)
  {
 -  const struct bundle_state *const state
 -= (const struct bundle_state *) bundle_state;
unsigned result, i;

for (result = i = 0; i  dfa_state_size; i++)
 @@ -8550,19 +8551,20 @@ bundle_state_hash (const void *bundle_st

  /* The function returns nonzero if the bundle state keys are equal.  */

 -static int
 -bundle_state_eq_p (const void *bundle_state_1, const void *bundle_state_2)
 +inline bool
 +bundle_state_hasher::equal (const value_type *state1,
 + const compare_type *state2)
  {
 -  const struct bundle_state *const state1
 -= (const struct bundle_state *) bundle_state_1;
 -  const struct bundle_state *const state2
 -= (const struct bundle_state *) bundle_state_2;
 -
return 

Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-04-26 Thread Rainer Orth
Lawrence,

 * config/sol2.c'solaris_comdat_htab

 Fold comdat_hash and comdat_eq into new struct comdat_entry_hasher.
[...]
 Index: gcc/ChangeLog

 2013-04-24  Lawrence Crowl  cr...@google.com
   * config/sol2.c (solaris_comdat_htab):
   Change type to hash_table.  Update dependent calls and types.

   * config/t-sol2: Update for above.

Just a nit: your ChangeLog entries are formatted strangely: No newline
immetiately after the colons, and better group e.g. all *sol2* entries
together without a blank line between.

Unfortunately, your mail client mangled the patch, so I had to apply it
manually.  Once that was done, it survived a i386-pc-solaris2.10
bootstrap without regressions, so the Solaris parts are ok.

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-04-25 Thread Richard Sandiford
Nice :-)  MIPS parts look good apart from a minor formatting nit:

Lawrence Crowl cr...@googlers.com writes:
 @@ -15945,7 +15958,8 @@ static int
  mips_record_lo_sum (rtx *loc, void *data)
  {
if (GET_CODE (*loc) == LO_SUM)
 -mips_lo_sum_offset_lookup ((htab_t) data, XEXP (*loc, 1), INSERT);
 +mips_lo_sum_offset_lookup (*(mips_offset_table*)data,
 +XEXP (*loc, 1), INSERT);

the space before data should be kept.

Thanks,
Richard


Re: [patch] Hash table changes from cxx-conversion branch

2013-04-25 Thread Richard Biener
On Wed, Apr 24, 2013 at 9:58 PM, Lawrence Crowl cr...@googlers.com wrote:
 On 4/24/13, Lawrence Crowl cr...@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
 * 

Re: [patch] Hash table changes from cxx-conversion branch - config part

2013-04-25 Thread Ramana Radhakrishnan

On 04/24/13 20:02, Lawrence Crowl wrote:

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

Recipients:
config/arm/arm.c - ni...@redhat.com, ramana.radhakrish...@arm.com
config/ia64/ia64.c - wil...@tuliptree.org, sell...@mips.com
config/mips/mips.c - rdsandif...@googlemail.com
config/sol2.c - r...@cebitec.uni-bielefeld.de
config/i386/winnt.c - c...@gcc.gnu.org, kti...@redhat.com
global - rguent...@suse.de, dnovi...@google.com

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


LGTM- The ARM bits are ok to apply.

Thanks,
Ramana





Re: [patch] Hash table changes from cxx-conversion branch

2013-04-25 Thread Diego Novillo

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.


Re: [patch] Hash table changes from cxx-conversion branch

2013-04-25 Thread Lawrence Crowl
On 4/25/13, Richard Biener richard.guent...@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


Re: [patch] Hash table changes from cxx-conversion branch

2013-04-25 Thread Lawrence Crowl
On 4/25/13, Diego Novillo dnovi...@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


[patch] Hash table changes from cxx-conversion branch - config part

2013-04-24 Thread Lawrence Crowl
This patch is a consolodation of the hash_table patches to the
cxx-conversion branch for files under gcc/config.

Recipients:
config/arm/arm.c - ni...@redhat.com, ramana.radhakrish...@arm.com
config/ia64/ia64.c - wil...@tuliptree.org, sell...@mips.com
config/mips/mips.c - rdsandif...@googlemail.com
config/sol2.c - r...@cebitec.uni-bielefeld.de
config/i386/winnt.c - c...@gcc.gnu.org, kti...@redhat.com
global - rguent...@suse.de, dnovi...@google.com

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.

Tested on x86_64.  Tested with config-list.mk.


Index: gcc/ChangeLog

2013-04-24  Lawrence Crowl  cr...@google.com

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

Index: gcc/config/ia64/ia64.c
===
--- gcc/config/ia64/ia64.c  (revision 198213)
+++ gcc/config/ia64/ia64.c  (working copy)
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3.
 #include target-def.h
 #include common/common-target.h
 #include tm_p.h
-#include hashtab.h
+#include hash-table.h
 #include langhooks.h
 #include gimple.h
 #include intl.h
@@ -257,8 +257,6 @@ static struct bundle_state *get_free_bun
 static void free_bundle_state (struct bundle_state *);
 static void initiate_bundle_states (void);
 static void finish_bundle_states (void);
-static unsigned bundle_state_hash (const void *);
-static int bundle_state_eq_p (const void *, const void *);
 static int insert_bundle_state (struct bundle_state *);
 static void initiate_bundle_state_table (void);
 static void finish_bundle_state_table (void);
@@ -8528,18 +8526,21 @@ finish_bundle_states (void)
 }
 }

-/* Hash table of the bundle states.  The key is dfa_state and insn_num
-   of the bundle states.  */
+/* Hashtable helpers.  */

-static htab_t bundle_state_table;
+struct bundle_state_hasher : typed_noop_remove bundle_state
+{
+  typedef bundle_state value_type;
+  typedef bundle_state compare_type;
+  static inline hashval_t hash (const value_type *);
+  static inline bool equal (const value_type *, const compare_type *);
+};

 /* The function returns hash of BUNDLE_STATE.  */

-static unsigned
-bundle_state_hash (const void *bundle_state)
+inline hashval_t
+bundle_state_hasher::hash (const value_type *state)
 {
-  const struct bundle_state *const state
-= (const struct bundle_state *) bundle_state;
   unsigned result, i;

   for (result = i = 0; i  dfa_state_size; i++)
@@ -8550,19 +8551,20 @@ bundle_state_hash (const void *bundle_st

 /* The function returns nonzero if the bundle state keys are equal.  */

-static int
-bundle_state_eq_p (const void *bundle_state_1, const void *bundle_state_2)
+inline bool
+bundle_state_hasher::equal (const value_type *state1,
+   const compare_type *state2)
 {
-  const struct bundle_state *const state1
-= (const struct bundle_state *) bundle_state_1;
-  const struct bundle_state *const state2
-= (const struct bundle_state *) bundle_state_2;
-
   return (state1-insn_num == state2-insn_num
   memcmp (state1-dfa_state, state2-dfa_state,
 dfa_state_size) == 0);
 }

+/* Hash table of the bundle states.  The key is 

Re: [patch] Hash table changes from cxx-conversion branch

2013-04-09 Thread Richard Biener
On Mon, Apr 8, 2013 at 11:45 PM, Lawrence Crowl cr...@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 cr...@googlers.com wrote:
 On 3/28/13, Richard Biener richard.guent...@gmail.com wrote:
 On Mar 27, 2013 Lawrence Crowl cr...@googlers.com wrote:
  On 3/27/13, Richard Biener richard.guent...@gmail.com wrote:
   On Mar 23, 2013 Lawrence Crowl cr...@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


Re: [patch] Hash table changes from cxx-conversion branch

2013-04-08 Thread Lawrence Crowl
Ping?

On 3/31/13, Lawrence Crowl cr...@googlers.com wrote:
 On 3/28/13, Richard Biener richard.guent...@gmail.com wrote:
 On Mar 27, 2013 Lawrence Crowl cr...@googlers.com wrote:
  On 3/27/13, Richard Biener richard.guent...@gmail.com wrote:
   On Mar 23, 2013 Lawrence Crowl cr...@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


Re: [patch] Hash table changes from cxx-conversion branch

2013-03-28 Thread Richard Biener
On Wed, Mar 27, 2013 at 5:44 PM, Lawrence Crowl cr...@googlers.com wrote:
 On 3/27/13, Richard Biener richard.guent...@gmail.com wrote:
 On Mar 23, 2013 Lawrence Crowl cr...@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


Re: [patch] Hash table changes from cxx-conversion branch

2013-03-27 Thread Richard Biener
On Sat, Mar 23, 2013 at 11:36 PM, Lawrence Crowl cr...@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.


Re: [patch] Hash table changes from cxx-conversion branch

2013-03-27 Thread Martin Jambor
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


Re: [patch] Hash table changes from cxx-conversion branch

2013-03-27 Thread Lawrence Crowl
On 3/27/13, Richard Biener richard.guent...@gmail.com wrote:
 On Mar 23, 2013 Lawrence Crowl cr...@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