diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-17 08:03:54 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-17 08:03:54 +0000 |
commit | 494bbaae2b5244cea9d6874a1f0ec5c20598670b (patch) | |
tree | f5e13f0401d96073f145438cc14798458718ef90 /gcc/tree-ssa-tail-merge.c | |
parent | a4c520802d7ca59a01099503df749de2dedbf501 (diff) | |
download | gcc-494bbaae2b5244cea9d6874a1f0ec5c20598670b.tar.gz |
2012-08-17 Richard Guenther <rguenther@suse.de>
* hash-table.h (class hash_table): Use a descriptor template
argument instead of decomposed element type and support
functions.
(struct pointer_hash): New generic typed pointer-hash.
(struct typed_free_remove, struct typed_noop_remove): Generic
hash_table support pieces.
* coverage.c (struct counts_entry): Add hash_table support
members.
* tree-ssa-ccp.c (gimple_htab): Use pointer_hash.
* tree-ssa-coalesce.c (struct ssa_name_var_hash): New generic
SSA name by SSA_NAME_VAR hash.
(coalesce_ssa_name): Use it.
* tree-ssa-pre.c (struct pre_expr_d): Add hash_table support.
(expression_to_id): Adjust.
(struct expr_pred_trans_d): Add hash_table support.
(phi_translate_table): Adjust.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
(do_regular_insertion): Likewise.
* tree-ssa-tail-merge.c (struct same_succ_def): Add hash_table
support.
(same_succ_htab): Adjust.
(find_same_succ_bb): Likewise.
(find_same_succ): Likewise.
(update_worklist): Likewise.
* tree-ssa-threadupdate.c (struct redirection_data): Add hash_table
support.
(redirection_data): Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190471 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r-- | gcc/tree-ssa-tail-merge.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index ec644ee3541..372096c344c 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -224,10 +224,24 @@ struct same_succ_def bool in_worklist; /* The hash value of the struct. */ hashval_t hashval; + + /* hash_table support. */ + typedef same_succ_def T; + static inline hashval_t hash (const same_succ_def *); + static int equal (const same_succ_def *, const same_succ_def *); + static void remove (same_succ_def *); }; typedef struct same_succ_def *same_succ; typedef const struct same_succ_def *const_same_succ; +/* hash routine for hash_table support, returns hashval of E. */ + +inline hashval_t +same_succ_def::hash (const same_succ_def *e) +{ + return e->hashval; +} + /* A group of bbs where 1 bb from bbs can replace the other bbs. */ struct bb_cluster_def @@ -415,8 +429,8 @@ stmt_update_dep_bb (gimple stmt) /* Calculates hash value for same_succ VE. */ -hashval_t -ssa_same_succ_hash (const_same_succ e) +static hashval_t +same_succ_hash (const_same_succ e) { hashval_t hashval = bitmap_hash (e->succs); int flags; @@ -511,10 +525,10 @@ inverse_flags (const_same_succ e1, const_same_succ e2) return (f1a & mask) == (f2a & mask) && (f1b & mask) == (f2b & mask); } -/* Compares SAME_SUCCs VE1 and VE2. */ +/* Compares SAME_SUCCs E1 and E2. */ int -ssa_same_succ_equal (const_same_succ e1, const_same_succ e2) +same_succ_def::equal (const_same_succ e1, const_same_succ e2) { unsigned int i, first1, first2; gimple_stmt_iterator gsi1, gsi2; @@ -584,10 +598,10 @@ same_succ_alloc (void) return same; } -/* Delete same_succ VE. */ +/* Delete same_succ E. */ -inline void -ssa_same_succ_delete (same_succ e) +void +same_succ_def::remove (same_succ e) { BITMAP_FREE (e->bbs); BITMAP_FREE (e->succs); @@ -608,11 +622,7 @@ same_succ_reset (same_succ same) VEC_truncate (int, same->succ_flags, 0); } -/* Hash table with all same_succ entries. */ - -static hash_table <struct same_succ_def, ssa_same_succ_hash, - ssa_same_succ_equal, ssa_same_succ_delete> - same_succ_htab; +static hash_table <same_succ_def> same_succ_htab; /* Array that is used to store the edge flags for a successor. */ @@ -692,7 +702,7 @@ find_same_succ_bb (basic_block bb, same_succ *same_p) EXECUTE_IF_SET_IN_BITMAP (same->succs, 0, j, bj) VEC_safe_push (int, heap, same->succ_flags, same_succ_edge_flags[j]); - same->hashval = ssa_same_succ_hash (same); + same->hashval = same_succ_hash (same); slot = same_succ_htab.find_slot_with_hash (same, same->hashval, INSERT); if (*slot == NULL) @@ -728,7 +738,7 @@ find_same_succ (void) same = same_succ_alloc (); } - ssa_same_succ_delete (same); + same_succ_def::remove (same); } /* Initializes worklist administration. */ @@ -860,7 +870,7 @@ update_worklist (void) if (same == NULL) same = same_succ_alloc (); } - ssa_same_succ_delete (same); + same_succ_def::remove (same); bitmap_clear (deleted_bb_preds); } |