aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-08-29 18:41:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-08-29 16:41:35 +0000
commitca30a5396af8e55bb19746eeb323de7064da6c46 (patch)
tree9296bef7d6851c797bb4189695298388ef9bef1d /gcc/predict.c
parenta1f626ad3b943f90c164f54abb1d3830c8959782 (diff)
downloadgcc-ca30a5396af8e55bb19746eeb323de7064da6c46.zip
gcc-ca30a5396af8e55bb19746eeb323de7064da6c46.tar.gz
gcc-ca30a5396af8e55bb19746eeb323de7064da6c46.tar.bz2
cgraph.c (cgraph_remove_node): Do not remove nested nodes.
* cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 45fffd3..4e17b9a 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -138,6 +138,27 @@ maybe_hot_bb_p (const_basic_block bb)
return maybe_hot_frequency_p (bb->frequency);
}
+/* Return true if the call can be hot. */
+
+bool
+cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
+{
+ if (profile_info && flag_branch_probabilities
+ && (edge->count
+ <= profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION)))
+ return false;
+ if (lookup_attribute ("cold", DECL_ATTRIBUTES (edge->callee->decl))
+ || lookup_attribute ("cold", DECL_ATTRIBUTES (edge->caller->decl)))
+ return false;
+ if (lookup_attribute ("hot", DECL_ATTRIBUTES (edge->caller->decl)))
+ return true;
+ if (flag_guess_branch_prob
+ && edge->frequency < (CGRAPH_FREQ_MAX
+ / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
+ return false;
+ return true;
+}
+
/* Return true in case BB can be CPU intensive and should be optimized
for maximal performance. */