summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-29 10:35:57 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-29 10:35:57 +0000
commit0bfd8d5c472a9e897b1f5636d4bc1a69a0fe6251 (patch)
tree1c6f479b4b71cd53544bd1eb2bcc1d8b5055b58e /gcc/bb-reorder.c
parent8b818e6049e7db28105650ed1ecf6be0792c0c1e (diff)
downloadgcc-0bfd8d5c472a9e897b1f5636d4bc1a69a0fe6251.tar.gz
* loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p.
* tree-ssa-threadupdate.c (mark_threaded_blocks): Use optimize_function_for_size_p. * tracer.c (ignore_bb_p): Use optimize_bb_for_size_p. * postreload-gcse.c (eliminate_partially_redundant_load): Use optimize_bb_for_size_p. * value-prof.c (gimple_divmod_fixed_value_transform, gimple_mod_pow2_value_transform, gimple_mod_subtract_transform, gimple_stringops_transform): Use optimize_bb_for_size_p. * ipa-cp.c (ipcp_insert_stage): Use optimize_function_for_size_p. * final.c (compute_alignments): Use optimize_function_for_size_p. * builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p. (fold_builtin_strcpy, fold_builtin_fputs): Use optimize_function_for_size_p. * fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p. * recog.c (relax_delay_slots): Likewise. * tree-ssa-math-opts.c (replace_reciprocal): Use optimize_bb_for_speed_p. (execute_cse_reciprocals): Use optimize_bb_for_size_p. * ipa-inline.c (cgraph_decide_recursive_inlining): Use optimize_function_for_size_p. (cgraph_decide_inlining_of_small_function): Use optimize_function_for_size_p. * global.c (find_reg): Use optimize_function_for_size_p. * opts.c (decode_options): Do not clear flag_tree_ch, flag_inline_functions, flag_unswitch_loops, flag_unroll_loops, flag_unroll_all_loops and flag_prefetch_loop_arrays. Those can work it out from profile. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use optimize_loop_for_speed_p. * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify argument. (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New. * tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p. * tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p. * local-alloc.c (block_alloc): Pass BB pointer. (find_free_reg): Add BB pointer, use optimize_bb_for_size_p. * gcse.c (gcse_main): Use optimize_function_for_size_p. * loop-unroll.c (decide_unrolling_and_peeling): Use optimize_loop_for_size_p. (decide_peel_completely): Likewise. * tree-vect-analyze.c (vect_mark_for_runtime_alias_test): Use optimize_loop_for_size_p. (vect_enhance_data_refs_alignment): Likewise. * tree-ssa-coalesce.c (coalesce_cost): Add optimize_for_size argument. (coalesce_cost_bb, coalesce_cost_edge, create_outofssa_var_map): Update call. * cfgcleanup.c (outgoing_edges_match): Use optimize_bb_for_speed_p. (try_crossjump_bb): Use optimize_bb_for_size_p. * tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Use optimize_loop_for_speed_p. * bb-reorder.c (find_traces_1_round): Likewise. (copy_bb): Use optimize_bb_for_speed_p. (duplicate_computed_gotos): Likewise. * basic-block.h (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New. * stmt.c (expand_case): Use optimize_insn_for_size_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index ae24c0c3245..3bf2dc72c7e 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -648,7 +648,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
/* The loop has less than 4 iterations. */
if (single_succ_p (bb)
- && copy_bb_p (best_edge->dest, !optimize_size))
+ && copy_bb_p (best_edge->dest,
+ optimize_edge_for_speed_p (best_edge)))
{
bb = copy_bb (best_edge->dest, best_edge, bb,
*n_traces);
@@ -1102,7 +1103,7 @@ connect_traces (int n_traces, struct trace *traces)
edge is traversed frequently enough. */
if (try_copy
&& copy_bb_p (best->dest,
- !optimize_size
+ optimize_edge_for_speed_p (best)
&& EDGE_FREQUENCY (best) >= freq_threshold
&& best->count >= count_threshold))
{
@@ -1173,7 +1174,7 @@ copy_bb_p (const_basic_block bb, int code_may_grow)
if (EDGE_COUNT (bb->succs) > 8)
return false;
- if (code_may_grow && maybe_hot_bb_p (bb))
+ if (code_may_grow && optimize_bb_for_speed_p (bb))
max_size *= PARAM_VALUE (PARAM_MAX_GROW_COPY_BB_INSNS);
FOR_BB_INSNS (bb, insn)
@@ -1984,7 +1985,7 @@ gate_duplicate_computed_gotos (void)
{
if (targetm.cannot_modify_jumps_p ())
return false;
- return (optimize > 0 && flag_expensive_optimizations && !optimize_size);
+ return (optimize > 0 && flag_expensive_optimizations);
}
@@ -2075,6 +2076,9 @@ duplicate_computed_gotos (void)
|| single_pred_p (single_succ (bb)))
continue;
+ if (!optimize_bb_for_size_p (bb))
+ continue;
+
/* The successor block has to be a duplication candidate. */
if (!bitmap_bit_p (candidates, single_succ (bb)->index))
continue;