Commit dd172744 by Richard Biener Committed by Richard Biener

bb-reorder.c (sanitize_hot_paths): Release hot_bbs_to_check.

2018-05-04  Richard Biener  <rguenther@suse.de>

	* bb-reorder.c (sanitize_hot_paths): Release hot_bbs_to_check.
	* gimple-ssa-store-merging.c
	(imm_store_chain_info::output_merged_store): Remove redundant create,
	release split_store vector contents on failure.
	* tree-vect-slp.c (vect_schedule_slp_instance): Avoid leaking
	scalar stmt vector on cache hit.

From-SVN: r259932
parent 2c2aa74d
2018-05-04 Richard Biener <rguenther@suse.de>
* bb-reorder.c (sanitize_hot_paths): Release hot_bbs_to_check.
* gimple-ssa-store-merging.c
(imm_store_chain_info::output_merged_store): Remove redundant create,
release split_store vector contents on failure.
* tree-vect-slp.c (vect_schedule_slp_instance): Avoid leaking
scalar stmt vector on cache hit.
2018-05-04 Segher Boessenkool <segher@kernel.crashing.org> 2018-05-04 Segher Boessenkool <segher@kernel.crashing.org>
* common/config/rs6000/rs6000-common.c (rs6000_handle_option): Remove * common/config/rs6000/rs6000-common.c (rs6000_handle_option): Remove
......
...@@ -1572,6 +1572,7 @@ sanitize_hot_paths (bool walk_up, unsigned int cold_bb_count, ...@@ -1572,6 +1572,7 @@ sanitize_hot_paths (bool walk_up, unsigned int cold_bb_count,
hot_bbs_to_check.safe_push (reach_bb); hot_bbs_to_check.safe_push (reach_bb);
} }
} }
hot_bbs_to_check.release ();
return cold_bb_count; return cold_bb_count;
} }
......
...@@ -3343,6 +3343,8 @@ invert_op (split_store *split_store, int idx, tree int_type, tree &mask) ...@@ -3343,6 +3343,8 @@ invert_op (split_store *split_store, int idx, tree int_type, tree &mask)
bool bool
imm_store_chain_info::output_merged_store (merged_store_group *group) imm_store_chain_info::output_merged_store (merged_store_group *group)
{ {
split_store *split_store;
unsigned int i;
unsigned HOST_WIDE_INT start_byte_pos unsigned HOST_WIDE_INT start_byte_pos
= group->bitregion_start / BITS_PER_UNIT; = group->bitregion_start / BITS_PER_UNIT;
...@@ -3351,7 +3353,6 @@ imm_store_chain_info::output_merged_store (merged_store_group *group) ...@@ -3351,7 +3353,6 @@ imm_store_chain_info::output_merged_store (merged_store_group *group)
return false; return false;
auto_vec<struct split_store *, 32> split_stores; auto_vec<struct split_store *, 32> split_stores;
split_stores.create (0);
bool allow_unaligned_store bool allow_unaligned_store
= !STRICT_ALIGNMENT && PARAM_VALUE (PARAM_STORE_MERGING_ALLOW_UNALIGNED); = !STRICT_ALIGNMENT && PARAM_VALUE (PARAM_STORE_MERGING_ALLOW_UNALIGNED);
bool allow_unaligned_load = allow_unaligned_store; bool allow_unaligned_load = allow_unaligned_store;
...@@ -3378,6 +3379,8 @@ imm_store_chain_info::output_merged_store (merged_store_group *group) ...@@ -3378,6 +3379,8 @@ imm_store_chain_info::output_merged_store (merged_store_group *group)
fprintf (dump_file, "Exceeded original number of stmts (%u)." fprintf (dump_file, "Exceeded original number of stmts (%u)."
" Not profitable to emit new sequence.\n", " Not profitable to emit new sequence.\n",
orig_num_stmts); orig_num_stmts);
FOR_EACH_VEC_ELT (split_stores, i, split_store)
delete split_store;
return false; return false;
} }
if (total_orig <= total_new) if (total_orig <= total_new)
...@@ -3389,6 +3392,8 @@ imm_store_chain_info::output_merged_store (merged_store_group *group) ...@@ -3389,6 +3392,8 @@ imm_store_chain_info::output_merged_store (merged_store_group *group)
" not larger than estimated number of new" " not larger than estimated number of new"
" stmts (%u).\n", " stmts (%u).\n",
total_orig, total_new); total_orig, total_new);
FOR_EACH_VEC_ELT (split_stores, i, split_store)
delete split_store;
return false; return false;
} }
...@@ -3453,8 +3458,6 @@ imm_store_chain_info::output_merged_store (merged_store_group *group) ...@@ -3453,8 +3458,6 @@ imm_store_chain_info::output_merged_store (merged_store_group *group)
} }
gimple *stmt = NULL; gimple *stmt = NULL;
split_store *split_store;
unsigned int i;
auto_vec<gimple *, 32> orig_stmts; auto_vec<gimple *, 32> orig_stmts;
gimple_seq this_seq; gimple_seq this_seq;
tree addr = force_gimple_operand_1 (unshare_expr (base_addr), &this_seq, tree addr = force_gimple_operand_1 (unshare_expr (base_addr), &this_seq,
......
...@@ -4064,15 +4064,15 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance, ...@@ -4064,15 +4064,15 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance,
/* See if we have already vectorized the same set of stmts and reuse their /* See if we have already vectorized the same set of stmts and reuse their
vectorized stmts. */ vectorized stmts. */
slp_tree &leader if (slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node)))
= bst_map->get_or_insert (SLP_TREE_SCALAR_STMTS (node).copy ());
if (leader)
{ {
SLP_TREE_VEC_STMTS (node).safe_splice (SLP_TREE_VEC_STMTS (leader)); SLP_TREE_VEC_STMTS (node).safe_splice (SLP_TREE_VEC_STMTS (*leader));
SLP_TREE_NUMBER_OF_VEC_STMTS (node)
= SLP_TREE_NUMBER_OF_VEC_STMTS (*leader);
return false; return false;
} }
leader = node; bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
vect_schedule_slp_instance (child, instance, bst_map); vect_schedule_slp_instance (child, instance, bst_map);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment