Commit 0de11d4d by Jan Hubicka Committed by Jan Hubicka

dumpfile.c: Include profile-count.h


	* dumpfile.c: Include profile-count.h
	* tree-cfg.c (gimple_duplicate_sese_tail): Drop UNUSED attributes; update
	profile.
	(insert_cond_bb): Update profile.
	* tree-cfg.h (insert_cond_bb): Update prototype.
	* tree-chkp-opt.c (chkp_optimize_string_function_calls): Update.
	* tree-dump.c: Do not include tree-cfg.

From-SVN: r249887
parent d872853d
2017-07-02 Jan Hubicka <hubicka@ucw.cz> 2017-07-02 Jan Hubicka <hubicka@ucw.cz>
* dumpfile.c: Include profile-count.h
* tree-cfg.c (gimple_duplicate_sese_tail): Drop UNUSED attributes; update
profile.
(insert_cond_bb): Update profile.
* tree-cfg.h (insert_cond_bb): Update prototype.
* tree-chkp-opt.c (chkp_optimize_string_function_calls): Update.
* tree-dump.c: Do not include tree-cfg.
2017-07-02 Jan Hubicka <hubicka@ucw.cz>
* bb-reorder.c (fix_up_crossing_landing_pad): Update profile. * bb-reorder.c (fix_up_crossing_landing_pad): Update profile.
2017-07-02 Jan Hubicka <hubicka@ucw.cz> 2017-07-02 Jan Hubicka <hubicka@ucw.cz>
......
...@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h" #include "diagnostic-core.h"
#include "dumpfile.h" #include "dumpfile.h"
#include "context.h" #include "context.h"
#include "profile-count.h"
#include "tree-cfg.h" #include "tree-cfg.h"
#include "langhooks.h" #include "langhooks.h"
......
...@@ -6390,9 +6390,9 @@ bb_part_of_region_p (basic_block bb, basic_block* bbs, unsigned n_region) ...@@ -6390,9 +6390,9 @@ bb_part_of_region_p (basic_block bb, basic_block* bbs, unsigned n_region)
*/ */
bool bool
gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNUSED, gimple_duplicate_sese_tail (edge entry, edge exit,
basic_block *region ATTRIBUTE_UNUSED, unsigned n_region ATTRIBUTE_UNUSED, basic_block *region, unsigned n_region,
basic_block *region_copy ATTRIBUTE_UNUSED) basic_block *region_copy)
{ {
unsigned i; unsigned i;
bool free_region_copy = false; bool free_region_copy = false;
...@@ -6502,7 +6502,12 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU ...@@ -6502,7 +6502,12 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
sorig = single_succ_edge (switch_bb); sorig = single_succ_edge (switch_bb);
sorig->flags = exits[1]->flags; sorig->flags = exits[1]->flags;
sorig->probability = exits[1]->probability;
sorig->count = exits[1]->count;
snew = make_edge (switch_bb, nentry_bb, exits[0]->flags); snew = make_edge (switch_bb, nentry_bb, exits[0]->flags);
snew->probability = exits[0]->probability;
snew->count = exits[1]->count;
/* Register the new edge from SWITCH_BB in loop exit lists. */ /* Register the new edge from SWITCH_BB in loop exit lists. */
rescan_loop_exit (snew, true, false); rescan_loop_exit (snew, true, false);
...@@ -8704,9 +8709,11 @@ make_pass_split_crit_edges (gcc::context *ctxt) ...@@ -8704,9 +8709,11 @@ make_pass_split_crit_edges (gcc::context *ctxt)
/* Insert COND expression which is GIMPLE_COND after STMT /* Insert COND expression which is GIMPLE_COND after STMT
in basic block BB with appropriate basic block split in basic block BB with appropriate basic block split
and creation of a new conditionally executed basic block. and creation of a new conditionally executed basic block.
Update profile so the new bb is visited with probability PROB.
Return created basic block. */ Return created basic block. */
basic_block basic_block
insert_cond_bb (basic_block bb, gimple *stmt, gimple *cond) insert_cond_bb (basic_block bb, gimple *stmt, gimple *cond,
profile_probability prob)
{ {
edge fall = split_block (bb, stmt); edge fall = split_block (bb, stmt);
gimple_stmt_iterator iter = gsi_last_bb (bb); gimple_stmt_iterator iter = gsi_last_bb (bb);
...@@ -8721,11 +8728,17 @@ insert_cond_bb (basic_block bb, gimple *stmt, gimple *cond) ...@@ -8721,11 +8728,17 @@ insert_cond_bb (basic_block bb, gimple *stmt, gimple *cond)
/* Create conditionally executed block. */ /* Create conditionally executed block. */
new_bb = create_empty_bb (bb); new_bb = create_empty_bb (bb);
make_edge (bb, new_bb, EDGE_TRUE_VALUE); edge e = make_edge (bb, new_bb, EDGE_TRUE_VALUE);
e->probability = prob;
e->count = bb->count.apply_probability (prob);
new_bb->count = e->count;
new_bb->frequency = prob.apply (bb->frequency);
make_single_succ_edge (new_bb, fall->dest, EDGE_FALLTHRU); make_single_succ_edge (new_bb, fall->dest, EDGE_FALLTHRU);
/* Fix edge for split bb. */ /* Fix edge for split bb. */
fall->flags = EDGE_FALSE_VALUE; fall->flags = EDGE_FALSE_VALUE;
fall->count -= e->count;
fall->probability -= e->probability;
/* Update dominance info. */ /* Update dominance info. */
if (dom_info_available_p (CDI_DOMINATORS)) if (dom_info_available_p (CDI_DOMINATORS))
......
...@@ -104,7 +104,8 @@ extern tree gimplify_build1 (gimple_stmt_iterator *, enum tree_code, ...@@ -104,7 +104,8 @@ extern tree gimplify_build1 (gimple_stmt_iterator *, enum tree_code,
extern void extract_true_false_edges_from_block (basic_block, edge *, edge *); extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
extern unsigned int execute_fixup_cfg (void); extern unsigned int execute_fixup_cfg (void);
extern unsigned int split_critical_edges (void); extern unsigned int split_critical_edges (void);
extern basic_block insert_cond_bb (basic_block, gimple *, gimple *); extern basic_block insert_cond_bb (basic_block, gimple *, gimple *,
profile_probability);
extern bool gimple_find_sub_bbs (gimple_seq, gimple_stmt_iterator *); extern bool gimple_find_sub_bbs (gimple_seq, gimple_stmt_iterator *);
extern bool extract_true_false_controlled_edges (basic_block, basic_block, extern bool extract_true_false_controlled_edges (basic_block, basic_block,
edge *, edge *); edge *, edge *);
......
...@@ -1052,7 +1052,8 @@ chkp_optimize_string_function_calls (void) ...@@ -1052,7 +1052,8 @@ chkp_optimize_string_function_calls (void)
/* Split block before string function call. */ /* Split block before string function call. */
gsi_prev (&i); gsi_prev (&i);
check_bb = insert_cond_bb (bb, gsi_stmt (i), check); check_bb = insert_cond_bb (bb, gsi_stmt (i), check,
profile_probability::likely ());
/* Set position for checks. */ /* Set position for checks. */
j = gsi_last_bb (check_bb); j = gsi_last_bb (check_bb);
......
...@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h" #include "tree-dump.h"
#include "langhooks.h" #include "langhooks.h"
#include "tree-iterator.h" #include "tree-iterator.h"
#include "tree-cfg.h"
static unsigned int queue (dump_info_p, const_tree, int); static unsigned int queue (dump_info_p, const_tree, int);
static void dump_index (dump_info_p, unsigned int); static void dump_index (dump_info_p, unsigned int);
......
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