diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 13:21:35 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 13:21:35 +0000 |
commit | c1f445d2fbea31314327e0ce37f86184a6ae3de7 (patch) | |
tree | b8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/tree-ssa-dom.c | |
parent | d0285fb08b709575f6b35bf46efbae5e1cb3a40a (diff) | |
download | gcc-c1f445d2fbea31314327e0ce37f86184a6ae3de7.tar.gz |
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211936 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index b7ec05b624c..6c581ba7ba5 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -223,7 +223,7 @@ expr_elt_hasher::remove (value_type *element) global redundancy elimination). Similarly as we pass through conditionals we record the conditional itself as having either a true or false value in this table. */ -static hash_table <expr_elt_hasher> avail_exprs; +static hash_table<expr_elt_hasher> *avail_exprs; /* Stack of dest,src pairs that need to be restored during finalization. @@ -254,7 +254,8 @@ static struct opt_stats_d opt_stats; static void optimize_stmt (basic_block, gimple_stmt_iterator); static tree lookup_avail_expr (gimple, bool); static hashval_t avail_expr_hash (const void *); -static void htab_statistics (FILE *, hash_table <expr_elt_hasher>); +static void htab_statistics (FILE *, + const hash_table<expr_elt_hasher> &); static void record_cond (cond_equivalence *); static void record_const_or_copy (tree, tree); static void record_equality (tree, tree); @@ -876,7 +877,7 @@ pass_dominator::execute (function *fun) memset (&opt_stats, 0, sizeof (opt_stats)); /* Create our hash tables. */ - avail_exprs.create (1024); + avail_exprs = new hash_table<expr_elt_hasher> (1024); avail_exprs_stack.create (20); const_and_copies_stack.create (20); need_eh_cleanup = BITMAP_ALLOC (NULL); @@ -976,7 +977,8 @@ pass_dominator::execute (function *fun) loop_optimizer_finalize (); /* Delete our main hashtable. */ - avail_exprs.dispose (); + delete avail_exprs; + avail_exprs = NULL; /* Free asserted bitmaps and stacks. */ BITMAP_FREE (need_eh_cleanup); @@ -1070,9 +1072,9 @@ remove_local_expressions_from_table (void) print_expr_hash_elt (dump_file, victim); } - slot = avail_exprs.find_slot_with_hash (victim, victim->hash, NO_INSERT); + slot = avail_exprs->find_slot (victim, NO_INSERT); gcc_assert (slot && *slot == victim); - avail_exprs.clear_slot (slot); + avail_exprs->clear_slot (slot); } } @@ -1351,7 +1353,7 @@ dump_dominator_optimization_stats (FILE *file) fprintf (file, "\nHash table statistics:\n"); fprintf (file, " avail_exprs: "); - htab_statistics (file, avail_exprs); + htab_statistics (file, *avail_exprs); } @@ -1367,7 +1369,7 @@ debug_dominator_optimization_stats (void) /* Dump statistics for the hash table HTAB. */ static void -htab_statistics (FILE *file, hash_table <expr_elt_hasher> htab) +htab_statistics (FILE *file, const hash_table<expr_elt_hasher> &htab) { fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n", (long) htab.size (), @@ -1388,7 +1390,7 @@ record_cond (cond_equivalence *p) initialize_hash_element_from_expr (&p->cond, p->value, element); - slot = avail_exprs.find_slot_with_hash (element, element->hash, INSERT); + slot = avail_exprs->find_slot_with_hash (element, element->hash, INSERT); if (*slot == NULL) { *slot = element; @@ -2551,8 +2553,7 @@ lookup_avail_expr (gimple stmt, bool insert) return NULL_TREE; /* Finally try to find the expression in the main expression hash table. */ - slot = avail_exprs.find_slot_with_hash (&element, element.hash, - (insert ? INSERT : NO_INSERT)); + slot = avail_exprs->find_slot (&element, (insert ? INSERT : NO_INSERT)); if (slot == NULL) { free_expr_hash_elt_contents (&element); |