diff options
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r-- | gcc/loop-unroll.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 4ce0830c4ca..ad4d3c2da50 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); } |