Re: [cxx-conversion] graphite-related hash tables

2012-12-03 Thread Diego Novillo
On Sun, Dec 2, 2012 at 4:58 AM, Tobias Grosser tob...@grosser.es wrote:

 Assuming the test suite passes and this is just a no-behavior change
 intended commit, I am fine with this. No idea, who needs to sign off
 branch commits, though.

The branch is under the usual maintainer rules (it's a regular
development branch).  If you think the patch is OK, then it certainly
is.


Diego.


Re: [cxx-conversion] graphite-related hash tables

2012-12-02 Thread Tobias Grosser
On Sun, Dec 2, 2012, at 02:42 AM, Lawrence Crowl wrote:
 Change graphite-related hash tables from htab_t to hash_table:
 
 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
 
 
 Tested on x86-64.
 
 Okay for branch?

Hi Lawrance,

from the point of graphite, the update looks very good. Thanks  lot for
getting the new hash table implementation in.
Also, thanks for the dead code removal.

Assuming the test suite passes and this is just a no-behavior change
intended commit, I am fine with this. No idea, who needs to sign off
branch commits, though.

Cheers
Tobi


[cxx-conversion] graphite-related hash tables

2012-12-01 Thread Lawrence Crowl
Change graphite-related hash tables from htab_t to hash_table:

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


Tested on x86-64.

Okay for branch?


Index: gcc/ChangeLog

2012-11-30  Lawrence Crowl  cr...@google.com

* 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-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-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-dependences.c: Include graphite-htab.h.
(loop_is_parallel_p): Change hash table type of parameter.

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

* graphite.c: Include graphite-htab.h.
(htab_t graphite_transform_loops::bb_pbb_mapping):
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.

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

* Makefile.in: Update to changes above.

Index: gcc/graphite-htab.h
===
--- gcc/graphite-htab.h (revision 0)
+++ gcc/graphite-htab.h (revision 0)
@@ -0,0 +1,60 @@
+/* Translation of CLAST (CLooG AST) to Gimple.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   Contributed by Sebastian Pop sebastian@amd.com.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+http://www.gnu.org/licenses/.  */
+
+#ifndef GCC_GRAPHITE_HTAB_H
+#define GCC_GRAPHITE_HTAB_H
+
+#include hash-table.h
+#include graphite-clast-to-gimple.h
+
+/* Hashtable helpers.  */
+
+struct bb_pbb_hasher : typed_free_remove bb_pbb_def
+{
+  typedef bb_pbb_def value_type;
+  typedef bb_pbb_def compare_type;
+  static inline hashval_t hash (const value_type *);
+  static inline bool equal (const value_type *, const compare_type *);
+};
+
+/* Hash function for data base element BB_PBB.  */
+
+inline hashval_t
+bb_pbb_hasher::hash (const value_type *bb_pbb)
+{
+  return (hashval_t)(bb_pbb-bb-index);
+}
+
+/* Compare data base element PB1 and PB2.  */
+
+inline bool
+bb_pbb_hasher::equal (const value_type *bp1, const compare_type *bp2)
+{
+  return (bp1-bb-index == bp2-bb-index);
+}
+
+typedef hash_table bb_pbb_hasher bb_pbb_htab_type;
+
+extern bool gloog (scop_p, bb_pbb_htab_type);
+poly_bb_p find_pbb_via_hash (bb_pbb_htab_type,