From efd8f7507b3ce6e4cc00c7eac4f011736ca4f14d Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 29 Aug 2008 12:35:57 +0200 Subject: loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p. * 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. From-SVN: r139760 --- gcc/tree-ssa-coalesce.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'gcc/tree-ssa-coalesce.c') diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index d5e5f87..3af0c32 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -75,7 +75,7 @@ typedef struct coalesce_list_d possibly on CRITICAL edge and in HOT basic block. */ static inline int -coalesce_cost (int frequency, bool hot, bool critical) +coalesce_cost (int frequency, bool optimize_for_size, bool critical) { /* Base costs on BB frequencies bounded by 1. */ int cost = frequency; @@ -83,12 +83,8 @@ coalesce_cost (int frequency, bool hot, bool critical) if (!cost) cost = 1; - if (optimize_size) + if (optimize_for_size) cost = 1; - else - /* It is more important to coalesce in HOT blocks. */ - if (hot) - cost *= 2; /* Inserting copy on critical edge costs more than inserting it elsewhere. */ if (critical) @@ -102,7 +98,7 @@ coalesce_cost (int frequency, bool hot, bool critical) static inline int coalesce_cost_bb (basic_block bb) { - return coalesce_cost (bb->frequency, maybe_hot_bb_p (bb), false); + return coalesce_cost (bb->frequency, optimize_bb_for_size_p (bb), false); } @@ -115,7 +111,7 @@ coalesce_cost_edge (edge e) return MUST_COALESCE_COST; return coalesce_cost (EDGE_FREQUENCY (e), - maybe_hot_edge_p (e), + optimize_edge_for_size_p (e), EDGE_CRITICAL_P (e)); } @@ -1099,7 +1095,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) if (SSA_NAME_VAR (outputs[match]) == SSA_NAME_VAR (input)) { cost = coalesce_cost (REG_BR_PROB_BASE, - maybe_hot_bb_p (bb), + optimize_bb_for_size_p (bb), false); add_coalesce (cl, v1, v2, cost); bitmap_set_bit (used_in_copy, v1); -- cgit v1.1