diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-16 22:54:44 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-16 20:54:44 +0000 |
commit | 4793dca1588681eb583ccfd7cd179216c2d44d7e (patch) | |
tree | f2d3118471d29556bb961862c3ae6d62df08e484 /gcc/flow.c | |
parent | ccef9ef51073dac630247180cba0591af5382d6b (diff) | |
download | gcc-4793dca1588681eb583ccfd7cd179216c2d44d7e.zip gcc-4793dca1588681eb583ccfd7cd179216c2d44d7e.tar.gz gcc-4793dca1588681eb583ccfd7cd179216c2d44d7e.tar.bz2 |
basic-block.h (CLEANUP_PRE_SIBCALL): New constant.
* basic-block.h (CLEANUP_PRE_SIBCALL): New constant.
* except.c (finish_eh_generation): Update call of cleanup_cfg;
do rebuild_jump_labels instead of jump_optimize
* sibcall.c (optimize_sibling_and_tail_recursive_call): Likewise.
* toplev.c (rest_of_compulation): Likewise for -Wreturn_type.
* flow.c (try_optimize_cfg): Remove unneeded code_labels.
* flow.c: Include timevar.h
(find_basic_block): Push/pop timevar;
(cleanup_cfg): Likewise.
* timevar.def (TV_CFG, TV_CLEANUP_CFG): New.
* Makefile: Add dependencies on timevar.h
* integrate.c (save_for_inline): Kill all BASIC_BLOCK notes.
(copy_insn_list): Avoid killing of BASIC_BLOCK notes.
* rtl.h (delete_trivially_dead_insns): Add new parameter.
* toplev.c (rest_of_compilation): Update calls.
* cse.c (set_live_p, insn_live_p, dead_libcall_p): Break out from ...
(delete_trivially_dead_insns): ... here; accept new argument
preserve_basic_blocks; preserve basic blocks if set.
* reg-stack.c (stack_regs_mentioned): Return 0 if
stack_regs_mentioned_data is not initialized.
(reg_to_stack): Make stack_regs_mentioned survive after the
reg-stack is completted; do not call cleanup_cfg.
* toplev.c (rest_of_compilation): Do cleanup_cfg before bb-reorder;
make cleanup_cfg after bb-reorder to output to debug file.
From-SVN: r44056
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -135,6 +135,7 @@ Boston, MA 02111-1307, USA. */ #include "recog.h" #include "expr.h" #include "ssa.h" +#include "timevar.h" #include "obstack.h" #include "splay-tree.h" @@ -499,6 +500,7 @@ find_basic_blocks (f, nregs, file) FILE *file ATTRIBUTE_UNUSED; { int max_uid; + timevar_push (TV_CFG); /* Flush out existing data. */ if (basic_block_info != NULL) @@ -556,6 +558,7 @@ find_basic_blocks (f, nregs, file) #ifdef ENABLE_CHECKING verify_flow_info (); #endif + timevar_pop (TV_CFG); } void @@ -1002,6 +1005,7 @@ void cleanup_cfg (mode) int mode; { + timevar_push (TV_CLEANUP_CFG); delete_unreachable_blocks (); if (try_optimize_cfg (mode)) delete_unreachable_blocks (); @@ -1010,6 +1014,7 @@ cleanup_cfg (mode) /* Kill the data we won't maintain. */ free_EXPR_LIST_list (&label_value_list); free_EXPR_LIST_list (&tail_recursion_label_list); + timevar_pop (TV_CLEANUP_CFG); } /* Create a new basic block consisting of the instructions between @@ -2960,6 +2965,14 @@ merge_blocks (e, b, c, mode) int c_has_outgoing_fallthru; int b_has_incoming_fallthru; + /* Avoid overactive code motion, as the forwarder blocks should eb + eliminated by the edge redirection instead. Only exception is the + case b is an forwarder block and c has no fallthru edge, but no + optimizers should be confused by this extra jump and we are about + to kill the jump in bb_reorder pass instead. */ + if (forwarder_block_p (b) || forwarder_block_p (c)) + return 0; + /* We must make sure to not munge nesting of exception regions, lexical blocks, and loop notes. @@ -3688,6 +3701,26 @@ try_optimize_cfg (mode) b = c; } + /* Remove code labels no longer used. + Don't do the optimization before sibling calls are discovered, + as some branches may be hidden inside CALL_PLACEHOLDERs. */ + if (!(mode & CLEANUP_PRE_SIBCALL) + && b->pred->pred_next == NULL + && (b->pred->flags & EDGE_FALLTHRU) + && GET_CODE (b->head) == CODE_LABEL + /* If previous block does end with condjump jumping to next BB, + we can't delete the label. */ + && (b->pred->src == ENTRY_BLOCK_PTR + || !reg_mentioned_p (b->head, b->pred->src->end))) + { + rtx label = b->head; + b->head = NEXT_INSN (b->head); + flow_delete_insn_chain (label, label); + if (rtl_dump_file) + fprintf (rtl_dump_file, "Deleted label in block %i.\n", + b->index); + } + /* A loop because chains of blocks might be combineable. */ while ((s = b->succ) != NULL && s->succ_next == NULL |