gcc/gcc/cfgrtl.c

3054 lines
82 KiB
C
Raw Normal View History

Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* This file contains low level functions to manipulate the CFG and analyze it
that are aware of the RTL intermediate language.
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Available functionality:
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
- Basic CFG/RTL manipulation API documented in cfghooks.h
- CFG-aware instruction chain manipulation
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
delete_insn, delete_insn_chain
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
- Edge splitting and committing to edges
insert_insn_on_edge, commit_edge_insertions
- CFG updating after insn simplification
purge_dead_edges, purge_all_dead_edges
Functions not supposed for generic use:
- Infrastructure to determine quickly basic block for insn
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
compute_bb_for_insn, update_bb_for_insn, set_block_for_insn,
- Edge redirection with updating and optimizing of insn chain
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
block_label, tidy_fallthru_edge, force_nonfallthru */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "regs.h"
#include "flags.h"
#include "output.h"
#include "function.h"
#include "except.h"
#include "toplev.h"
#include "tm_p.h"
#include "obstack.h"
#include "insn-config.h"
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
#include "cfglayout.h"
#include "expr.h"
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
#include "target.h"
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* The labels mentioned in non-jump rtl. Valid during find_basic_blocks. */
/* ??? Should probably be using LABEL_NUSES instead. It would take a
bit of surgery to be able to use or co-opt the routines in jump. */
rtx label_value_list;
static int can_delete_note_p (rtx);
static int can_delete_label_p (rtx);
static void commit_one_edge_insertion (edge, int);
static rtx last_loop_beg_note (rtx);
static bool back_edge_of_syntactic_loop_p (basic_block, basic_block);
basic_block force_nonfallthru_and_redirect (edge, basic_block);
static basic_block rtl_split_edge (edge);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static bool rtl_move_block_after (basic_block, basic_block);
static int rtl_verify_flow_info (void);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static basic_block cfg_layout_split_block (basic_block, void *);
static edge cfg_layout_redirect_edge_and_branch (edge, basic_block);
static basic_block cfg_layout_redirect_edge_and_branch_force (edge, basic_block);
static void cfg_layout_delete_block (basic_block);
static void rtl_delete_block (basic_block);
static basic_block rtl_redirect_edge_and_branch_force (edge, basic_block);
static edge rtl_redirect_edge_and_branch (edge, basic_block);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
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 mark_killed_regs (rtx, rtx, void *);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static void rtl_make_forwarder_block (edge);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Return true if NOTE is not one of the ones that must be kept paired,
so that we may simply delete it. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
static int
can_delete_note_p (rtx note)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED
cfglayout.c (function_tail_eff_head): Rename to ... * cfglayout.c (function_tail_eff_head): Rename to ... (function_footer): ... this one. (unlink_insn_chain): New functions. (label_for_bb): Only call block_label and emit debug message. (record_effective_endpoints): Actually unlink the headers and footers. (fixup_reorder_cahin): Re-insert the unlinked sequences. (cfg_layout_duplicate_bb): Use duplicate_insn_chain. * cfglayout.h (struct reorder_block_def): New fields footer/header; remove eff_head/eff_end. * rtl.h (set_first_insn): Declare. * emit-rtl.c (set_first_insn): New function. * cfglayout.c (fixup_reorder_chain): Dump duplicated (cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge, cfg_layout_duplicate_bb): New global function. (duplicate_insn_chain): New static function. * cfglayout.h (cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge, cfg_layout_duplicate_bb): Declare. (struct reorder_block_def): Add "original" field. * emit-rtl.c (emit_copy_of_insn_after): New function. * rtl.h (emit_copy_of_insn_after): Declare. * cfglayout.c (fixup_fallthru_exit_predecessor): Kill. (fixup_reorder_chain): properly handle edges to exit block. Wed May 8 11:10:31 CEST 2002 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> Jan Hubicka <jh@suse.cz> * basic-block.h (note_prediction_to_br_prob): declare. * c-semantics.c: Inlucde predit.h (expand_stmt): predict GOTO_STMT as not taken. * cfgcleanup.c: (delete_unreachable_blocks): Make global. (cleanup_cfg): Do not free tail_recursion_list. * cfgrtl.c (can_delete_note_p): Delete NOTE_INSN_PREDICTION. (flow_delete_block): Kill predictions past end of basic block. * output.h (delete_unreachable_blocks): Declare. * predict.c (predicted_by_p, process_note_predictions, process_note_prediction, last_block_p): New function. (estimate_probability): Bypass loop on PRED_CONTINUE; do not handle noreturn heuristics; kill PRED_RETURN; add PRED_EARLY_RETURN. * predict.def (PRED_CONTINUE, PRED_EARLY_RETURN, PRED_GOTO, PRED_CONST_RETURN, PRED_NEGATIVE_RETURN, PRED_NULL_RETURN): New. * predict.h (IS_TAKEN): New constant. * print-rtl.c (print_rtx): Pretty print NOTE_INSN_PREDICTION. * rtl.c (NOTE_INSN_PREDICTION): New. * rtl.h (NOTE_PREDICTION, NOTE_PREDICTION_ALG, NOTE_PREDICTION_FLAGS): New macro. (insn_note): add NOTE_INSN_PREDICTION. * sibcall.c (optimize_sibling_and_tail_recursive_call): Do not build CFG; free tail_recursion_label_list. * stmt.c: Include predict.h; (return_prediction): New. (expand_value_return): Use it. * toplev.c: Lower NOTE_INSN_PREDICTION before sibcall. From-SVN: r53285
2002-05-08 11:17:27 +02:00
|| NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK
|| NOTE_LINE_NUMBER (note) == NOTE_INSN_UNLIKELY_EXECUTED_CODE);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* True if a given label can be deleted. */
static int
can_delete_label_p (rtx label)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
return (!LABEL_PRESERVE_P (label)
/* User declared labels must be preserved. */
&& LABEL_NAME (label) == 0
&& !in_expr_list_p (forced_labels, label)
&& !in_expr_list_p (label_value_list, label));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Delete INSN by patching it out. Return the next insn. */
rtx
delete_insn (rtx insn)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx next = NEXT_INSN (insn);
rtx note;
bool really_delete = true;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
/* Some labels can't be directly removed from the INSN chain, as they
might be references via variables, constant pool etc.
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Convert them to the special NOTE_INSN_DELETED_LABEL note. */
if (! can_delete_label_p (insn))
{
const char *name = LABEL_NAME (insn);
really_delete = false;
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
NOTE_DELETED_LABEL_NAME (insn) = name;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels);
}
if (really_delete)
{
/* If this insn has already been deleted, something is very wrong. */
if (INSN_DELETED_P (insn))
abort ();
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
remove_insn (insn);
INSN_DELETED_P (insn) = 1;
}
/* If deleting a jump, decrement the use count of the label. Deleting
the label itself should happen in the normal course of block merging. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (insn)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& JUMP_LABEL (insn)
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& LABEL_P (JUMP_LABEL (insn)))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
LABEL_NUSES (JUMP_LABEL (insn))--;
/* Also if deleting an insn that references a label. */
else
{
while ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& LABEL_P (XEXP (note, 0)))
{
LABEL_NUSES (XEXP (note, 0))--;
remove_note (insn, note);
}
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (insn)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& (GET_CODE (PATTERN (insn)) == ADDR_VEC
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
{
rtx pat = PATTERN (insn);
int diff_vec_p = GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC;
int len = XVECLEN (pat, diff_vec_p);
int i;
for (i = 0; i < len; i++)
{
rtx label = XEXP (XVECEXP (pat, diff_vec_p, i), 0);
/* When deleting code in bulk (e.g. removing many unreachable
blocks) we can delete a label that's a target of the vector
before deleting the vector itself. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!NOTE_P (label))
LABEL_NUSES (label)--;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
return next;
}
/* Like delete_insn but also purge dead edges from BB. */
rtx
delete_insn_and_edges (rtx insn)
{
rtx x;
bool purge = false;
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
if (INSN_P (insn)
&& BLOCK_FOR_INSN (insn)
&& BB_END (BLOCK_FOR_INSN (insn)) == insn)
purge = true;
x = delete_insn (insn);
if (purge)
purge_dead_edges (BLOCK_FOR_INSN (insn));
return x;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Unlink a chain of insns between START and FINISH, leaving notes
that must be paired. */
void
delete_insn_chain (rtx start, rtx finish)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx next;
/* Unchain the insns one by one. It would be quicker to delete all of these
with a single unchaining, rather than one at a time, but we need to keep
the NOTE's. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
while (1)
{
next = NEXT_INSN (start);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (NOTE_P (start) && !can_delete_note_p (start))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
;
else
next = delete_insn (start);
if (start == finish)
break;
start = next;
}
}
/* Like delete_insn but also purge dead edges from BB. */
void
delete_insn_chain_and_edges (rtx first, rtx last)
{
bool purge = false;
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
if (INSN_P (last)
&& BLOCK_FOR_INSN (last)
&& BB_END (BLOCK_FOR_INSN (last)) == last)
purge = true;
delete_insn_chain (first, last);
if (purge)
purge_dead_edges (BLOCK_FOR_INSN (last));
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Create a new basic block consisting of the instructions between HEAD and END
inclusive. This function is designed to allow fast BB construction - reuses
the note and basic block struct in BB_NOTE, if any and do not grow
BASIC_BLOCK chain and should be used directly only by CFG construction code.
END can be NULL in to create new empty basic block before HEAD. Both END
and HEAD can be NULL to create basic block at the end of INSN chain.
AFTER is the basic block we should be put after. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic_block
create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block bb;
if (bb_note
&& (bb = NOTE_BASIC_BLOCK (bb_note)) != NULL
&& bb->aux == NULL)
{
/* If we found an existing note, thread it back onto the chain. */
rtx after;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (head))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
after = head;
else
{
after = PREV_INSN (head);
head = bb_note;
}
if (after != bb_note && NEXT_INSN (after) != bb_note)
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
reorder_insns_nobb (bb_note, bb_note, after);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
else
{
/* Otherwise we must create a note and a basic block structure. */
bb = alloc_block ();
if (!head && !end)
head = end = bb_note
= emit_note_after (NOTE_INSN_BASIC_BLOCK, get_last_insn ());
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
else if (LABEL_P (head) && end)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, head);
if (head == end)
end = bb_note;
}
else
{
bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, head);
head = bb_note;
if (!end)
end = head;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
NOTE_BASIC_BLOCK (bb_note) = bb;
}
/* Always include the bb note in the block. */
if (NEXT_INSN (end) == bb_note)
end = bb_note;
BB_HEAD (bb) = head;
BB_END (bb) = end;
bb->index = last_basic_block++;
basic-block.h (BB_REACHABLE): Renumber. * basic-block.h (BB_REACHABLE): Renumber. (BB_DIRTY, BB_NEW): New flags. (clear_bb_flags): Declare. (update_life_info_in_dirty_blocks): Declare. * cfg.c (clear_bb_flags): New function. * cfgrtl.c (create_basic_block_structure): Set flags to BB_NEW. * emit-rtl.c (add_insn_after, add_insn_before, remove_insn, reorder_insns, emit_insn_after): Mark block as dirty. * flow.c (update_life_info): Fix clearing of PROP_LOG_LINKS. (update_life_info_in_dirty_blocks): New function. * recog.c (apply_change_group): Dirtify block. * cse.c (cse_insn): Reorder emitting of jump insn to keep cfg consistent. * gcse.c (delete_null_pointer_checks): Likewise. * toplev.c (dump_file_index): Move cse2 after bp, add DFI_null (dump_file_info): Similary. (rest_of_compilation): Avoid most of CFG rebuilds; do first if converision after null pointer checks, do cse2 after branch prediction; avoid full liveness rebuild after initializing subregs. * invoke.texi (-d options): Document -du, renumber. * cfgcleanup.c (bb_flags): Remove BB_UPDATE_LIFE. (notice_new_block): Do not set BB_UPDATE_LIFE. (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, try_crossjump_to_edge): Likewise. (try_optimize_cfg): Likewise; use update_life_info_in_dirty_blocks. * cfgrtl.c (merge_blocks_nomove): Copy b's flags to a. * ifcvt.c (SET_UPDATE_LIFE, UPDATE_LIFE): Kill. (merge_of_block): Do not use life_data_ok. (find_if_case_1): Do not use SET_UPDATE_LIFE. (if_convert): Use BB_DIRTY mechanizm to update life. * lcm.c (optimize_mode_switching): Update update_life_info_in_dirty_blocks From-SVN: r50127
2002-02-28 11:11:01 +01:00
bb->flags = BB_NEW;
link_block (bb, after);
BASIC_BLOCK (bb->index) = bb;
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
update_bb_for_insn (bb);
BB_SET_PARTITION (bb, BB_UNPARTITIONED);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Tag the block so that we know it has been used when considering
other basic block notes. */
bb->aux = bb;
return bb;
}
/* Create new basic block consisting of instructions in between HEAD and END
and place it to the BB chain after block AFTER. END can be NULL in to
create new empty basic block before HEAD. Both END and HEAD can be NULL to
create basic block at the end of INSN chain. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static basic_block
rtl_create_basic_block (void *headp, void *endp, basic_block after)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
rtx head = headp, end = endp;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic_block bb;
/* Grow the basic block array if needed. */
if ((size_t) last_basic_block >= VARRAY_SIZE (basic_block_info))
{
size_t new_size = last_basic_block + (last_basic_block + 3) / 4;
VARRAY_GROW (basic_block_info, new_size);
}
n_basic_blocks++;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb = create_basic_block_structure (head, end, NULL, after);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb->aux = NULL;
return bb;
}
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static basic_block
cfg_layout_create_basic_block (void *head, void *end, basic_block after)
{
basic_block newbb = rtl_create_basic_block (head, end, after);
initialize_bb_rbi (newbb);
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
return newbb;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Delete the insns in a (non-live) block. We physically delete every
non-deleted-note insn, and update the flow graph appropriately.
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 (basic_block b)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx insn, end, tmp;
/* If the head of this block is a CODE_LABEL, then it might be the
label for an exception handler which can't be reached.
We need to remove the label from the exception_handler_label list
and remove the associated NOTE_INSN_EH_REGION_BEG and
NOTE_INSN_EH_REGION_END notes. */
insn = BB_HEAD (b);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
maybe_remove_eh_handler (insn);
/* Include any jump table following the basic block. */
end = BB_END (b);
if (tablejump_p (end, NULL, &tmp))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
end = tmp;
/* Include any barrier that may follow the basic block. */
tmp = next_nonnote_insn (end);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (tmp && BARRIER_P (tmp))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
end = tmp;
/* Selectively delete the entire chain. */
BB_HEAD (b) = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
delete_insn_chain (insn, end);
}
/* Records the basic block struct in BLOCK_FOR_INSN for every insn. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
void
compute_bb_for_insn (void)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
basic_block bb;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB (bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx end = BB_END (bb);
rtx insn;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
BLOCK_FOR_INSN (insn) = bb;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (insn == end)
break;
}
}
}
/* Release the basic_block_for_insn array. */
void
free_bb_for_insn (void)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
rtx insn;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!BARRIER_P (insn))
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
BLOCK_FOR_INSN (insn) = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Return RTX to emit after when we want to emit code on the entry of function. */
rtx
entry_of_function (void)
{
return (n_basic_blocks ? BB_HEAD (ENTRY_BLOCK_PTR->next_bb) : get_insns ());
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Update insns block within BB. */
void
update_bb_for_insn (basic_block bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx insn;
for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!BARRIER_P (insn))
set_block_for_insn (insn, bb);
if (insn == BB_END (bb))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
break;
}
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
/* Creates a new basic block just after basic block B by splitting
everything after specified instruction I. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static basic_block
rtl_split_block (basic_block bb, void *insnp)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block new_bb;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
rtx insn = insnp;
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
edge e;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
if (!insn)
{
insn = first_insn_after_basic_block_note (bb);
if (insn)
insn = PREV_INSN (insn);
else
insn = get_last_insn ();
}
/* We probably should check type of the insn so that we do not create
inconsistent cfg. It is checked in verify_flow_info anyway, so do not
bother. */
if (insn == BB_END (bb))
emit_note_after (NOTE_INSN_DELETED, insn);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Create the new basic block. */
new_bb = create_basic_block (NEXT_INSN (insn), BB_END (bb), bb);
BB_COPY_PARTITION (new_bb, bb);
BB_END (bb) = insn;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Redirect the outgoing edges. */
new_bb->succ = bb->succ;
bb->succ = NULL;
for (e = new_bb->succ; e; e = e->succ_next)
e->src = new_bb;
if (bb->global_live_at_start)
{
new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack);
new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack);
COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end);
/* We now have to calculate which registers are live at the end
of the split basic block and at the start of the new basic
block. Start with those registers that are known to be live
at the end of the original basic block and get
propagate_block to determine which registers are live. */
COPY_REG_SET (new_bb->global_live_at_start, bb->global_live_at_end);
propagate_block (new_bb, new_bb->global_live_at_start, NULL, NULL, 0);
COPY_REG_SET (bb->global_live_at_end,
new_bb->global_live_at_start);
#ifdef HAVE_conditional_execution
/* In the presence of conditional execution we are not able to update
liveness precisely. */
if (reload_completed)
{
bb->flags |= BB_DIRTY;
new_bb->flags |= BB_DIRTY;
}
#endif
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
return new_bb;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Blocks A and B are to be merged into a single block A. The insns
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
are already contiguous. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static void
rtl_merge_blocks (basic_block a, basic_block b)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx b_head = BB_HEAD (b), b_end = BB_END (b), a_end = BB_END (a);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
rtx del_first = NULL_RTX, del_last = NULL_RTX;
int b_empty = 0;
/* If there was a CODE_LABEL beginning B, delete it. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (b_head))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
/* Detect basic blocks with nothing but a label. This can happen
in particular at the end of a function. */
if (b_head == b_end)
b_empty = 1;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
del_first = del_last = b_head;
b_head = NEXT_INSN (b_head);
}
/* Delete the basic block note and handle blocks containing just that
note. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (NOTE_INSN_BASIC_BLOCK_P (b_head))
{
if (b_head == b_end)
b_empty = 1;
if (! del_last)
del_first = b_head;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
del_last = b_head;
b_head = NEXT_INSN (b_head);
}
/* If there was a jump out of A, delete it. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (a_end))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx prev;
for (prev = PREV_INSN (a_end); ; prev = PREV_INSN (prev))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!NOTE_P (prev)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
|| NOTE_LINE_NUMBER (prev) == NOTE_INSN_BASIC_BLOCK
|| prev == BB_HEAD (a))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
break;
del_first = a_end;
#ifdef HAVE_cc0
/* If this was a conditional jump, we need to also delete
the insn that set cc0. */
if (only_sets_cc0_p (prev))
{
rtx tmp = prev;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
prev = prev_nonnote_insn (prev);
if (!prev)
prev = BB_HEAD (a);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
del_first = tmp;
}
#endif
a_end = PREV_INSN (del_first);
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
else if (BARRIER_P (NEXT_INSN (a_end)))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
del_first = NEXT_INSN (a_end);
/* Delete everything marked above as well as crap that might be
hanging out between the two blocks. */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
BB_HEAD (b) = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
delete_insn_chain (del_first, del_last);
/* Reassociate the insns of B with A. */
if (!b_empty)
{
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
rtx x;
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
for (x = a_end; x != b_end; x = NEXT_INSN (x))
set_block_for_insn (x, a);
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
set_block_for_insn (b_end, a);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
a_end = b_end;
}
BB_END (a) = a_end;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* Return true when block A and B can be merged. */
static bool
rtl_can_merge_blocks (basic_block a,basic_block b)
{
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
and cold sections.
Basic block partitioning may result in some jumps that appear to
be optimizable (or blocks that appear to be mergeable), but which really
must be left untouched (they are required to make it safely across
partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
if (flag_reorder_blocks_and_partition
&& (find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX)
|| find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)
|| BB_PARTITION (a) != BB_PARTITION (b)))
return false;
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* There must be exactly one edge in between the blocks. */
return (a->succ && !a->succ->succ_next && a->succ->dest == b
&& !b->pred->pred_next && a != b
/* Must be simple edge. */
&& !(a->succ->flags & EDGE_COMPLEX)
&& a->next_bb == b
&& a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR
/* If the jump insn has side effects,
we can't kill the edge. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& (!JUMP_P (BB_END (a))
|| (reload_completed
? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a)))));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Return the label in the head of basic block BLOCK. Create one if it doesn't
exist. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
rtx
block_label (basic_block block)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (block == EXIT_BLOCK_PTR)
return NULL_RTX;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!LABEL_P (BB_HEAD (block)))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
BB_HEAD (block) = emit_label_before (gen_label_rtx (), BB_HEAD (block));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
return BB_HEAD (block);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Attempt to perform edge redirection by replacing possibly complex jump
instruction by unconditional jump or removing jump completely. This can
apply only if all edges now point to the same block. The parameters and
return values are equivalent to redirect_edge_and_branch. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
edge
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block src = e->src;
rtx insn = BB_END (src), kill_from;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
edge tmp;
rtx set;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
int fallthru = 0;
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
and cold sections.
Basic block partitioning may result in some jumps that appear to
be optimizable (or blocks that appear to be mergeable), but which really
must be left untouched (they are required to make it safely across
partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
if (flag_reorder_blocks_and_partition
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
&& (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX)
|| BB_PARTITION (src) != BB_PARTITION (target)))
return NULL;
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Verify that all targets will be TARGET. */
for (tmp = src->succ; tmp; tmp = tmp->succ_next)
if (tmp->dest != target && tmp != e)
break;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (tmp || !onlyjump_p (insn))
return NULL;
if ((!optimize || reload_completed) && tablejump_p (insn, NULL, NULL))
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Avoid removing branch with side effects. */
set = single_set (insn);
if (!set || side_effects_p (set))
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* In case we zap a conditional jump, we'll need to kill
the cc0 setter too. */
kill_from = insn;
#ifdef HAVE_cc0
if (reg_mentioned_p (cc0_rtx, PATTERN (insn)))
kill_from = PREV_INSN (insn);
#endif
/* See if we can create the fallthru edge. */
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (in_cfglayout || can_fallthru (src, target))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (dump_file)
fprintf (dump_file, "Removing jump %i.\n", INSN_UID (insn));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
fallthru = 1;
/* Selectively unlink whole insn chain. */
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (in_cfglayout)
{
rtx insn = src->rbi->footer;
delete_insn_chain (kill_from, BB_END (src));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* Remove barriers but keep jumptables. */
while (insn)
{
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (BARRIER_P (insn))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
{
if (PREV_INSN (insn))
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else
src->rbi->footer = NEXT_INSN (insn);
if (NEXT_INSN (insn))
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (insn))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
break;
insn = NEXT_INSN (insn);
}
}
else
delete_insn_chain (kill_from, PREV_INSN (BB_HEAD (target)));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* If this already is simplejump, redirect it. */
else if (simplejump_p (insn))
{
if (e->dest == target)
return NULL;
if (dump_file)
fprintf (dump_file, "Redirecting jump %i from %i to %i.\n",
INSN_UID (insn), e->dest->index, target->index);
if (!redirect_jump (insn, block_label (target), 0))
{
if (target == EXIT_BLOCK_PTR)
return NULL;
abort ();
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Cannot do anything for target exit block. */
else if (target == EXIT_BLOCK_PTR)
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Or replace possibly complicated jump insn by simple jump insn. */
else
{
rtx target_label = block_label (target);
rtx barrier, label, table;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
emit_jump_insn_after (gen_jump (target_label), insn);
JUMP_LABEL (BB_END (src)) = target_label;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
LABEL_NUSES (target_label)++;
if (dump_file)
fprintf (dump_file, "Replacing insn %i by jump %i\n",
INSN_UID (insn), INSN_UID (BB_END (src)));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
delete_insn_chain (kill_from, insn);
/* Recognize a tablejump that we are converting to a
simple jump and remove its associated CODE_LABEL
and ADDR_VEC or ADDR_DIFF_VEC. */
if (tablejump_p (insn, &label, &table))
delete_insn_chain (label, table);
barrier = next_nonnote_insn (BB_END (src));
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!barrier || !BARRIER_P (barrier))
emit_barrier_after (BB_END (src));
else
{
if (barrier != NEXT_INSN (BB_END (src)))
{
/* Move the jump before barrier so that the notes
which originally were or were created before jump table are
inside the basic block. */
rtx new_insn = BB_END (src);
rtx tmp;
for (tmp = NEXT_INSN (BB_END (src)); tmp != barrier;
tmp = NEXT_INSN (tmp))
set_block_for_insn (tmp, src);
NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn);
PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn);
NEXT_INSN (new_insn) = barrier;
NEXT_INSN (PREV_INSN (barrier)) = new_insn;
PREV_INSN (new_insn) = PREV_INSN (barrier);
PREV_INSN (barrier) = new_insn;
}
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Keep only one edge out and set proper flags. */
while (src->succ->succ_next)
remove_edge (src->succ);
e = src->succ;
if (fallthru)
e->flags = EDGE_FALLTHRU;
else
e->flags = 0;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
e->probability = REG_BR_PROB_BASE;
e->count = src->count;
/* We don't want a block to end on a line-number note since that has
the potential of changing the code between -g and not -g. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
while (NOTE_P (BB_END (e->src))
&& NOTE_LINE_NUMBER (BB_END (e->src)) >= 0)
delete_insn (BB_END (e->src));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (e->dest != target)
redirect_edge_succ (e, target);
return e;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Return last loop_beg note appearing after INSN, before start of next
basic block. Return INSN if there are no such notes.
When emitting jump to redirect a fallthru edge, it should always appear
after the LOOP_BEG notes, as loop optimizer expect loop to either start by
fallthru edge or jump following the LOOP_BEG note jumping to the loop exit
test. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
static rtx
last_loop_beg_note (rtx insn)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx last = insn;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
for (insn = NEXT_INSN (insn); insn && NOTE_P (insn)
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK;
insn = NEXT_INSN (insn))
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
last = insn;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return last;
}
/* Redirect edge representing branch of (un)conditional jump or tablejump,
NULL on failure */
static edge
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
redirect_branch_edge (edge e, basic_block target)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx tmp;
rtx old_label = BB_HEAD (e->dest);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic_block src = e->src;
rtx insn = BB_END (src);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* We can only redirect non-fallthru edges of jump insn. */
if (e->flags & EDGE_FALLTHRU)
return NULL;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
else if (!JUMP_P (insn))
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Recognize a tablejump and adjust all matching cases. */
if (tablejump_p (insn, NULL, &tmp))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtvec vec;
int j;
rtx new_label = block_label (target);
if (target == EXIT_BLOCK_PTR)
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (GET_CODE (PATTERN (tmp)) == ADDR_VEC)
vec = XVEC (PATTERN (tmp), 0);
else
vec = XVEC (PATTERN (tmp), 1);
for (j = GET_NUM_ELEM (vec) - 1; j >= 0; --j)
if (XEXP (RTVEC_ELT (vec, j), 0) == old_label)
{
RTVEC_ELT (vec, j) = gen_rtx_LABEL_REF (Pmode, new_label);
--LABEL_NUSES (old_label);
++LABEL_NUSES (new_label);
}
/* Handle casesi dispatch insns. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if ((tmp = single_set (insn)) != NULL
&& SET_DEST (tmp) == pc_rtx
&& GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE
&& GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF
&& XEXP (XEXP (SET_SRC (tmp), 2), 0) == old_label)
{
XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (VOIDmode,
new_label);
--LABEL_NUSES (old_label);
++LABEL_NUSES (new_label);
}
}
else
{
/* ?? We may play the games with moving the named labels from
one basic block to the other in case only one computed_jump is
available. */
if (computed_jump_p (insn)
/* A return instruction can't be redirected. */
|| returnjump_p (insn))
return NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* If the insn doesn't go where we think, we're confused. */
if (JUMP_LABEL (insn) != old_label)
abort ();
/* If the substitution doesn't succeed, die. This can happen
if the back end emitted unrecognizable instructions or if
target is exit block on some arches. */
if (!redirect_jump (insn, block_label (target), 0))
{
if (target == EXIT_BLOCK_PTR)
return NULL;
abort ();
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
if (dump_file)
fprintf (dump_file, "Edge %i->%i redirected to %i\n",
e->src->index, e->dest->index, target->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (e->dest != target)
e = redirect_edge_succ_nodup (e, target);
return e;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
}
/* Attempt to change code to redirect edge E to TARGET. Don't do that on
expense of adding new instructions or reordering basic blocks.
Function can be also called with edge destination equivalent to the TARGET.
Then it should try the simplifications and do nothing if none is possible.
Return edge representing the branch if transformation succeeded. Return NULL
on failure.
We still return NULL in case E already destinated TARGET and we didn't
managed to simplify instruction stream. */
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static edge
rtl_redirect_edge_and_branch (edge e, basic_block target)
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
{
edge ret;
basic_block src = e->src;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
return NULL;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->dest == target)
return e;
if ((ret = try_redirect_by_replacing_jump (e, target, false)) != NULL)
{
src->flags |= BB_DIRTY;
return ret;
}
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
ret = redirect_branch_edge (e, target);
if (!ret)
return NULL;
src->flags |= BB_DIRTY;
return ret;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Like force_nonfallthru below, but additionally performs redirection
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Used by redirect_edge_and_branch_force. */
basic_block
force_nonfallthru_and_redirect (edge e, basic_block target)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block jump_block, new_bb = NULL, src = e->src;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
rtx note;
edge new_edge;
int abnormal_edge_flags = 0;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* In the case the last instruction is conditional jump to the next
instruction, first redirect the jump itself and then continue
by creating a basic block afterwards to redirect fallthru edge. */
if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR
&& any_condjump_p (BB_END (e->src))
/* When called from cfglayout, fallthru edges do not
necessarily go to the next block. */
&& e->src->next_bb == e->dest
&& JUMP_LABEL (BB_END (e->src)) == BB_HEAD (e->dest))
{
rtx note;
edge b = unchecked_make_edge (e->src, target, 0);
if (!redirect_jump (BB_END (e->src), block_label (target), 0))
abort ();
note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX);
if (note)
{
int prob = INTVAL (XEXP (note, 0));
b->probability = prob;
b->count = e->count * prob / REG_BR_PROB_BASE;
e->probability -= e->probability;
e->count -= b->count;
if (e->probability < 0)
e->probability = 0;
if (e->count < 0)
e->count = 0;
}
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (e->flags & EDGE_ABNORMAL)
{
/* Irritating special case - fallthru edge to the same block as abnormal
edge.
We can't redirect abnormal edge, but we still can split the fallthru
one and create separate abnormal edge to original destination.
This allows bb-reorder to make such edge non-fallthru. */
if (e->dest != target)
abort ();
abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
}
else if (!(e->flags & EDGE_FALLTHRU))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
abort ();
else if (e->src == ENTRY_BLOCK_PTR)
{
/* We can't redirect the entry block. Create an empty block at the
start of the function which we use to add the new jump. */
edge *pe1;
basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR);
/* Change the existing edge's source to be the new block, and add
a new edge from the entry block to the new block. */
e->src = bb;
for (pe1 = &ENTRY_BLOCK_PTR->succ; *pe1; pe1 = &(*pe1)->succ_next)
if (*pe1 == e)
{
*pe1 = e->succ_next;
break;
}
e->succ_next = 0;
bb->succ = e;
make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU);
}
if (e->src->succ->succ_next || abnormal_edge_flags)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
/* Create the new structures. */
/* If the old block ended with a tablejump, skip its table
by searching forward from there. Otherwise start searching
forward from the last instruction of the old block. */
if (!tablejump_p (BB_END (e->src), NULL, &note))
note = BB_END (e->src);
/* Position the new block correctly relative to loop notes. */
note = last_loop_beg_note (note);
note = NEXT_INSN (note);
jump_block = create_basic_block (note, NULL, e->src);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
jump_block->count = e->count;
jump_block->frequency = EDGE_FREQUENCY (e);
jump_block->loop_depth = target->loop_depth;
if (target->global_live_at_start)
{
jump_block->global_live_at_start
= OBSTACK_ALLOC_REG_SET (&flow_obstack);
jump_block->global_live_at_end
= OBSTACK_ALLOC_REG_SET (&flow_obstack);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
COPY_REG_SET (jump_block->global_live_at_start,
target->global_live_at_start);
COPY_REG_SET (jump_block->global_live_at_end,
target->global_live_at_start);
}
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
/* Make sure new block ends up in correct hot/cold section. */
BB_COPY_PARTITION (jump_block, e->src);
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
if (flag_reorder_blocks_and_partition
&& targetm.have_named_sections)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
{
if (BB_PARTITION (jump_block) == BB_COLD_PARTITION)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
{
rtx bb_note, new_note;
for (bb_note = BB_HEAD (jump_block);
bb_note && bb_note != NEXT_INSN (BB_END (jump_block));
bb_note = NEXT_INSN (bb_note))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (NOTE_P (bb_note)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& NOTE_LINE_NUMBER (bb_note) == NOTE_INSN_BASIC_BLOCK)
break;
new_note = emit_note_after (NOTE_INSN_UNLIKELY_EXECUTED_CODE,
bb_note);
NOTE_BASIC_BLOCK (new_note) = jump_block;
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (jump_block))
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& !any_condjump_p (BB_END (jump_block))
&& (jump_block->succ->flags & EDGE_CROSSING))
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
REG_NOTES (BB_END (jump_block)) = gen_rtx_EXPR_LIST
(REG_CROSSING_JUMP, NULL_RTX,
REG_NOTES (BB_END (jump_block)));
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Wire edge in. */
new_edge = make_edge (e->src, jump_block, EDGE_FALLTHRU);
new_edge->probability = e->probability;
new_edge->count = e->count;
/* Redirect old edge. */
redirect_edge_pred (e, jump_block);
e->probability = REG_BR_PROB_BASE;
new_bb = jump_block;
}
else
jump_block = e->src;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
e->flags &= ~EDGE_FALLTHRU;
if (target == EXIT_BLOCK_PTR)
{
#ifdef HAVE_return
emit_jump_insn_after (gen_return (), BB_END (jump_block));
#else
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
abort ();
#endif
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
else
{
rtx label = block_label (target);
emit_jump_insn_after (gen_jump (label), BB_END (jump_block));
JUMP_LABEL (BB_END (jump_block)) = label;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
LABEL_NUSES (label)++;
}
emit_barrier_after (BB_END (jump_block));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
redirect_edge_succ_nodup (e, target);
if (abnormal_edge_flags)
make_edge (src, target, abnormal_edge_flags);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return new_bb;
}
/* Edge E is assumed to be fallthru edge. Emit needed jump instruction
(and possibly create new basic block) to make edge non-fallthru.
Return newly created BB or NULL if none. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
basic_block
force_nonfallthru (edge e)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
return force_nonfallthru_and_redirect (e, e->dest);
}
/* Redirect edge even at the expense of creating new jump insn or
basic block. Return new basic block if created, NULL otherwise.
Abort if conversion is impossible. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
static basic_block
rtl_redirect_edge_and_branch_force (edge e, basic_block target)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (redirect_edge_and_branch (e, target)
|| e->dest == target)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return NULL;
/* In case the edge redirection failed, try to force it to be non-fallthru
and redirect newly created simplejump. */
return force_nonfallthru_and_redirect (e, target);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* The given edge should potentially be a fallthru edge. If that is in
fact true, delete the jump and barriers that are in the way. */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static void
rtl_tidy_fallthru_edge (edge e)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx q;
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
basic_block b = e->src, c = b->next_bb;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* ??? In a late-running flow pass, other folks may have deleted basic
blocks by nopping out blocks, leaving multiple BARRIERs between here
and the target label. They ought to be chastized and fixed.
We can also wind up with a sequence of undeletable labels between
one block and the next.
So search through a sequence of barriers, labels, and notes for
the head of block C and assert that we really do fall through. */
for (q = NEXT_INSN (BB_END (b)); q != BB_HEAD (c); q = NEXT_INSN (q))
if (INSN_P (q))
return;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Remove what will soon cease being the jump insn from the source block.
If block B consisted only of this single jump, turn it into a deleted
note. */
q = BB_END (b);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (q)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& onlyjump_p (q)
&& (any_uncondjump_p (q)
|| (b->succ == e && e->succ_next == NULL)))
{
#ifdef HAVE_cc0
/* If this was a conditional jump, we need to also delete
the insn that set cc0. */
if (any_condjump_p (q) && only_sets_cc0_p (PREV_INSN (q)))
q = PREV_INSN (q);
#endif
q = PREV_INSN (q);
/* We don't want a block to end on a line-number note since that has
the potential of changing the code between -g and not -g. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
while (NOTE_P (q) && NOTE_LINE_NUMBER (q) >= 0)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
q = PREV_INSN (q);
}
/* Selectively unlink the sequence. */
if (q != PREV_INSN (BB_HEAD (c)))
delete_insn_chain (NEXT_INSN (q), PREV_INSN (BB_HEAD (c)));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
e->flags |= EDGE_FALLTHRU;
}
/* Helper function for split_edge. Return true in case edge BB2 to BB1
is back edge of syntactic loop. */
static bool
back_edge_of_syntactic_loop_p (basic_block bb1, basic_block bb2)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx insn;
int count = 0;
basic_block bb;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (bb1 == bb2)
return true;
/* ??? Could we guarantee that bb indices are monotone, so that we could
just compare them? */
for (bb = bb1; bb && bb != bb2; bb = bb->next_bb)
continue;
if (!bb)
return false;
for (insn = BB_END (bb1); insn != BB_HEAD (bb2) && count >= 0;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
insn = NEXT_INSN (insn))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (NOTE_P (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
count++;
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
count--;
}
return count >= 0;
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
/* Should move basic block BB after basic block AFTER. NIY. */
static bool
rtl_move_block_after (basic_block bb ATTRIBUTE_UNUSED,
basic_block after ATTRIBUTE_UNUSED)
{
return false;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Split a (typically critical) edge. Return the new block.
Abort on abnormal edges.
??? The code generally expects to be called on critical edges.
The case of a block ending in an unconditional jump to a
block with multiple predecessors is not handled optimally. */
static basic_block
rtl_split_edge (edge edge_in)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block bb;
rtx before;
/* Abnormal edges cannot be split. */
if ((edge_in->flags & EDGE_ABNORMAL) != 0)
abort ();
/* We are going to place the new block in front of edge destination.
Avoid existence of fallthru predecessors. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if ((edge_in->flags & EDGE_FALLTHRU) == 0)
{
edge e;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
for (e = edge_in->dest->pred; e; e = e->pred_next)
if (e->flags & EDGE_FALLTHRU)
break;
if (e)
force_nonfallthru (e);
}
/* Create the basic block note.
Where we place the note can have a noticeable impact on the generated
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
code. Consider this cfg:
E
|
0
/ \
+->1-->2--->E
| |
+--+
If we need to insert an insn on the edge from block 0 to block 1,
we want to ensure the instructions we insert are outside of any
loop notes that physically sit between block 0 and block 1. Otherwise
we confuse the loop optimizer into thinking the loop is a phony. */
if (edge_in->dest != EXIT_BLOCK_PTR
&& PREV_INSN (BB_HEAD (edge_in->dest))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& NOTE_P (PREV_INSN (BB_HEAD (edge_in->dest)))
&& (NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (edge_in->dest)))
== NOTE_INSN_LOOP_BEG)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& !back_edge_of_syntactic_loop_p (edge_in->dest, edge_in->src))
before = PREV_INSN (BB_HEAD (edge_in->dest));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
else if (edge_in->dest != EXIT_BLOCK_PTR)
before = BB_HEAD (edge_in->dest);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
else
before = NULL_RTX;
/* If this is a fall through edge to the exit block, the blocks might be
not adjacent, and the right place is the after the source. */
if (edge_in->flags & EDGE_FALLTHRU && edge_in->dest == EXIT_BLOCK_PTR)
{
before = NEXT_INSN (BB_END (edge_in->src));
if (before
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& NOTE_P (before)
&& NOTE_LINE_NUMBER (before) == NOTE_INSN_LOOP_END)
before = NEXT_INSN (before);
bb = create_basic_block (before, NULL, edge_in->src);
BB_COPY_PARTITION (bb, edge_in->src);
}
else
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
{
bb = create_basic_block (before, NULL, edge_in->dest->prev_bb);
/* ??? Why not edge_in->dest->prev_bb here? */
BB_COPY_PARTITION (bb, edge_in->dest);
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* ??? This info is likely going to be out of date very soon. */
if (edge_in->dest->global_live_at_start)
{
bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack);
bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack);
COPY_REG_SET (bb->global_live_at_start,
edge_in->dest->global_live_at_start);
COPY_REG_SET (bb->global_live_at_end,
edge_in->dest->global_live_at_start);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
make_single_succ_edge (bb, edge_in->dest, EDGE_FALLTHRU);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* For non-fallthru edges, we must adjust the predecessor's
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
jump instruction to target our new block. */
if ((edge_in->flags & EDGE_FALLTHRU) == 0)
{
if (!redirect_edge_and_branch (edge_in, bb))
abort ();
}
else
redirect_edge_succ (edge_in, bb);
return bb;
}
/* Queue instructions for insertion on an edge between two basic blocks.
The new instructions and basic blocks (if any) will not appear in the
CFG until commit_edge_insertions is called. */
void
insert_insn_on_edge (rtx pattern, edge e)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
/* We cannot insert instructions on an abnormal critical edge.
It will be easier to find the culprit if we die now. */
if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
abort ();
if (e->insns.r == NULL_RTX)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
start_sequence ();
else
push_to_sequence (e->insns.r);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
emit_insn (pattern);
e->insns.r = get_insns ();
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
end_sequence ();
}
/* Called from safe_insert_insn_on_edge through note_stores, marks live
registers that are killed by the store. */
static void
mark_killed_regs (rtx reg, rtx set ATTRIBUTE_UNUSED, void *data)
{
regset killed = data;
int regno, i;
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
if (!REG_P (reg))
return;
regno = REGNO (reg);
if (regno >= FIRST_PSEUDO_REGISTER)
SET_REGNO_REG_SET (killed, regno);
else
{
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
for (i = 0; i < (int) hard_regno_nregs[regno][GET_MODE (reg)]; i++)
SET_REGNO_REG_SET (killed, regno + i);
}
}
/* Similar to insert_insn_on_edge, tries to put INSN to edge E. Additionally
it checks whether this will not clobber the registers that are live on the
edge (i.e. it requires liveness information to be up-to-date) and if there
are some, then it tries to save and restore them. Returns true if
successful. */
bool
safe_insert_insn_on_edge (rtx insn, edge e)
{
rtx x;
regset_head killed_head;
regset killed = INITIALIZE_REG_SET (killed_head);
rtx save_regs = NULL_RTX;
int regno, noccmode;
enum machine_mode mode;
#ifdef AVOID_CCMODE_COPIES
noccmode = true;
#else
noccmode = false;
#endif
for (x = insn; x; x = NEXT_INSN (x))
if (INSN_P (x))
note_stores (PATTERN (x), mark_killed_regs, killed);
bitmap_operation (killed, killed, e->dest->global_live_at_start,
BITMAP_AND);
EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno,
{
mode = regno < FIRST_PSEUDO_REGISTER
? reg_raw_mode[regno]
: GET_MODE (regno_reg_rtx[regno]);
if (mode == VOIDmode)
return false;
if (noccmode && mode == CCmode)
return false;
save_regs = alloc_EXPR_LIST (0,
alloc_EXPR_LIST (0,
gen_reg_rtx (mode),
gen_raw_REG (mode, regno)),
save_regs);
});
if (save_regs)
{
rtx from, to;
start_sequence ();
for (x = save_regs; x; x = XEXP (x, 1))
{
from = XEXP (XEXP (x, 0), 1);
to = XEXP (XEXP (x, 0), 0);
emit_move_insn (to, from);
}
emit_insn (insn);
for (x = save_regs; x; x = XEXP (x, 1))
{
from = XEXP (XEXP (x, 0), 0);
to = XEXP (XEXP (x, 0), 1);
emit_move_insn (to, from);
}
insn = get_insns ();
end_sequence ();
free_EXPR_LIST_list (&save_regs);
}
insert_insn_on_edge (insn, e);
FREE_REG_SET (killed);
return true;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Update the CFG for the instructions queued on edge E. */
static void
commit_one_edge_insertion (edge e, int watch_calls)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx before = NULL_RTX, after = NULL_RTX, insns, tmp, last;
basic_block bb = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Pull the insns off the edge now since the edge might go away. */
insns = e->insns.r;
e->insns.r = NULL_RTX;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Special case -- avoid inserting code between call and storing
its return value. */
if (watch_calls && (e->flags & EDGE_FALLTHRU) && !e->dest->pred->pred_next
&& e->src != ENTRY_BLOCK_PTR
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& CALL_P (BB_END (e->src)))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx next = next_nonnote_insn (BB_END (e->src));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
after = BB_HEAD (e->dest);
/* The first insn after the call may be a stack pop, skip it. */
while (next
&& keep_with_call_p (next))
{
after = next;
next = next_nonnote_insn (next);
}
bb = e->dest;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
if (!before && !after)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
/* Figure out where to put these things. If the destination has
one predecessor, insert there. Except for the exit block. */
if (e->dest->pred->pred_next == NULL && e->dest != EXIT_BLOCK_PTR)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
bb = e->dest;
/* Get the location correct wrt a code label, and "nice" wrt
a basic block note, and before everything else. */
tmp = BB_HEAD (bb);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (tmp))
tmp = NEXT_INSN (tmp);
if (NOTE_INSN_BASIC_BLOCK_P (tmp))
tmp = NEXT_INSN (tmp);
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
if (tmp
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& NOTE_P (tmp)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& NOTE_LINE_NUMBER (tmp) == NOTE_INSN_UNLIKELY_EXECUTED_CODE)
tmp = NEXT_INSN (tmp);
if (tmp == BB_HEAD (bb))
before = tmp;
else if (tmp)
after = PREV_INSN (tmp);
else
after = get_last_insn ();
}
/* If the source has one successor and the edge is not abnormal,
insert there. Except for the entry block. */
else if ((e->flags & EDGE_ABNORMAL) == 0
&& e->src->succ->succ_next == NULL
&& e->src != ENTRY_BLOCK_PTR)
{
bb = e->src;
/* It is possible to have a non-simple jump here. Consider a target
where some forms of unconditional jumps clobber a register. This
happens on the fr30 for example.
We know this block has a single successor, so we can just emit
the queued insns before the jump. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (bb)))
for (before = BB_END (bb);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
NOTE_P (PREV_INSN (before))
&& NOTE_LINE_NUMBER (PREV_INSN (before)) ==
NOTE_INSN_LOOP_BEG; before = PREV_INSN (before))
;
else
{
/* We'd better be fallthru, or we've lost track of what's what. */
if ((e->flags & EDGE_FALLTHRU) == 0)
abort ();
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
after = BB_END (bb);
}
}
/* Otherwise we must split the edge. */
else
{
bb = split_edge (e);
after = BB_END (bb);
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
if (flag_reorder_blocks_and_partition
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
&& targetm.have_named_sections
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& e->src != ENTRY_BLOCK_PTR
&& BB_PARTITION (e->src) == BB_COLD_PARTITION
&& !(e->flags & EDGE_CROSSING))
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
{
rtx bb_note, new_note, cur_insn;
bb_note = NULL_RTX;
for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb));
cur_insn = NEXT_INSN (cur_insn))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (NOTE_P (cur_insn)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& NOTE_LINE_NUMBER (cur_insn) == NOTE_INSN_BASIC_BLOCK)
{
bb_note = cur_insn;
break;
}
new_note = emit_note_after (NOTE_INSN_UNLIKELY_EXECUTED_CODE,
bb_note);
NOTE_BASIC_BLOCK (new_note) = bb;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (bb))
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
&& !any_condjump_p (BB_END (bb))
&& (bb->succ->flags & EDGE_CROSSING))
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST
(REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb)));
if (after == bb_note)
after = new_note;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
}
/* Now that we've found the spot, do the insertion. */
if (before)
{
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
emit_insn_before (insns, before);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
last = prev_nonnote_insn (before);
}
else
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
last = emit_insn_after (insns, after);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (returnjump_p (last))
{
/* ??? Remove all outgoing edges from BB and add one for EXIT.
This is not currently a problem because this only happens
for the (single) epilogue, which already has a fallthru edge
to EXIT. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
e = bb->succ;
if (e->dest != EXIT_BLOCK_PTR
|| e->succ_next != NULL || (e->flags & EDGE_FALLTHRU) == 0)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
abort ();
e->flags &= ~EDGE_FALLTHRU;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
emit_barrier_after (last);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (before)
delete_insn (before);
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
else if (JUMP_P (last))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
abort ();
/* Mark the basic block for find_sub_basic_blocks. */
bb->aux = &bb->aux;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Update the CFG for all queued instructions. */
void
commit_edge_insertions (void)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
basic_block bb;
sbitmap blocks;
bool changed = false;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
edge e, next;
for (e = bb->succ; e; e = next)
{
next = e->succ_next;
if (e->insns.r)
{
changed = true;
commit_one_edge_insertion (e, false);
}
}
}
if (!changed)
return;
blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (blocks);
FOR_EACH_BB (bb)
if (bb->aux)
{
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
if (bb->aux != &bb->aux)
abort ();
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
}
/* Update the CFG for all queued instructions, taking special care of inserting
code on edges between call and storing its return value. */
void
commit_edge_insertions_watch_calls (void)
{
basic_block bb;
sbitmap blocks;
bool changed = false;
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
{
edge e, next;
for (e = bb->succ; e; e = next)
{
next = e->succ_next;
if (e->insns.r)
{
changed = true;
commit_one_edge_insertion (e, true);
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
}
if (!changed)
return;
blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (blocks);
FOR_EACH_BB (bb)
if (bb->aux)
{
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
if (bb->aux != &bb->aux)
abort ();
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
/* Print out RTL-specific basic block information (live information
at start and end). */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
static void
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
rtl_dump_bb (basic_block bb, FILE *outf, int indent)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx insn;
rtx last;
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
char *s_indent;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
s_indent = alloca ((size_t) indent + 1);
memset (s_indent, ' ', (size_t) indent);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
s_indent[indent] = '\0';
fprintf (outf, ";;%s Registers live at start: ", s_indent);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
dump_regset (bb->global_live_at_start, outf);
putc ('\n', outf);
for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
insn = NEXT_INSN (insn))
print_rtl_single (outf, insn);
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
fprintf (outf, ";;%s Registers live at end: ", s_indent);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
dump_regset (bb->global_live_at_end, outf);
putc ('\n', outf);
}
/* Like print_rtl, but also print out live information for the start of each
basic block. */
void
print_rtl_with_bb (FILE *outf, rtx rtx_first)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx tmp_rtx;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (rtx_first == 0)
fprintf (outf, "(nil)\n");
else
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
basic_block *start = xcalloc (max_uid, sizeof (basic_block));
basic_block *end = xcalloc (max_uid, sizeof (basic_block));
enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
basic_block bb;
FOR_EACH_BB_REVERSE (bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx x;
start[INSN_UID (BB_HEAD (bb))] = bb;
end[INSN_UID (BB_END (bb))] = bb;
for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
enum bb_state state = IN_MULTIPLE_BB;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (in_bb_p[INSN_UID (x)] == NOT_IN_BB)
state = IN_ONE_BB;
in_bb_p[INSN_UID (x)] = state;
if (x == BB_END (bb))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
break;
}
}
for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
{
int did_output;
if ((bb = start[INSN_UID (tmp_rtx)]) != NULL)
{
fprintf (outf, ";; Start of basic block %d, registers live:",
bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
dump_regset (bb->global_live_at_start, outf);
putc ('\n', outf);
}
if (in_bb_p[INSN_UID (tmp_rtx)] == NOT_IN_BB
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& !NOTE_P (tmp_rtx)
&& !BARRIER_P (tmp_rtx))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
fprintf (outf, ";; Insn is not within a basic block\n");
else if (in_bb_p[INSN_UID (tmp_rtx)] == IN_MULTIPLE_BB)
fprintf (outf, ";; Insn is in multiple basic blocks\n");
did_output = print_rtl_single (outf, tmp_rtx);
if ((bb = end[INSN_UID (tmp_rtx)]) != NULL)
{
fprintf (outf, ";; End of basic block %d, registers live:\n",
bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
dump_regset (bb->global_live_at_end, outf);
putc ('\n', outf);
}
if (did_output)
putc ('\n', outf);
}
free (start);
free (end);
free (in_bb_p);
}
if (current_function_epilogue_delay_list != 0)
{
fprintf (outf, "\n;; Insns in epilogue delay list:\n\n");
for (tmp_rtx = current_function_epilogue_delay_list; tmp_rtx != 0;
tmp_rtx = XEXP (tmp_rtx, 1))
print_rtl_single (outf, XEXP (tmp_rtx, 0));
}
}
void
update_br_prob_note (basic_block bb)
{
rtx note;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (!JUMP_P (BB_END (bb)))
return;
note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
if (!note || INTVAL (XEXP (note, 0)) == BRANCH_EDGE (bb)->probability)
return;
XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability);
}
/* Verify the CFG and RTL consistency common for both underlying RTL and
cfglayout RTL.
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
Currently it does following checks:
- test head/end pointers
- overlapping of basic blocks
- headers of basic blocks (the NOTE_INSN_BASIC_BLOCK note)
- tails of basic blocks (ensure that boundary is necessary)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
- scans body of the basic block for JUMP_INSN, CODE_LABEL
and NOTE_INSN_BASIC_BLOCK
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
- verify that no fall_thru edge crosses hot/cold partition boundaries
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
In future it can be extended check a lot of other stuff as well
(reachability of basic blocks, life information, etc. etc.). */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static int
rtl_verify_flow_info_1 (void)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
const int max_uid = get_max_uid ();
rtx last_head = get_last_insn ();
basic_block *bb_info;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
rtx x;
int err = 0;
basic_block bb, last_bb_seen;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb_info = xcalloc (max_uid, sizeof (basic_block));
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB_REVERSE (bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx head = BB_HEAD (bb);
rtx end = BB_END (bb);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* Verify the end of the basic block is in the INSN chain. */
for (x = last_head; x != NULL_RTX; x = PREV_INSN (x))
if (x == end)
break;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!x)
{
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
error ("end insn %d for block %d not found in the insn stream",
INSN_UID (end), bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
err = 1;
}
/* Work backwards from the end to the head of the basic block
to verify the head is in the RTL chain. */
for (; x != NULL_RTX; x = PREV_INSN (x))
{
/* While walking over the insn chain, verify insns appear
in only one basic block and initialize the BB_INFO array
used by other passes. */
if (bb_info[INSN_UID (x)] != NULL)
{
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
error ("insn %d is in multiple basic blocks (%d and %d)",
INSN_UID (x), bb->index, bb_info[INSN_UID (x)]->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
err = 1;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb_info[INSN_UID (x)] = bb;
if (x == head)
break;
}
if (!x)
{
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
error ("head insn %d for block %d not found in the insn stream",
INSN_UID (head), bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
err = 1;
}
last_head = x;
}
/* Now check the basic blocks (boundaries etc.) */
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB_REVERSE (bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
int n_fallthru = 0, n_eh = 0, n_call = 0, n_abnormal = 0, n_branch = 0;
edge e, fallthru = NULL;
rtx note;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (INSN_P (BB_END (bb))
&& (note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX))
&& bb->succ && bb->succ->succ_next
&& any_condjump_p (BB_END (bb)))
{
if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability)
{
error ("verify_flow_info: REG_BR_PROB does not match cfg %wi %i",
INTVAL (XEXP (note, 0)), BRANCH_EDGE (bb)->probability);
err = 1;
}
}
for (e = bb->succ; e; e = e->succ_next)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (e->flags & EDGE_FALLTHRU)
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
{
n_fallthru++, fallthru = e;
if ((e->flags & EDGE_CROSSING)
|| (BB_PARTITION (e->src) != BB_PARTITION (e->dest)
Hot/cold partitioning update patch. Hot/cold partitioning update patch. The problems that this patch attemptd to address/fix are: - Fix places where adding in_unlikely_executed_text to the enum data type "in_section" threw off switch case statements. - Make it work correctly (by turning it off) for functions where user specifies "__attribute__ section" - Make it work correctly (by turning it off) for linkonce sections - Make it work correctly with -ffunction-sections flag - Make it output correct cold section labels - Undo some changes to original assembly code generation - Turn off hot/cold partitioning in the presence of DWARF debugging (for the moment) - Turn off hot/cold partitioning for architectures that do not support named sections - Use variables rather than constants for cold section labels and names (to work correctly with -ffunction-sections, among other things) 2004-08-18 Caroline Tice <ctice@apple.com> * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add "-freorder-blocks-and-partition" to the flags used in second stage of profiledbootstrap. * bb-reorder.c (push_to_next_round_p): Add new variable, next_round_is_last; set and use variable to make sure, when partitioning, that the last trace construction round consists of all (and only) cold basic blocks. (rotate_loop): Don't copy blocks that end in a section crossing jump. (copy_bb): Correctly initialize "partition" of duplicated bb. (add_unlikely_executed_notes): Add a comment. (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to make sure, if function contains hot blocks, that the successors of ENTRY_BLOCK_PTR are hot; also, only look for crossing edges if the architecture supports named sections. (mark_bb_for_unlikely_executed_section): Modify to always insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after the basic block note insn. (fix_crossing_unconditional_branches): Remove extra space. (fix_edges_for_rarely_executed_code): Modify to only do partitioning work if the architecture supports named sections. (reorder_basic_blocks): Modify to only add NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports named sections. * c-common.c (handle_section_attribute): Initialize new global variable, user_defined_section_attribute, to true if user has specified one. * cfgcleanup.c (try_forward_edges): Modify to not attempt to forward edges that cross section boundaries. * cfglayout.c (fixup_reorder_chain): Modify to only fix up partitioning information if the architecture supports named sections. * cfgrtl.c (target.h): Add statement to include this. (rtl_split_block): Make sure newly created bb gets correct partition. (try_redirect_by_replacing_jump): Make sure redirection isn't attempting to cross section boundaries. (force_nonfallthru_and_redirect): Only do partition fix up if architecture supports named sections. (rtl_split_edge): Make sure newly created bb ends up in correct partition. (commit_one_edge_insertion): Remove code that incorrectly updated basic block partition; Make sure partition fix up only happens if architecture supports named sections and it's not already done. (rtl_verify_flow_info_1): Fix if-condition on test/error condition that fallthru edges are not allowed to cross section boundaries. * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. * final.c (final_scan_insn): Remove redundant test from if-statement; change calls to text_section into calls to function_section; add code to only to partitioning fix up if architecture supports named sections. * ifcvt.c (find_if_case_1): Make sure newly created bb has correct partition. (if_convert): Add targetm.have_named_sections to test. * output.h (unlikely_section_label): Extern declaration for new global variable. (unlikely_text_section_name): Likewise. * opts.c (decode_options): If both partitioning and DWARF debugging are turned on, issue a warning that this doesn't work, and change partitiong to basic block reordering (without hot/cold partitions). * passes.c (rest_of_handle_final): Re-set new global variable, user_defined_section_attribute, to false. (rest_of_compilation): Change options for calling partitioning function: Don't call if the user defined the section attribute, and don't call if DECL_ONE_ONLY is true for the current function. * predict.c (choose_function_section): Return immediately if we are doing hot/cold partitioning (i.e. let the basic block partitioning determine where the function belongs). * reg-stack.c (emit_swap_insn): Add condition to step over NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. * toplev.c (user_defined_section_attribute): New global variable. * toplev.h (user_defined_section_attribute): Extern declaration for new global variable. * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (unlikely_text_section): Add code to initialize unlikely_text_section_name if necessary; modify to use unlikely_text_section_name and unlikely_section_label; also to use named_section properly. (in_unlikely_text_section): Modify to work correctly with named_section and to use unlikely_text_section_name. (named_section): Add code to work properly with cold section. (function_section): Clean up if-statement. * config/darwin.c (darwin_asm_named_section): Return to original code, removing use of SECTION_FORMAT_STRING. * config/arm/pe.h (switch_to_section): Add case for in_unlikely_executed_text to switch statement. * config/i386/cygming.h (switch_to_section): Likewise. * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. (SECTION_FORMAT_STRING): Likewise. * config/mcore/mcore.h (switch_to_section): Likewise. * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. From-SVN: r86189
2004-08-18 18:22:08 +02:00
&& e->src != ENTRY_BLOCK_PTR
&& e->dest != EXIT_BLOCK_PTR))
{
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
error ("Fallthru edge crosses section boundary (bb %i)",
e->src->index);
err = 1;
}
}
if ((e->flags & ~(EDGE_DFS_BACK
| EDGE_CAN_FALLTHRU
| EDGE_IRREDUCIBLE_LOOP
| EDGE_LOOP_EXIT)) == 0)
n_branch++;
if (e->flags & EDGE_ABNORMAL_CALL)
n_call++;
if (e->flags & EDGE_EH)
n_eh++;
else if (e->flags & EDGE_ABNORMAL)
n_abnormal++;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
if (n_eh && GET_CODE (PATTERN (BB_END (bb))) != RESX
&& !find_reg_note (BB_END (bb), REG_EH_REGION, NULL_RTX))
{
error ("Missing REG_EH_REGION note in the end of bb %i", bb->index);
err = 1;
}
if (n_branch
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& (!JUMP_P (BB_END (bb))
|| (n_branch > 1 && (any_uncondjump_p (BB_END (bb))
|| any_condjump_p (BB_END (bb))))))
{
error ("Too many outgoing branch edges from bb %i", bb->index);
err = 1;
}
if (n_fallthru && any_uncondjump_p (BB_END (bb)))
{
error ("Fallthru edge after unconditional jump %i", bb->index);
err = 1;
}
if (n_branch != 1 && any_uncondjump_p (BB_END (bb)))
{
error ("Wrong amount of branch edges after unconditional jump %i", bb->index);
err = 1;
}
if (n_branch != 1 && any_condjump_p (BB_END (bb))
&& JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest))
{
error ("Wrong amount of branch edges after conditional jump %i", bb->index);
err = 1;
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (n_call && !CALL_P (BB_END (bb)))
{
error ("Call edges for non-call insn in bb %i", bb->index);
err = 1;
}
if (n_abnormal
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& (!CALL_P (BB_END (bb)) && n_call != n_abnormal)
&& (!JUMP_P (BB_END (bb))
|| any_condjump_p (BB_END (bb))
|| any_uncondjump_p (BB_END (bb))))
{
error ("Abnormal edges for no purpose in bb %i", bb->index);
err = 1;
}
for (x = BB_HEAD (bb); x != NEXT_INSN (BB_END (bb)); x = NEXT_INSN (x))
loop.c (emit_prefetch_instructions): Properly place the address computation. * loop.c (emit_prefetch_instructions): Properly place the address computation. * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. From-SVN: r54188
2002-06-02 23:09:54 +02:00
if (BLOCK_FOR_INSN (x) != bb)
{
debug_rtx (x);
if (! BLOCK_FOR_INSN (x))
error
("insn %d inside basic block %d but block_for_insn is NULL",
INSN_UID (x), bb->index);
else
error
("insn %d inside basic block %d but block_for_insn is %i",
INSN_UID (x), bb->index, BLOCK_FOR_INSN (x)->index);
err = 1;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* OK pointers are correct. Now check the header of basic
block. It ought to contain optional CODE_LABEL followed
by NOTE_BASIC_BLOCK. */
x = BB_HEAD (bb);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (x))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (BB_END (bb) == x)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
error ("NOTE_INSN_BASIC_BLOCK is missing for block %d",
bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
err = 1;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
x = NEXT_INSN (x);
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!NOTE_INSN_BASIC_BLOCK_P (x) || NOTE_BASIC_BLOCK (x) != bb)
{
error ("NOTE_INSN_BASIC_BLOCK is missing for block %d",
bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
err = 1;
}
if (BB_END (bb) == x)
/* Do checks for empty blocks her. e */
;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
else
for (x = NEXT_INSN (x); x; x = NEXT_INSN (x))
{
if (NOTE_INSN_BASIC_BLOCK_P (x))
{
error ("NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d",
INSN_UID (x), bb->index);
err = 1;
}
if (x == BB_END (bb))
break;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (control_flow_insn_p (x))
{
error ("in basic block %d:", bb->index);
fatal_insn ("flow control insn inside a basic block", x);
}
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Clean up. */
free (bb_info);
return err;
}
/* Verify the CFG and RTL consistency common for both underlying RTL and
cfglayout RTL.
Currently it does following checks:
- all checks of rtl_verify_flow_info_1
- check that all insns are in the basic blocks
(except the switch handling code, barriers and notes)
- check that all returns are followed by barriers
- check that all fallthru edge points to the adjacent blocks. */
static int
rtl_verify_flow_info (void)
{
basic_block bb;
int err = rtl_verify_flow_info_1 ();
rtx x;
int num_bb_notes;
const rtx rtx_first = get_insns ();
basic_block last_bb_seen = ENTRY_BLOCK_PTR, curr_bb = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
FOR_EACH_BB_REVERSE (bb)
{
edge e;
for (e = bb->succ; e; e = e->succ_next)
if (e->flags & EDGE_FALLTHRU)
break;
if (!e)
{
rtx insn;
/* Ensure existence of barrier in BB with no fallthru edges. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
for (insn = BB_END (bb); !insn || !BARRIER_P (insn);
insn = NEXT_INSN (insn))
if (!insn
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
|| (NOTE_P (insn)
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK))
{
error ("missing barrier after block %i", bb->index);
err = 1;
break;
}
}
else if (e->src != ENTRY_BLOCK_PTR
&& e->dest != EXIT_BLOCK_PTR)
{
rtx insn;
if (e->src->next_bb != e->dest)
{
error
("verify_flow_info: Incorrect blocks for fallthru %i->%i",
e->src->index, e->dest->index);
err = 1;
}
else
for (insn = NEXT_INSN (BB_END (e->src)); insn != BB_HEAD (e->dest);
insn = NEXT_INSN (insn))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (BARRIER_P (insn)
#ifndef CASE_DROPS_THROUGH
|| INSN_P (insn)
#else
|| (INSN_P (insn) && ! JUMP_TABLE_DATA_P (insn))
#endif
)
{
error ("verify_flow_info: Incorrect fallthru %i->%i",
e->src->index, e->dest->index);
fatal_insn ("wrong insn in the fallthru edge", insn);
err = 1;
}
}
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
num_bb_notes = 0;
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
last_bb_seen = ENTRY_BLOCK_PTR;
for (x = rtx_first; x; x = NEXT_INSN (x))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
if (NOTE_INSN_BASIC_BLOCK_P (x))
{
bb = NOTE_BASIC_BLOCK (x);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
num_bb_notes++;
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
if (bb != last_bb_seen->next_bb)
internal_error ("basic blocks not laid down consecutively");
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
curr_bb = last_bb_seen = bb;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
if (!curr_bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
switch (GET_CODE (x))
{
case BARRIER:
case NOTE:
break;
case CODE_LABEL:
/* An addr_vec is placed outside any basic block. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (NEXT_INSN (x)
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& JUMP_P (NEXT_INSN (x))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& (GET_CODE (PATTERN (NEXT_INSN (x))) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (NEXT_INSN (x))) == ADDR_VEC))
x = NEXT_INSN (x);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* But in any case, non-deletable labels can appear anywhere. */
break;
default:
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
fatal_insn ("insn outside basic block", x);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
}
if (INSN_P (x)
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& JUMP_P (x)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
&& returnjump_p (x) && ! condjump_p (x)
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& ! (NEXT_INSN (x) && BARRIER_P (NEXT_INSN (x))))
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
fatal_insn ("return not followed by barrier", x);
if (curr_bb && x == BB_END (curr_bb))
curr_bb = NULL;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
if (num_bb_notes != n_basic_blocks)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
internal_error
("number of bb notes in insn chain (%d) != n_basic_blocks (%d)",
num_bb_notes, n_basic_blocks);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return err;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
/* Assume that the preceding pass has possibly eliminated jump instructions
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
or converted the unconditional jumps. Eliminate the edges from CFG.
Return true if any edges are eliminated. */
bool
purge_dead_edges (basic_block bb)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
edge e, next;
rtx insn = BB_END (bb), note;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bool purged = false;
/* If this instruction cannot trap, remove REG_EH_REGION notes. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (NONJUMP_INSN_P (insn)
&& (note = find_reg_note (insn, REG_EH_REGION, NULL)))
{
rtx eqnote;
if (! may_trap_p (PATTERN (insn))
|| ((eqnote = find_reg_equal_equiv_note (insn))
&& ! may_trap_p (XEXP (eqnote, 0))))
remove_note (insn, note);
}
/* Cleanup abnormal edges caused by exceptions or non-local gotos. */
for (e = bb->succ; e; e = next)
{
next = e->succ_next;
if (e->flags & EDGE_EH)
{
if (can_throw_internal (BB_END (bb)))
continue;
}
else if (e->flags & EDGE_ABNORMAL_CALL)
{
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (CALL_P (BB_END (bb))
&& (! (note = find_reg_note (insn, REG_EH_REGION, NULL))
|| INTVAL (XEXP (note, 0)) >= 0))
continue;
}
else
continue;
remove_edge (e);
bb->flags |= BB_DIRTY;
purged = true;
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (insn))
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
rtx note;
edge b,f;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* We do care only about conditional jumps and simplejumps. */
if (!any_condjump_p (insn)
&& !returnjump_p (insn)
&& !simplejump_p (insn))
return purged;
/* Branch probability/prediction notes are defined only for
condjumps. We've possibly turned condjump into simplejump. */
if (simplejump_p (insn))
{
note = find_reg_note (insn, REG_BR_PROB, NULL);
if (note)
remove_note (insn, note);
while ((note = find_reg_note (insn, REG_BR_PRED, NULL)))
remove_note (insn, note);
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
for (e = bb->succ; e; e = next)
{
next = e->succ_next;
/* Avoid abnormal flags to leak from computed jumps turned
into simplejumps. */
e->flags &= ~EDGE_ABNORMAL;
/* See if this edge is one we should keep. */
if ((e->flags & EDGE_FALLTHRU) && any_condjump_p (insn))
/* A conditional jump can fall through into the next
block, so we should keep the edge. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
continue;
else if (e->dest != EXIT_BLOCK_PTR
&& BB_HEAD (e->dest) == JUMP_LABEL (insn))
/* If the destination block is the target of the jump,
keep the edge. */
continue;
else if (e->dest == EXIT_BLOCK_PTR && returnjump_p (insn))
/* If the destination block is the exit block, and this
instruction is a return, then keep the edge. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
continue;
else if ((e->flags & EDGE_EH) && can_throw_internal (insn))
/* Keep the edges that correspond to exceptions thrown by
this instruction and rematerialize the EDGE_ABNORMAL
flag we just cleared above. */
{
e->flags |= EDGE_ABNORMAL;
continue;
}
/* We do not need this edge. */
bb->flags |= BB_DIRTY;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
purged = true;
remove_edge (e);
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!bb->succ || !purged)
return purged;
if (dump_file)
fprintf (dump_file, "Purged edges from bb %i\n", bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!optimize)
return purged;
/* Redistribute probabilities. */
if (!bb->succ->succ_next)
{
bb->succ->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
else
{
note = find_reg_note (insn, REG_BR_PROB, NULL);
if (!note)
return purged;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
b = BRANCH_EDGE (bb);
f = FALLTHRU_EDGE (bb);
b->probability = INTVAL (XEXP (note, 0));
f->probability = REG_BR_PROB_BASE - b->probability;
b->count = bb->count * b->probability / REG_BR_PROB_BASE;
f->count = bb->count * f->probability / REG_BR_PROB_BASE;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return purged;
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
else if (CALL_P (insn) && SIBLING_CALL_P (insn))
{
/* First, there should not be any EH or ABCALL edges resulting
from non-local gotos and the like. If there were, we shouldn't
have created the sibcall in the first place. Second, there
should of course never have been a fallthru edge. */
if (!bb->succ || bb->succ->succ_next)
abort ();
if (bb->succ->flags != (EDGE_SIBCALL | EDGE_ABNORMAL))
abort ();
return 0;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
/* If we don't see a jump insn, we don't know exactly why the block would
have been broken at this point. Look for a simple, non-fallthru edge,
as these are only created by conditional branches. If we find such an
edge we know that there used to be a jump here and can then safely
remove all non-fallthru edges. */
for (e = bb->succ; e && (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU));
e = e->succ_next)
;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!e)
return purged;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
for (e = bb->succ; e; e = next)
{
next = e->succ_next;
if (!(e->flags & EDGE_FALLTHRU))
{
bb->flags |= BB_DIRTY;
remove_edge (e);
purged = true;
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
}
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
if (!bb->succ || bb->succ->succ_next)
abort ();
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bb->succ->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count;
if (dump_file)
fprintf (dump_file, "Purged non-fallthru edges from bb %i\n",
bb->index);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return purged;
}
/* Search all basic blocks for potentially dead edges and purge them. Return
true if some edge has been eliminated. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
bool
purge_all_dead_edges (int update_life_p)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
{
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
int purged = false;
sbitmap blocks = 0;
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
basic_block bb;
if (update_life_p)
{
basic-block.h (last_basic_block): Defined as synonym for n_basic_blocks. * basic-block.h (last_basic_block): Defined as synonym for n_basic_blocks. * cfganal.c (mark_dfs_back_edges, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_preorder_transversal_compute, flow_dfs_compute_reverse_init): Replaced relevant occurences of n_basic_blocks with last_basic_block. * cfgbuild.c (make_edges): Likewise. * cfgloop.c (flow_loop_scan, flow_loops_find): Likewise. * cfgrtl.c (verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions): Likewise. * df.c (df_alloc, df_analyse_1, df_analyse, iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Likewise. * dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree, calc_idoms, idoms_to_doms): Likewise. * flow.c (update_life_info_in_dirty_blocks, free_basic_block_vars): Likewise. * gcse.c (gcse_main, alloc_gcse_mem, compute_local_properties, compute_hash_table, expr_reaches_here_p, one_classic_gcse_pass, one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p, one_pre_gcse_pass, compute_transpout, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass, compute_store_table, build_store_vectors): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, pre_edge_lcm, compute_available, compute_nearerout, compute_rev_insert_delete, pre_edge_rev_lcm, optimize_mode_switching): Likewise. * predict.c (estimate_probability, process_note_prediction, note_prediction_to_br_prob): Likewise. * profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * resource.c (init_resource_info): Likewise. * sched-rgn.c (build_control_flow, find_rgns, compute_trg_info, init_regions, schedule_insns): Likewise. * ssa-ccp.c (ssa_const_prop): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (compute_dominance_frontiers, compute_iterated_dominance_frontiers, convert_to_ssa): Likewise. * df.c (df_refs_unlink): Fix FOR_EACH_BB usage (in #if 0'ed code) * gcse.c (alloc_rd_mem, alloc_avail_expr_mem): Use n_blocks for vector sizes consistently. From-SVN: r53924
2002-05-27 15:45:44 +02:00
blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (blocks);
}
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB (bb)
{
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
bool purged_here = purge_dead_edges (bb);
purged |= purged_here;
if (purged_here && update_life_p)
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
SET_BIT (blocks, bb->index);
}
if (update_life_p && purged)
update_life_info (blocks, UPDATE_LIFE_GLOBAL,
PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
| PROP_KILL_DEAD_CODE);
if (update_life_p)
sbitmap_free (blocks);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
return purged;
}
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
/* Same as split_block but update cfg_layout structures. */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
static basic_block
cfg_layout_split_block (basic_block bb, void *insnp)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
rtx insn = insnp;
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
basic_block new_bb = rtl_split_block (bb, insn);
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
new_bb->rbi->footer = bb->rbi->footer;
bb->rbi->footer = NULL;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
return new_bb;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
}
/* Redirect Edge to DEST. */
static edge
cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
basic_block src = e->src;
edge ret;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
return NULL;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->dest == dest)
return e;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->src != ENTRY_BLOCK_PTR
&& (ret = try_redirect_by_replacing_jump (e, dest, true)))
{
src->flags |= BB_DIRTY;
return ret;
}
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (e->src == ENTRY_BLOCK_PTR
&& (e->flags & EDGE_FALLTHRU) && !(e->flags & EDGE_COMPLEX))
{
if (dump_file)
fprintf (dump_file, "Redirecting entry edge from bb %i to %i\n",
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
e->src->index, dest->index);
e->src->flags |= BB_DIRTY;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
redirect_edge_succ (e, dest);
return e;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
}
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
/* Redirect_edge_and_branch may decide to turn branch into fallthru edge
in the case the basic block appears to be in sequence. Avoid this
transformation. */
if (e->flags & EDGE_FALLTHRU)
{
/* Redirect any branch edges unified with the fallthru one. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (src))
&& label_is_jump_target_p (BB_HEAD (e->dest),
BB_END (src)))
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
if (dump_file)
fprintf (dump_file, "Fallthru edge unified with branch "
"%i->%i redirected to %i\n",
e->src->index, e->dest->index, dest->index);
e->flags &= ~EDGE_FALLTHRU;
if (!redirect_branch_edge (e, dest))
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
abort ();
e->flags |= EDGE_FALLTHRU;
e->src->flags |= BB_DIRTY;
return e;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
}
/* In case we are redirecting fallthru edge to the branch edge
of conditional jump, remove it. */
if (src->succ->succ_next
&& !src->succ->succ_next->succ_next)
{
edge s = e->succ_next ? e->succ_next : src->succ;
if (s->dest == dest
&& any_condjump_p (BB_END (src))
&& onlyjump_p (BB_END (src)))
delete_insn (BB_END (src));
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
}
ret = redirect_edge_succ_nodup (e, dest);
if (dump_file)
fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
e->src->index, e->dest->index, dest->index);
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
}
else
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
ret = redirect_branch_edge (e, dest);
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
/* We don't want simplejumps in the insn stream during cfglayout. */
if (simplejump_p (BB_END (src)))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
abort ();
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
src->flags |= BB_DIRTY;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
return ret;
}
/* Simple wrapper as we always can redirect fallthru edges. */
static basic_block
cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
if (!cfg_layout_redirect_edge_and_branch (e, dest))
abort ();
return NULL;
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
/* Same as delete_basic_block but update cfg_layout structures. */
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
static void
cfg_layout_delete_block (basic_block bb)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (bb->rbi->header)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
next = BB_HEAD (bb);
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
if (prev)
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
NEXT_INSN (prev) = bb->rbi->header;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
else
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
set_first_insn (bb->rbi->header);
PREV_INSN (bb->rbi->header) = prev;
insn = bb->rbi->header;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
NEXT_INSN (insn) = next;
PREV_INSN (next) = insn;
}
next = NEXT_INSN (BB_END (bb));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
if (bb->rbi->footer)
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
{
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
insn = bb->rbi->footer;
while (insn)
{
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (BARRIER_P (insn))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
{
if (PREV_INSN (insn))
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else
bb->rbi->footer = NEXT_INSN (insn);
if (NEXT_INSN (insn))
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
}
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (insn))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
break;
insn = NEXT_INSN (insn);
}
if (bb->rbi->footer)
{
insn = BB_END (bb);
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
NEXT_INSN (insn) = bb->rbi->footer;
PREV_INSN (bb->rbi->footer) = insn;
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
NEXT_INSN (insn) = next;
if (next)
PREV_INSN (next) = insn;
else
set_last_insn (insn);
}
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
}
if (bb->next_bb != EXIT_BLOCK_PTR)
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
to = &bb->next_bb->rbi->header;
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
else
to = &cfg_layout_function_footer;
rtl_delete_block (bb);
if (prev)
prev = NEXT_INSN (prev);
else
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
prev = get_insns ();
if (next)
next = PREV_INSN (next);
else
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
next = get_last_insn ();
if (next && NEXT_INSN (next) != prev)
{
remaints = unlink_insn_chain (prev, next);
insn = remaints;
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
NEXT_INSN (insn) = *to;
if (*to)
PREV_INSN (*to) = insn;
*to = remaints;
}
}
/* Return true when blocks A and B can be safely merged. */
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static bool
cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
{
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
and cold sections.
Basic block partitioning may result in some jumps that appear to
be optimizable (or blocks that appear to be mergeable), but which really
must be left untouched (they are required to make it safely across
partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
if (flag_reorder_blocks_and_partition
&& (find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX)
|| find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)
|| BB_PARTITION (a) != BB_PARTITION (b)))
return false;
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* There must be exactly one edge in between the blocks. */
return (a->succ && !a->succ->succ_next && a->succ->dest == b
&& !b->pred->pred_next && a != b
/* Must be simple edge. */
&& !(a->succ->flags & EDGE_COMPLEX)
&& a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR
/* If the jump insn has side effects,
we can't kill the edge. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
&& (!JUMP_P (BB_END (a))
|| (reload_completed
? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a)))));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
}
/* Merge block A and B, abort when it is not possible. */
static void
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
#ifdef ENABLE_CHECKING
if (!cfg_layout_can_merge_blocks_p (a, b))
abort ();
#endif
/* If there was a CODE_LABEL beginning B, delete it. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (BB_HEAD (b)))
delete_insn (BB_HEAD (b));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* We should have fallthru edge in a, or we can do dummy redirection to get
it cleaned up. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (a)))
try_redirect_by_replacing_jump (a->succ, b, true);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (JUMP_P (BB_END (a)))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
abort ();
/* Possible line number notes should appear in between. */
if (b->rbi->header)
{
rtx first = BB_END (a), last;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
last = emit_insn_after (b->rbi->header, BB_END (a));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
delete_insn_chain (NEXT_INSN (first), last);
b->rbi->header = NULL;
}
/* In the case basic blocks are not adjacent, move them around. */
if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
{
rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
emit_insn_after (first, BB_END (a));
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (first))
first = NEXT_INSN (first);
if (!NOTE_INSN_BASIC_BLOCK_P (first))
abort ();
BB_HEAD (b) = NULL;
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
delete_insn (first);
}
/* Otherwise just re-associate the instructions. */
else
{
rtx insn;
for (insn = BB_HEAD (b);
insn != NEXT_INSN (BB_END (b));
insn = NEXT_INSN (insn))
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
set_block_for_insn (insn, a);
insn = BB_HEAD (b);
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
abort ();
BB_HEAD (b) = NULL;
BB_END (a) = BB_END (b);
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
delete_insn (insn);
}
/* Possible tablejumps and barriers should appear after the block. */
if (b->rbi->footer)
{
if (!a->rbi->footer)
a->rbi->footer = b->rbi->footer;
else
{
rtx last = a->rbi->footer;
while (NEXT_INSN (last))
last = NEXT_INSN (last);
NEXT_INSN (last) = b->rbi->footer;
PREV_INSN (b->rbi->footer) = last;
}
b->rbi->footer = NULL;
}
if (dump_file)
fprintf (dump_file, "Merged blocks %d and %d.\n",
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
a->index, b->index);
}
/* Split edge E. */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
static basic_block
cfg_layout_split_edge (edge e)
{
edge new_e;
basic_block new_bb =
create_basic_block (e->src != ENTRY_BLOCK_PTR
? NEXT_INSN (BB_END (e->src)) : get_insns (),
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
NULL_RTX, e->src);
/* ??? This info is likely going to be out of date very soon, but we must
create it to avoid getting an ICE later. */
if (e->dest->global_live_at_start)
{
new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack);
new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack);
COPY_REG_SET (new_bb->global_live_at_start,
e->dest->global_live_at_start);
COPY_REG_SET (new_bb->global_live_at_end,
e->dest->global_live_at_start);
}
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
new_e = make_edge (new_bb, e->dest, EDGE_FALLTHRU);
redirect_edge_and_branch_force (e, new_bb);
return new_bb;
}
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
/* Do postprocessing after making a forwarder block joined by edge FALLTHRU. */
static void
rtl_make_forwarder_block (edge fallthru ATTRIBUTE_UNUSED)
{
}
/* Return 1 if BB ends with a call, possibly followed by some
instructions that must stay with the call, 0 otherwise. */
static bool
rtl_block_ends_with_call_p (basic_block bb)
{
rtx insn = BB_END (bb);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
while (!CALL_P (insn)
&& insn != BB_HEAD (bb)
&& keep_with_call_p (insn))
insn = PREV_INSN (insn);
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
return (CALL_P (insn));
}
/* Return 1 if BB ends with a conditional branch, 0 otherwise. */
static bool
rtl_block_ends_with_condjump_p (basic_block bb)
{
return any_condjump_p (BB_END (bb));
}
/* Return true if we need to add fake edge to exit.
Helper function for rtl_flow_call_edges_add. */
static bool
need_fake_edge_p (rtx insn)
{
if (!INSN_P (insn))
return false;
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if ((CALL_P (insn)
&& !SIBLING_CALL_P (insn)
&& !find_reg_note (insn, REG_NORETURN, NULL)
&& !find_reg_note (insn, REG_ALWAYS_RETURN, NULL)
&& !CONST_OR_PURE_CALL_P (insn)))
return true;
return ((GET_CODE (PATTERN (insn)) == ASM_OPERANDS
&& MEM_VOLATILE_P (PATTERN (insn)))
|| (GET_CODE (PATTERN (insn)) == PARALLEL
&& asm_noperands (insn) != -1
&& MEM_VOLATILE_P (XVECEXP (PATTERN (insn), 0, 0)))
|| GET_CODE (PATTERN (insn)) == ASM_INPUT);
}
/* Add fake edges to the function exit for any non constant and non noreturn
calls, volatile inline assembly in the bitmap of blocks specified by
BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks
that were split.
The goal is to expose cases in which entering a basic block does not imply
that all subsequent instructions must be executed. */
static int
rtl_flow_call_edges_add (sbitmap blocks)
{
int i;
int blocks_split = 0;
int last_bb = last_basic_block;
bool check_last_block = false;
if (n_basic_blocks == 0)
return 0;
if (! blocks)
check_last_block = true;
else
check_last_block = TEST_BIT (blocks, EXIT_BLOCK_PTR->prev_bb->index);
/* In the last basic block, before epilogue generation, there will be
a fallthru edge to EXIT. Special care is required if the last insn
of the last basic block is a call because make_edge folds duplicate
edges, which would result in the fallthru edge also being marked
fake, which would result in the fallthru edge being removed by
remove_fake_edges, which would result in an invalid CFG.
Moreover, we can't elide the outgoing fake edge, since the block
profiler needs to take this into account in order to solve the minimal
spanning tree in the case that the call doesn't return.
Handle this by adding a dummy instruction in a new last basic block. */
if (check_last_block)
{
basic_block bb = EXIT_BLOCK_PTR->prev_bb;
rtx insn = BB_END (bb);
/* Back up past insns that must be kept in the same block as a call. */
while (insn != BB_HEAD (bb)
&& keep_with_call_p (insn))
insn = PREV_INSN (insn);
if (need_fake_edge_p (insn))
{
edge e;
for (e = bb->succ; e; e = e->succ_next)
if (e->dest == EXIT_BLOCK_PTR)
{
insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e);
commit_edge_insertions ();
break;
}
}
}
/* Now add fake edges to the function exit for any non constant
calls since there is no way that we can determine if they will
return or not... */
for (i = 0; i < last_bb; i++)
{
basic_block bb = BASIC_BLOCK (i);
rtx insn;
rtx prev_insn;
if (!bb)
continue;
if (blocks && !TEST_BIT (blocks, i))
continue;
for (insn = BB_END (bb); ; insn = prev_insn)
{
prev_insn = PREV_INSN (insn);
if (need_fake_edge_p (insn))
{
edge e;
rtx split_at_insn = insn;
/* Don't split the block between a call and an insn that should
remain in the same block as the call. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (CALL_P (insn))
while (split_at_insn != BB_END (bb)
&& keep_with_call_p (NEXT_INSN (split_at_insn)))
split_at_insn = NEXT_INSN (split_at_insn);
/* The handling above of the final block before the epilogue
should be enough to verify that there is no edge to the exit
block in CFG already. Calling make_edge in such case would
cause us to mark that edge as fake and remove it later. */
#ifdef ENABLE_CHECKING
if (split_at_insn == BB_END (bb))
for (e = bb->succ; e; e = e->succ_next)
if (e->dest == EXIT_BLOCK_PTR)
abort ();
#endif
/* Note that the following may create a new basic block
and renumber the existing basic blocks. */
if (split_at_insn != BB_END (bb))
{
e = split_block (bb, split_at_insn);
if (e)
blocks_split++;
}
make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE);
}
if (insn == BB_HEAD (bb))
break;
}
}
if (blocks_split)
verify_flow_info ();
return blocks_split;
}
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
/* Implementation of CFG manipulation for linearized RTL. */
struct cfg_hooks rtl_cfg_hooks = {
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
"rtl",
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
rtl_verify_flow_info,
rtl_dump_bb,
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
rtl_create_basic_block,
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
rtl_redirect_edge_and_branch,
rtl_redirect_edge_and_branch_force,
rtl_delete_block,
rtl_split_block,
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
rtl_move_block_after,
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
rtl_can_merge_blocks, /* can_merge_blocks_p */
rtl_merge_blocks,
rtl_predict_edge,
rtl_predicted_by_p,
NULL, /* can_duplicate_block_p */
NULL, /* duplicate_block */
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
rtl_split_edge,
rtl_make_forwarder_block,
rtl_tidy_fallthru_edge,
rtl_block_ends_with_call_p,
rtl_block_ends_with_condjump_p,
rtl_flow_call_edges_add
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
};
/* Implementation of CFG manipulation for cfg layout RTL, where
basic block connected via fallthru edges does not have to be adjacent.
This representation will hopefully become the default one in future
version of the compiler. */
/* We do not want to declare these functions in a header file, since they
should only be used through the cfghooks interface, and we do not want to
move them here since it would require also moving quite a lot of related
code. */
extern bool cfg_layout_can_duplicate_bb_p (basic_block);
extern basic_block cfg_layout_duplicate_bb (basic_block);
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
struct cfg_hooks cfg_layout_rtl_cfg_hooks = {
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
"cfglayout mode",
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
rtl_verify_flow_info_1,
rtl_dump_bb,
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
cfg_layout_create_basic_block,
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
cfg_layout_redirect_edge_and_branch,
cfg_layout_redirect_edge_and_branch_force,
cfg_layout_delete_block,
cfg_layout_split_block,
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
rtl_move_block_after,
basic-block.h (create_basic_block, [...]): Kill. * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Use merge_blocks. (try_optimize_cfg): Use merge_blocks_move. * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. (merge_blocks_nomove): Rename to rtl_merge_blocks. (cfg_layout_create_basic_block): New. (rtl_can_merge_blocks): New. (cfg_layout_split_block): Do not alloc aux by hand. * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, merge_blocks. (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. * cfgloopmanip.c (loop_split_edge_with): Likewise. * ifcvt.c (merge_if_block): Use merge_blocks_nomove. * basic-block.h (basic_block_def): Add field 'rbi'. * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, find_traces_1_round, copy_bb, connect_traces): Update use of rbi. * cfg.c (entry_exit_blocks): Add new field. * cfglayout.c: Include alloc-pool.h; (cfg_layout_pool): New. (record_effective_endpoints, fixup_reorder_chain, fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use of rbi. (cfg_layout_initialize_rbi): New function. (cfg_layout_initialize): Use it. (cfg_layout_finalize): Clear rbi fields. * cfglayout.h (RBI): Kill. (cfg_layout_initialize_rbi): Declare. * cfgloopmanip.c (copy_bbs): Use rbi. (record_exit_edges): Likewise. (duplicate_loop_to_header_edge): Likewise. * cfgrtl.c (cfg_layout_create_basic_block): Use cfg_layout_initialize_rbi. (cfg_layout_split_block): Use rbi. (cfg_layout_delete_block): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * loop-unswitch.c (unswitch_loop): Likewise. * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. * cfgrtl.c: Update comments. (try_redirect_by_replacing_jump): New argument. (redirect_branch_edge): Break out from ... (rtl_redirect_edge_and_branch): ... this one. (update_cfg_after_block_merging): Break out from ... (rtl_merge_blocks): ... this one. (cfg_layout_split_edge): New. (cfg_layout_merge_blocks): New. (cfg_layout_can_merge_blocks_p): New. (cfg_layout_redirect_edge_and_branch): Reorganize. (cfg_layout_rtl_cfg_hooks): Fill in. (cfg_layout_delete_block): Kill barriers. * cfganal.c (can_fallthru): Deal with exit blocks * cfglayout.c (cfg_layout_function_header): New function (record_effective_endpoints): Record function header. (fixup_reorder_chain): Fixup dead jumptables; place header * basic-block.h (CLEANUP_CFGLAYOUT): New flag. * bb-reorder.c (cfg_layout_initialize): Update call. * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru edges in cfglayout mode. * cfglayout.c (cleanup_unconditional_jumps): Kill. (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. * cfglayout.h (cfg_layout_initialize): Update prototype. * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. * cfgloopmanip.c (loop_split_edge_with): Use split_edge. * flow.c (propagate_block): Do not crash when basic block ends by first insn in the chain. * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later do loop discovery. * tracer.c (tracer): Update call of cfg_layout_initialize. From-SVN: r68899
2003-07-03 20:40:29 +02:00
cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks,
rtl_predict_edge,
rtl_predicted_by_p,
cfg_layout_can_duplicate_bb_p,
cfg_layout_duplicate_bb,
Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): Declaration removed. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. (debug_bb, debug_bb_n): Add argument to dump_bb call. * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block instead of delete_block. * cfghooks.c: Include timevar.h and toplev.h. (cfg_hooks): Define here. (verify_flow_info, dump_bb): Moved from cfg.c. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New functions. * cfghooks.h (struct cfg_hooks): Added fields name, make_forwarder_block, tidy_fallthru_edge and move_block_after. Changed type of verify_flow_info, dump_bb, split_block fields. Renamed cfgh_split_edge and delete_block fields. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, delete_block, split_edge, create_basic_block, can_merge_blocks_p, merge_blocks): Macros removed. (cfg_hooks): Do not export. (verify_flow_info, dump_bb, redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, split_block_after_labels, move_block_after, delete_basic_block, split_edge, create_basic_block, create_empty_bb, can_merge_blocks_p, merge_blocks, make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): Declare. (cfg_layout_rtl_cfg_hooks): Declare. * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. (canonicalize_loop_headers): Use new semantics of make_forwarder_block. (redirect_edge_with_latch_update): Removed. (make_forwarder_block): Moved to cfghooks.c, semantics changed. * cfgloopmanip.c (remove_bbs): Do not update dominators here. * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, rtl_delete_block, rtl_split_block, rtl_merge_blocks, tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to cfghooks.c. (rtl_create_basic_block): Coding style fix. (rtl_tidy_fallthru_edge, rtl_move_block_after, rtl_make_forwarder_block): New functions. (update_cfg_after_block_merging): Removed. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument to dump_bb. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Don't update dominators. * timevar.def (TV_CFG_VERIFY): New. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (remove_bbs): Don't call remove_bbs. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New static functions. From-SVN: r76851
2004-01-29 08:47:56 +01:00
cfg_layout_split_edge,
rtl_make_forwarder_block,
NULL,
rtl_block_ends_with_call_p,
rtl_block_ends_with_condjump_p,
rtl_flow_call_edges_add
function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames. (pro_epilogue_adjust_stack_rex64_2): New pattern * cfghooks.h, cfghooks.c: New files. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. (OBJS): Add cfghooks.o. (cfghooks.o): New rule. * basic-block.h (split_edge): Rename to rtl_split_edge. (verify_flow_info): Rename to rtl_verify_flow_info. (cfghooks.h): Included here. * cfgrtl.c (split_edge): Renamed rtl_split_edge. (verify_flow_info): Renamed rtl_verify_flow_info. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. * basic-block.h (split_block, split_edge, flow_delete_block, redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. (flow_delete_block_noexpunge): Return void. * cfg.c (verify_flow_info): New function. * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): Use delete_block. * cfglayout.c (function_footer): Rename to... (cfg_layout_function_footer): ... this variable (unlink_insn_chain): Make global. (fixup_reorder_chain, record_effective_endpoints): Update. (cleanup_unconditional_jumps): Use delete_block. (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. (cfg_layout_initialize, cfg_layout_finalize): Update hooks. * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. (cfg_layout_function_footer): Declare. * cfgloopmanip (split_loop_bb): Do not update RBI. (remove_bbs): Use delete_block. (loop_reidrect_edge, loop_delete_branch_edge): Use redirect_edge_and_branch. (create_preheader): Use split_block and redirect_edge_and_branch_force. (split_edge_with): Likewise. * cfgrtl.c: Include cfglayout.h (split_edge): Rename to ... (rtl_split_edge) ... this one; make local. (redirect_edge_and_branch): Rename to ... (rtl_redirect_edge_and_branch) ... this one; make local. (redirect_edge_and_branch_force): Rename to ... (rtl_redirect_edge_and_branch_force) ... this one; make local. (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from cfglayout.c; update to directly call RTL counterparts. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. * ifcvt.c (find_cond_trap): Use delete_block. (find_if_case_1): Use delete_block. (find_if_case_2): Use delete_block. * rtl.h (unlink_insn_chain): Declare. * toplev.c (rtl_reigster_cfg_hooks): New. From-SVN: r67535
2003-06-06 11:24:26 +02:00
};