From: Richard Guenther Date: Fri, 17 Aug 2012 07:51:31 +0000 (+0000) Subject: tree-sra.c (modify_function): Free redirect_callers vector. X-Git-Tag: misc/gccgo-go1_1_2~1331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7e62a2691e3b8c9aef74f7fe25ca00ac72ce6b7;p=thirdparty%2Fgcc.git tree-sra.c (modify_function): Free redirect_callers vector. 2012-08-17 Richard Guenther * tree-sra.c (modify_function): Free redirect_callers vector. * ipa-split.c (split_function): Free args_to_pass vector. * tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost): Free body_cost_vec properly. (vect_enhance_data_refs_alignment): Likewise. * tree-vect-stmts.c (vectorizable_operation): Do not pre-allocate vec_oprnds. (new_stmt_vec_info): Do not pre-allocate STMT_VINFO_SAME_ALIGN_REFS. * tree-vect-slp.c (vect_free_slp_instance): Free the instance. (vect_analyze_slp_instance): Free everything. (destroy_bb_vec_info): Free the SLP instances. From-SVN: r190469 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7f8d1c2b89d..a90ec55ba42d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2012-08-17 Richard Guenther + + * tree-sra.c (modify_function): Free redirect_callers vector. + * ipa-split.c (split_function): Free args_to_pass vector. + * tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost): Free + body_cost_vec properly. + (vect_enhance_data_refs_alignment): Likewise. + * tree-vect-stmts.c (vectorizable_operation): Do not pre-allocate + vec_oprnds. + (new_stmt_vec_info): Do not pre-allocate STMT_VINFO_SAME_ALIGN_REFS. + * tree-vect-slp.c (vect_free_slp_instance): Free the instance. + (vect_analyze_slp_instance): Free everything. + (destroy_bb_vec_info): Free the SLP instances. + 2012-08-17 Iain Sandoe * config/rs6000/rs6000.c (macho_branch_islands): Adjust for changes diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 3eec70c78f43..be1d2cce2309 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -1230,6 +1230,7 @@ split_function (struct split_point *split_point) } call = gimple_build_call_vec (node->symbol.decl, args_to_pass); gimple_set_block (call, DECL_INITIAL (current_function_decl)); + VEC_free (tree, heap, args_to_pass); /* We avoid address being taken on any variable used by split part, so return slot optimization is always possible. Moreover this is diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 504f9a8b433f..cc7becdc3191 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -4698,6 +4698,8 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments) new_node = cgraph_function_versioning (node, redirect_callers, NULL, NULL, false, NULL, NULL, "isra"); + VEC_free (cgraph_edge_p, heap, redirect_callers); + current_function_decl = new_node->symbol.decl; push_cfun (DECL_STRUCT_FUNCTION (new_node->symbol.decl)); diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 6a02986cc800..4df2e50f9bf4 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1368,6 +1368,7 @@ vect_peeling_hash_get_lowest_cost (void **slot, void *data) { min->inside_cost = inside_cost; min->outside_cost = outside_cost; + VEC_free (stmt_info_for_cost, heap, min->body_cost_vec); min->body_cost_vec = body_cost_vec; min->peel_info.dr = elem->dr; min->peel_info.npeel = elem->npeel; @@ -1880,7 +1881,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) if (!stat) do_peeling = false; else - return stat; + { + VEC_free (stmt_info_for_cost, heap, body_cost_vec); + return stat; + } } if (do_peeling) @@ -1930,6 +1934,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) gcc_assert (stat); return stat; } + else + VEC_free (stmt_info_for_cost, heap, body_cost_vec); } diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index a4c7483a5b89..01575b43d636 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -94,6 +94,7 @@ vect_free_slp_instance (slp_instance instance) VEC_free (int, heap, SLP_INSTANCE_LOAD_PERMUTATION (instance)); VEC_free (slp_tree, heap, SLP_INSTANCE_LOADS (instance)); VEC_free (stmt_info_for_cost, heap, SLP_INSTANCE_BODY_COST_VEC (instance)); + free (instance); } @@ -1581,8 +1582,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, if (vect_print_dump_info (REPORT_SLP)) fprintf (vect_dump, "Build SLP failed: unrolling required in basic" " block SLP"); + vect_free_slp_tree (node); VEC_free (stmt_info_for_cost, heap, body_cost_vec); VEC_free (stmt_info_for_cost, heap, prologue_cost_vec); + VEC_free (int, heap, load_permutation); + VEC_free (slp_tree, heap, loads); return false; } @@ -1858,8 +1862,11 @@ new_bb_vec_info (basic_block bb) static void destroy_bb_vec_info (bb_vec_info bb_vinfo) { + VEC (slp_instance, heap) *slp_instances; + slp_instance instance; basic_block bb; gimple_stmt_iterator si; + unsigned i; if (!bb_vinfo) return; @@ -1879,6 +1886,9 @@ destroy_bb_vec_info (bb_vec_info bb_vinfo) free_data_refs (BB_VINFO_DATAREFS (bb_vinfo)); free_dependence_relations (BB_VINFO_DDRS (bb_vinfo)); VEC_free (gimple, heap, BB_VINFO_GROUPED_STORES (bb_vinfo)); + slp_instances = BB_VINFO_SLP_INSTANCES (bb_vinfo); + FOR_EACH_VEC_ELT (slp_instance, slp_instances, i, instance) + vect_free_slp_instance (instance); VEC_free (slp_instance, heap, BB_VINFO_SLP_INSTANCES (bb_vinfo)); destroy_cost_data (BB_VINFO_TARGET_COST_DATA (bb_vinfo)); free (bb_vinfo); diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 491b2391f882..706b0bc6e934 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3585,22 +3585,6 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi, /* Handle def. */ vec_dest = vect_create_destination_var (scalar_dest, vectype); - /* Allocate VECs for vector operands. In case of SLP, vector operands are - created in the previous stages of the recursion, so no allocation is - needed, except for the case of shift with scalar shift argument. In that - case we store the scalar operand in VEC_OPRNDS1 for every vector stmt to - be created to vectorize the SLP group, i.e., SLP_NODE->VEC_STMTS_SIZE. - In case of loop-based vectorization we allocate VECs of size 1. We - allocate VEC_OPRNDS1 only in case of binary operation. */ - if (!slp_node) - { - vec_oprnds0 = VEC_alloc (tree, heap, 1); - if (op_type == binary_op || op_type == ternary_op) - vec_oprnds1 = VEC_alloc (tree, heap, 1); - if (op_type == ternary_op) - vec_oprnds2 = VEC_alloc (tree, heap, 1); - } - /* In case the vectorization factor (VF) is bigger than the number of elements that we can fit in a vectype (nunits), we have to generate more than one vector stmt - i.e - we need to "unroll" the @@ -5866,7 +5850,7 @@ new_stmt_vec_info (gimple stmt, loop_vec_info loop_vinfo, else STMT_VINFO_DEF_TYPE (res) = vect_internal_def; - STMT_VINFO_SAME_ALIGN_REFS (res) = VEC_alloc (dr_p, heap, 5); + STMT_VINFO_SAME_ALIGN_REFS (res) = NULL; STMT_SLP_TYPE (res) = loop_vect; GROUP_FIRST_ELEMENT (res) = NULL; GROUP_NEXT_ELEMENT (res) = NULL;