backport: [multiple changes]

2012-08-21  Richard Guenther  <rguenther@suse.de>

	Backport from mainline
	2012-08-16  Richard Guenther  <rguenther@suse.de>

	PR middle-end/54146
	* tree-ssa-loop-niter.c (find_loop_niter_by_eval): Free the
	exit vector.
	* ipa-pure-const.c (analyze_function): Use FOR_EACH_LOOP_BREAK.
	* cfgloop.h (FOR_EACH_LOOP_BREAK): Fix.
	* tree-ssa-structalias.c (handle_lhs_call): Properly free rhsc.
	* tree-ssa-loop-im.c (analyze_memory_references): Adjust.
	(tree_ssa_lim_finalize): Free all mem_refs.
	* tree-ssa-sccvn.c (extract_and_process_scc_for_name): Free
	scc when bailing out.
	* modulo-sched.c (sms_schedule): Use FOR_EACH_LOOP_BREAK.
	* ira-build.c (loop_with_complex_edge_p): Free loop exit vector.
	* graphite-sese-to-poly.c (scop_ivs_can_be_represented): Use
	FOR_EACH_LOOP_BREAK.

	2012-08-17  Richard Guenther  <rguenther@suse.de>

	* tree-sra.c (modify_function): Free redirect_callers vector.
	* ipa-split.c (split_function): Free args_to_pass vector.
	* 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  Richard Guenther  <rguenther@suse.de>
 
	* params.def (integer-share-limit): Decrease from 256 to 251,
	add rationale.

	2012-08-21  Richard Guenther  <rguenther@suse.de>
 
	* tree-ssa-loop-im.c (tree_ssa_lim_finalize): Properly free
	the affine expansion cache.

From-SVN: r190562
This commit is contained in:
Richard Guenther 2012-08-21 13:34:19 +00:00 committed by Richard Biener
parent 296d4d4d98
commit 0b6de004ef
15 changed files with 95 additions and 35 deletions

View File

@ -1,3 +1,44 @@
2012-08-21 Richard Guenther <rguenther@suse.de>
Backport from mainline
2012-08-16 Richard Guenther <rguenther@suse.de>
PR middle-end/54146
* tree-ssa-loop-niter.c (find_loop_niter_by_eval): Free the
exit vector.
* ipa-pure-const.c (analyze_function): Use FOR_EACH_LOOP_BREAK.
* cfgloop.h (FOR_EACH_LOOP_BREAK): Fix.
* tree-ssa-structalias.c (handle_lhs_call): Properly free rhsc.
* tree-ssa-loop-im.c (analyze_memory_references): Adjust.
(tree_ssa_lim_finalize): Free all mem_refs.
* tree-ssa-sccvn.c (extract_and_process_scc_for_name): Free
scc when bailing out.
* modulo-sched.c (sms_schedule): Use FOR_EACH_LOOP_BREAK.
* ira-build.c (loop_with_complex_edge_p): Free loop exit vector.
* graphite-sese-to-poly.c (scop_ivs_can_be_represented): Use
FOR_EACH_LOOP_BREAK.
2012-08-17 Richard Guenther <rguenther@suse.de>
* tree-sra.c (modify_function): Free redirect_callers vector.
* ipa-split.c (split_function): Free args_to_pass vector.
* 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 Richard Guenther <rguenther@suse.de>
* params.def (integer-share-limit): Decrease from 256 to 251,
add rationale.
2012-08-21 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-im.c (tree_ssa_lim_finalize): Properly free
the affine expansion cache.
2012-08-20 Patrick Marlier <patrick.marlier@gmail.com>
Backported from trunk

View File

@ -629,7 +629,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
#define FOR_EACH_LOOP_BREAK(LI) \
{ \
VEC_free (int, heap, (LI)->to_visit); \
VEC_free (int, heap, (LI).to_visit); \
break; \
}

View File

@ -3229,6 +3229,7 @@ scop_ivs_can_be_represented (scop_p scop)
loop_iterator li;
loop_p loop;
gimple_stmt_iterator psi;
bool result = true;
FOR_EACH_LOOP (li, loop, 0)
{
@ -3244,11 +3245,16 @@ scop_ivs_can_be_represented (scop_p scop)
if (TYPE_UNSIGNED (type)
&& TYPE_PRECISION (type) >= TYPE_PRECISION (long_long_integer_type_node))
return false;
{
result = false;
break;
}
}
if (!result)
FOR_EACH_LOOP_BREAK (li);
}
return true;
return result;
}
/* Builds the polyhedral representation for a SESE region. */

View File

@ -803,7 +803,7 @@ end:
if (dump_file)
fprintf (dump_file, " can not prove finiteness of loop %i\n", loop->num);
l->looping =true;
break;
FOR_EACH_LOOP_BREAK (li);
}
scev_finalize ();
}

View File

@ -1239,6 +1239,7 @@ split_function (struct split_point *split_point)
}
call = gimple_build_call_vec (node->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

View File

@ -1843,15 +1843,21 @@ loop_with_complex_edge_p (struct loop *loop)
edge_iterator ei;
edge e;
VEC (edge, heap) *edges;
bool res;
FOR_EACH_EDGE (e, ei, loop->header->preds)
if (e->flags & EDGE_EH)
return true;
edges = get_loop_exit_edges (loop);
res = false;
FOR_EACH_VEC_ELT (edge, edges, i, e)
if (e->flags & EDGE_COMPLEX)
return true;
return false;
{
res = true;
break;
}
VEC_free (edge, heap, edges);
return res;
}
#endif

View File

@ -1416,7 +1416,7 @@ sms_schedule (void)
if (dump_file)
fprintf (dump_file, "SMS reached max limit... \n");
break;
FOR_EACH_LOOP_BREAK (li);
}
if (dump_file)

View File

@ -638,11 +638,12 @@ DEFPARAM(PARAM_MAX_LAST_VALUE_RTL,
/* INTEGER_CST nodes are shared for values [{-1,0} .. N) for
{signed,unsigned} integral types. This determines N.
Experimentation shows 256 to be a good value. */
Experimentation shows 251 to be a good value that generates the
least amount of garbage for allocating the TREE_VEC storage. */
DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
"integer-share-limit",
"The upper bound for sharing integer constants",
256, 2, 2)
251, 2, 2)
/* Incremental SSA updates for virtual operands may be very slow if
there is a large number of mappings to process. In those cases, it

View File

@ -4777,6 +4777,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->decl;
push_cfun (DECL_STRUCT_FUNCTION (new_node->decl));

View File

@ -1480,9 +1480,8 @@ free_mem_ref_locs (mem_ref_locs_p accs)
/* A function to free the mem_ref object OBJ. */
static void
memref_free (void *obj)
memref_free (struct mem_ref *mem)
{
struct mem_ref *const mem = (struct mem_ref *) obj;
unsigned i;
mem_ref_locs_p accs;
@ -1722,8 +1721,7 @@ analyze_memory_references (void)
unsigned i;
bitmap empty;
memory_accesses.refs
= htab_create (100, memref_hash, memref_eq, memref_free);
memory_accesses.refs = htab_create (100, memref_hash, memref_eq, NULL);
memory_accesses.refs_list = NULL;
memory_accesses.refs_in_loop = VEC_alloc (bitmap, heap,
number_of_loops ());
@ -2615,6 +2613,7 @@ tree_ssa_lim_finalize (void)
basic_block bb;
unsigned i;
bitmap b;
mem_ref_p ref;
free_aux_for_edges ();
@ -2623,9 +2622,12 @@ tree_ssa_lim_finalize (void)
pointer_map_destroy (lim_aux_data_map);
VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
htab_delete (memory_accesses.refs);
FOR_EACH_VEC_ELT (mem_ref_p, memory_accesses.refs_list, i, ref)
memref_free (ref);
VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b)
BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.refs_in_loop);
@ -2639,7 +2641,7 @@ tree_ssa_lim_finalize (void)
VEC_free (bitmap, heap, memory_accesses.all_refs_stored_in_loop);
if (memory_accesses.ttae_cache)
pointer_map_destroy (memory_accesses.ttae_cache);
free_affine_expand_cache (&memory_accesses.ttae_cache);
}
/* Moves invariants from loops. Only "expensive" invariants are moved out --

View File

@ -2290,7 +2290,10 @@ find_loop_niter_by_eval (struct loop *loop, edge *exit)
/* Loops with multiple exits are expensive to handle and less important. */
if (!flag_expensive_optimizations
&& VEC_length (edge, exits) > 1)
return chrec_dont_know;
{
VEC_free (edge, heap, exits);
return chrec_dont_know;
}
FOR_EACH_VEC_ELT (edge, exits, i, ex)
{

View File

@ -3590,6 +3590,8 @@ extract_and_process_scc_for_name (tree name)
fprintf (dump_file, "WARNING: Giving up with SCCVN due to "
"SCC size %u exceeding %u\n", VEC_length (tree, scc),
(unsigned)PARAM_VALUE (PARAM_SCCVN_MAX_SCC_SIZE));
VEC_free (tree, heap, scc);
return false;
}

View File

@ -3859,9 +3859,11 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, VEC(ce_s, heap) *rhsc,
tmpc.offset = 0;
tmpc.type = ADDRESSOF;
VEC_safe_push (ce_s, heap, rhsc, &tmpc);
process_all_all_constraints (lhsc, rhsc);
VEC_free (ce_s, heap, rhsc);
}
process_all_all_constraints (lhsc, rhsc);
else
process_all_all_constraints (lhsc, rhsc);
VEC_free (ce_s, heap, lhsc);
}

View File

@ -95,6 +95,7 @@ vect_free_slp_instance (slp_instance instance)
vect_free_slp_tree (SLP_INSTANCE_TREE (instance));
VEC_free (int, heap, SLP_INSTANCE_LOAD_PERMUTATION (instance));
VEC_free (slp_tree, heap, SLP_INSTANCE_LOADS (instance));
free (instance);
}
@ -1567,6 +1568,9 @@ 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 (int, heap, load_permutation);
VEC_free (slp_tree, heap, loads);
return false;
}
@ -1823,8 +1827,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;
@ -1844,6 +1851,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_STRIDED_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));
free (bb_vinfo);
bb->aux = NULL;

View File

@ -3507,22 +3507,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
@ -5695,7 +5679,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_VINFO_INSIDE_OF_LOOP_COST (res) = 0;
STMT_VINFO_OUTSIDE_OF_LOOP_COST (res) = 0;
STMT_SLP_TYPE (res) = loop_vect;