diff options
author | Andrey Belevantsev <abel@ispras.ru> | 2008-06-02 10:42:38 +0000 |
---|---|---|
committer | Andrey Belevantsev <abel@ispras.ru> | 2008-06-02 10:42:38 +0000 |
commit | d8453d61bf3904e852b1304f82bca34976e4e3ec (patch) | |
tree | 895afa1914b4b7f0f500d250c01d52fda2d77cf3 | |
parent | 8b5fcf15e0840d539f0a28ff0df9f87fdd580450 (diff) |
* cfghooks.h (rtl_delete_block_not_barriers): Remove prototype.
* cfghooks.c (rtl_delete_block_not_barriers, rtl_delete_block_1,
get_last_bb_insn_1): Remove.
* sel-sched-ir.c (sel_register_cfg_hooks): Do not set
delete_basic_block in sel_cfg_hooks.
(remove_empty_bb): When the pred edge is fall thru, redirect it
via redirect_edge_succ instead of sel_redirect_edge_and_branch.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/sel-sched-branch@136274 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.sel-sched | 10 | ||||
-rw-r--r-- | gcc/cfghooks.h | 2 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 51 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 10 |
4 files changed, 29 insertions, 44 deletions
diff --git a/gcc/ChangeLog.sel-sched b/gcc/ChangeLog.sel-sched index 0f762ba7c39..5eed439455b 100644 --- a/gcc/ChangeLog.sel-sched +++ b/gcc/ChangeLog.sel-sched @@ -1,5 +1,15 @@ 2008-06-02 Andrey Belevantsev <abel@ispras.ru> + * cfghooks.h (rtl_delete_block_not_barriers): Remove prototype. + * cfghooks.c (rtl_delete_block_not_barriers, rtl_delete_block_1, + get_last_bb_insn_1): Remove. + * sel-sched-ir.c (sel_register_cfg_hooks): Do not set + delete_basic_block in sel_cfg_hooks. + (remove_empty_bb): When the pred edge is fall thru, redirect it + via redirect_edge_succ instead of sel_redirect_edge_and_branch. + +2008-06-02 Andrey Belevantsev <abel@ispras.ru> + * sel-sched-ir.c (tidy_control_flow): Do not assume that next_bb equals to single_succ when the successor is EXIT block. Tidy. diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h index 57c3cc1c4ce..f6d2d1105d9 100644 --- a/gcc/cfghooks.h +++ b/gcc/cfghooks.h @@ -180,8 +180,6 @@ extern void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block, extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block, void *); -extern void rtl_delete_block_not_barriers (basic_block); - /* Hooks containers. */ extern struct cfg_hooks tree_cfg_hooks; extern struct cfg_hooks rtl_cfg_hooks; diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index c960525cda0..a42063b6c4c 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -79,7 +79,6 @@ static basic_block rtl_split_block (basic_block, void *); static void rtl_dump_bb (basic_block, FILE *, int); static int rtl_verify_flow_info_1 (void); static void rtl_make_forwarder_block (edge); -static rtx get_last_bb_insn_1 (basic_block, bool); /* Return true if NOTE is not one of the ones that must be kept paired, so that we may simply delete it. */ @@ -363,17 +362,16 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) return newbb; } - /* Delete the insns in a (non-live) block. We physically delete every non-deleted-note insn, and update the flow graph appropriately. - If INCLUDE_BARRIERS_P is true, also delete barriers after the block. + Return nonzero if we deleted an exception handler. */ /* ??? Preserving all such notes strikes me as wrong. It would be nice to post-process the stream to remove empty blocks, loops, ranges, etc. */ static void -rtl_delete_block_1 (basic_block b, bool include_barriers_p) +rtl_delete_block (basic_block b) { rtx insn, end; @@ -384,7 +382,7 @@ rtl_delete_block_1 (basic_block b, bool include_barriers_p) if (LABEL_P (insn)) maybe_remove_eh_handler (insn); - end = get_last_bb_insn_1 (b, include_barriers_p); + end = get_last_bb_insn (b); /* Selectively delete the entire chain. */ BB_HEAD (b) = NULL; @@ -395,20 +393,6 @@ rtl_delete_block_1 (basic_block b, bool include_barriers_p) fprintf (dump_file, "deleting block %d\n", b->index); df_bb_delete (b->index); } - -/* Delete the insns in a block B together with any barriers after it. */ -static void -rtl_delete_block (basic_block b) -{ - rtl_delete_block_1 (b, true); -} - -/* The same as above, but after-block barriers are left untouched. */ -void -rtl_delete_block_not_barriers (basic_block b) -{ - rtl_delete_block_1 (b, false); -} /* Records the basic block struct in BLOCK_FOR_INSN for every insn. */ @@ -1688,10 +1672,10 @@ update_br_prob_note (basic_block bb) XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability); } -/* Get the last insn associated with block BB (that includes tablejumps and, if - INCLUDE_BARRIERS_P, barriers after BB). */ -static rtx -get_last_bb_insn_1 (basic_block bb, bool include_barriers_p) +/* Get the last insn associated with block BB (that includes barriers and + tablejumps after BB). */ +rtx +get_last_bb_insn (basic_block bb) { rtx tmp; rtx end = BB_END (bb); @@ -1700,29 +1684,16 @@ get_last_bb_insn_1 (basic_block bb, bool include_barriers_p) if (tablejump_p (end, NULL, &tmp)) end = tmp; - if (include_barriers_p) - /* Include any barriers that may follow the basic block. */ + /* Include any barriers that may follow the basic block. */ + tmp = next_nonnote_insn (end); + while (tmp && BARRIER_P (tmp)) { + end = tmp; tmp = next_nonnote_insn (end); - - while (tmp != NULL_RTX && BARRIER_P (tmp)) - { - end = tmp; - tmp = next_nonnote_insn (end); - } } return end; } - -/* Get the last insn associated with block BB (that includes barriers and - tablejumps after BB). */ -rtx -get_last_bb_insn (basic_block bb) -{ - return get_last_bb_insn_1 (bb, true); -} - /* Verify the CFG and RTL consistency common for both underlying RTL and cfglayout RTL. diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 727fe371e9c..65da9e08362 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -5257,7 +5257,14 @@ remove_empty_bb (basic_block empty_bb, bool remove_from_cfg_p) succ = NULL; if (EDGE_COUNT (empty_bb->preds) > 0 && succ != NULL) - sel_redirect_edge_and_branch (EDGE_PRED (empty_bb, 0), succ); + { + edge e = EDGE_PRED (empty_bb, 0); + + if (e->flags & EDGE_FALLTHRU) + redirect_edge_succ (e, succ); + else + sel_redirect_edge_and_branch (EDGE_PRED (empty_bb, 0), succ); + } if (EDGE_COUNT (empty_bb->succs) > 0 && pred != NULL) { @@ -5567,7 +5574,6 @@ sel_register_cfg_hooks (void) sel_cfg_hooks = orig_cfg_hooks; sel_cfg_hooks.create_basic_block = sel_create_basic_block; - sel_cfg_hooks.delete_basic_block = rtl_delete_block_not_barriers; set_cfg_hooks (sel_cfg_hooks); |