summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-29 10:52:16 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-29 10:52:16 +0000
commit7dfb44a02c99c300d7ae193feeda825148b28993 (patch)
treea553c86e8031502bd1ab3bdb7e5a7c83ff5e1088 /gcc/cfgexpand.c
parent1306a30fca6da9294f3a7750135cb0e6f8cebd3f (diff)
downloadgcc-7dfb44a02c99c300d7ae193feeda825148b28993.tar.gz
* predict.c (always_optimize_for_size_p): New function.
(optimize_bb_for_size_p, optimize_bb_for_speed_p, optimize_edge_for_size_p, optimize_edge_for_speed_p, optimize_insn_for_size_p, optimize_insn_for_speed_p): New global functions. (rtl_profile_for_bb, rtl_profile_for_edge, rtl_default_profile): New. * function.c (prepare_function_start): Set default profile. * function.h (rtl_data): Add maybe_hot_insn_p. * cfgexpand.c (expand_gimple_basic_block): Set RTL profile. (construct_exit_block): Likewise. (tree_expand_cfg): Likewise. * basic-block.h (optimize_bb_for_size_p, optimize_bb_for_speed_p, optimize_edge_for_size_p, optimize_edge_for_speed_p, optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare. (rtl_profile_for_bb, rtl_profile_for_edge, default_rtl_profile): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138237 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index b4c33ab8193..6040b4460c2 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1798,6 +1798,7 @@ expand_gimple_basic_block (basic_block bb)
access the BB sequence directly. */
stmts = bb_seq (bb);
bb->il.gimple = NULL;
+ rtl_profile_for_bb (bb);
init_rtl_bb_info (bb);
bb->flags |= BB_RTL;
@@ -2020,6 +2021,8 @@ construct_exit_block (void)
edge_iterator ei;
rtx orig_end = BB_END (EXIT_BLOCK_PTR->prev_bb);
+ rtl_profile_for_bb (EXIT_BLOCK_PTR);
+
/* Make sure the locus is set to the end of the function, so that
epilogue line numbers and warnings are set properly. */
if (cfun->function_end_locus != UNKNOWN_LOCATION)
@@ -2153,6 +2156,8 @@ gimple_expand_cfg (void)
/* Some backends want to know that we are expanding to RTL. */
currently_expanding_to_rtl = 1;
+ rtl_profile_for_bb (ENTRY_BLOCK_PTR);
+
insn_locators_alloc ();
if (!DECL_BUILT_IN (current_function_decl))
set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl));
@@ -2216,6 +2221,9 @@ gimple_expand_cfg (void)
lab_rtx_for_bb = pointer_map_create ();
FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb)
bb = expand_gimple_basic_block (bb);
+
+ /* Expansion is used by optimization passes too, set maybe_hot_insn_p
+ conservatively to true until they are all profile aware. */
pointer_map_destroy (lab_rtx_for_bb);
free_histograms ();
@@ -2284,6 +2292,7 @@ gimple_expand_cfg (void)
/* Tag the blocks with a depth number so that change_scope can find
the common parent easily. */
set_block_levels (DECL_INITIAL (cfun->decl), 0);
+ default_rtl_profile ();
return 0;
}