aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-06-24 13:21:35 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-06-24 13:21:35 +0000
commitc203e8a73b2f12a1da52a16a0c4a50e62b42445b (patch)
treeb8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/loop-unroll.c
parentfbc2a724d481bb5c205baeaaa955533451226d01 (diff)
downloadgcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.zip
gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.gz
gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.bz2
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. From-SVN: r211936
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 4ce0830..ad4d3c2 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -161,11 +161,11 @@ var_expand_hasher::equal (const value_type *i1, const compare_type *i2)
struct opt_info
{
- hash_table <iv_split_hasher> insns_to_split; /* A hashtable of insns to
+ hash_table<iv_split_hasher> *insns_to_split; /* A hashtable of insns to
split. */
struct iv_to_split *iv_to_split_head; /* The first iv to split. */
struct iv_to_split **iv_to_split_tail; /* Pointer to the tail of the list. */
- hash_table <var_expand_hasher> insns_with_var_to_expand; /* A hashtable of
+ hash_table<var_expand_hasher> *insns_with_var_to_expand; /* A hashtable of
insns with accumulators to expand. */
struct var_to_expand *var_to_expand_head; /* The first var to expand. */
struct var_to_expand **var_to_expand_tail; /* Pointer to the tail of the list. */
@@ -1974,7 +1974,8 @@ analyze_insns_in_loop (struct loop *loop)
if (flag_split_ivs_in_unroller)
{
- opt_info->insns_to_split.create (5 * loop->num_nodes);
+ opt_info->insns_to_split
+ = new hash_table<iv_split_hasher> (5 * loop->num_nodes);
opt_info->iv_to_split_head = NULL;
opt_info->iv_to_split_tail = &opt_info->iv_to_split_head;
}
@@ -1995,7 +1996,8 @@ analyze_insns_in_loop (struct loop *loop)
if (flag_variable_expansion_in_unroller
&& can_apply)
{
- opt_info->insns_with_var_to_expand.create (5 * loop->num_nodes);
+ opt_info->insns_with_var_to_expand
+ = new hash_table<var_expand_hasher> (5 * loop->num_nodes);
opt_info->var_to_expand_head = NULL;
opt_info->var_to_expand_tail = &opt_info->var_to_expand_head;
}
@@ -2011,12 +2013,12 @@ analyze_insns_in_loop (struct loop *loop)
if (!INSN_P (insn))
continue;
- if (opt_info->insns_to_split.is_created ())
+ if (opt_info->insns_to_split)
ivts = analyze_iv_to_split_insn (insn);
if (ivts)
{
- slot1 = opt_info->insns_to_split.find_slot (ivts, INSERT);
+ slot1 = opt_info->insns_to_split->find_slot (ivts, INSERT);
gcc_assert (*slot1 == NULL);
*slot1 = ivts;
*opt_info->iv_to_split_tail = ivts;
@@ -2024,12 +2026,12 @@ analyze_insns_in_loop (struct loop *loop)
continue;
}
- if (opt_info->insns_with_var_to_expand.is_created ())
+ if (opt_info->insns_with_var_to_expand)
ves = analyze_insn_to_expand_var (loop, insn);
if (ves)
{
- slot2 = opt_info->insns_with_var_to_expand.find_slot (ves, INSERT);
+ slot2 = opt_info->insns_with_var_to_expand->find_slot (ves, INSERT);
gcc_assert (*slot2 == NULL);
*slot2 = ves;
*opt_info->var_to_expand_tail = ves;
@@ -2407,7 +2409,7 @@ apply_opt_in_copies (struct opt_info *opt_info,
gcc_assert (!unrolling || rewrite_original_loop);
/* Allocate the basic variables (i0). */
- if (opt_info->insns_to_split.is_created ())
+ if (opt_info->insns_to_split)
for (ivts = opt_info->iv_to_split_head; ivts; ivts = ivts->next)
allocate_basic_variable (ivts);
@@ -2441,11 +2443,11 @@ apply_opt_in_copies (struct opt_info *opt_info,
ve_templ.insn = orig_insn;
/* Apply splitting iv optimization. */
- if (opt_info->insns_to_split.is_created ())
+ if (opt_info->insns_to_split)
{
maybe_strip_eq_note_for_split_iv (opt_info, insn);
- ivts = opt_info->insns_to_split.find (&ivts_templ);
+ ivts = opt_info->insns_to_split->find (&ivts_templ);
if (ivts)
{
@@ -2458,10 +2460,10 @@ apply_opt_in_copies (struct opt_info *opt_info,
}
}
/* Apply variable expansion optimization. */
- if (unrolling && opt_info->insns_with_var_to_expand.is_created ())
+ if (unrolling && opt_info->insns_with_var_to_expand)
{
ves = (struct var_to_expand *)
- opt_info->insns_with_var_to_expand.find (&ve_templ);
+ opt_info->insns_with_var_to_expand->find (&ve_templ);
if (ves)
{
gcc_assert (GET_CODE (PATTERN (insn))
@@ -2478,7 +2480,7 @@ apply_opt_in_copies (struct opt_info *opt_info,
/* Initialize the variable expansions in the loop preheader
and take care of combining them at the loop exit. */
- if (opt_info->insns_with_var_to_expand.is_created ())
+ if (opt_info->insns_with_var_to_expand)
{
for (ves = opt_info->var_to_expand_head; ves; ves = ves->next)
insert_var_expansion_initialization (ves, opt_info->loop_preheader);
@@ -2509,12 +2511,12 @@ apply_opt_in_copies (struct opt_info *opt_info,
continue;
ivts_templ.insn = orig_insn;
- if (opt_info->insns_to_split.is_created ())
+ if (opt_info->insns_to_split)
{
maybe_strip_eq_note_for_split_iv (opt_info, orig_insn);
ivts = (struct iv_to_split *)
- opt_info->insns_to_split.find (&ivts_templ);
+ opt_info->insns_to_split->find (&ivts_templ);
if (ivts)
{
if (!delta)
@@ -2533,15 +2535,16 @@ apply_opt_in_copies (struct opt_info *opt_info,
static void
free_opt_info (struct opt_info *opt_info)
{
- if (opt_info->insns_to_split.is_created ())
- opt_info->insns_to_split.dispose ();
- if (opt_info->insns_with_var_to_expand.is_created ())
+ delete opt_info->insns_to_split;
+ opt_info->insns_to_split = NULL;
+ if (opt_info->insns_with_var_to_expand)
{
struct var_to_expand *ves;
for (ves = opt_info->var_to_expand_head; ves; ves = ves->next)
ves->var_expansions.release ();
- opt_info->insns_with_var_to_expand.dispose ();
+ delete opt_info->insns_with_var_to_expand;
+ opt_info->insns_with_var_to_expand = NULL;
}
free (opt_info);
}