gcc/gcc/cfg.c

1230 lines
30 KiB
C
Raw Permalink Normal View History

Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987-2017 Free Software Foundation, Inc.
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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 3, or (at your option) any later
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
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 COPYING3. If not see
<http://www.gnu.org/licenses/>. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* This file contains low level functions to manipulate the CFG and
analyze it. All other modules should not transform the data structure
directly and use abstraction instead. The file is supposed to be
ordered bottom-up and should not contain any code dependent on a
particular intermediate language (RTL or trees).
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
Available functionality:
- Initialization/deallocation
init_flow, clear_edges
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
- Low level basic block manipulation
alloc_block, expunge_block
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
- Edge manipulation
make_edge, make_single_succ_edge, cached_make_edge, remove_edge
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
- Low level edge redirection (without updating instruction chain)
redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred
- Dumping and debugging
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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_flow_info, debug_flow_info, dump_edge_info
- Allocation of AUX fields for basic blocks
alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_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
- clear_bb_flags
- Consistency checking
verify_flow_info
- Dumping and debugging
print_rtl_with_bb, dump_bb, debug_bb, debug_bb_n
basic-block.h: Re-group most prototypes per file. gcc/ * basic-block.h: Re-group most prototypes per file. (struct edge_list): Remove num_blocks field. (dump_bb_info): Adjust prototypes. (dump_reg_info): Move prototype to regs.h. * function.h: Do not include tree.h. Include vec.h, vecir.h, input.h and machmode.h to compensate. (function_name): New prototype. * gimple.h: Include tree.h to compensate for basic-block.h change. * langhooks.h: Note that tree.h is only necessary for enum tree_code. * regs.h (dump_reg_info): Prototype here. * regset.h: Adjust file reference in comment. (debug_regset): Remove prototype. * rtl.h: Include flags.h for flag_var_tracking_assignments. (MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS. (dump_reg_info, dump_flow_info): Remove prototypes. * bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c to here, the only user. Make static. (reorder_basic_blocks): Call dump_reg_info before dump_flow_info. * cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h, flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h, tree-pass.h, cfgloop.h, and tree-flow.h. Include basic-block.h, the first header I'd expect to be included. (reg_obstack): Move to df-core.c. (free_edge): Remove bogus ATTRIBUTE_UNUSED. (remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Move to cfghooks.c. (dump_regset, debug_regset): Move to df-core.c. (dump_bb_info): Move to cfgrtl.c. (dump_reg_info): Move to regstat.c. (dump_flow_info): Move to cfgrtl.c. (debug_flow_info): Likewise. (dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense. * cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h, insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Move to cfgrtl.c. (set_edge_can_fallthru_flag): Moved to bb-reorder.c. (create_edge_list): Do not set edge_list's removed num_blocks. (print_edge_list): Look at n_basic_blocks instead of num_blocks. (flow_nodes_print): Remove. (flow_edge_list_print): Remove. (inverted_post_order_compute): Use FOR_ALL_BB. *cfgrtl.c (dump_flow_info): Moved from cfg.c. Do not call dump_reg_info. (debug_flow_info): Moved from cfg.c (dump_bb_info): Moved from cfg.c. Take 'verbose' argument to avoid looking at TDF_* flags from tree-pass.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Moved from cfganal.c. (print_rtl_with_bb): Adjust dump_bb_info calls. * cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c. (remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE. (cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS. * cselib.c: Include tree.h with a FIXME. * df-core.c (reg_obstack): Moved from cfg.c. (dump_regset): Likewise. (debug_regset): Likewise. Make a DEBUG_FUNCTION. * final.c (compute_alignments): Call dump_reg_info before dump_flow_info. * function.c (function_name): New function. (current_function_name): Use it. * ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before dump_flow_info. * ira-conflicts.c: Include tree.h with a note. * regstat.c (dump_reg_info): Moved here from cfg.c. * loop-init.c: Include regs.h instead of hard-reg-set.h. (rtl_loop_init): Call dump_reg_info before dump_flow_info. (rtl_loop_done): Likewise. * mcf.c: Include tree.h before langhooks.h. * predict.c (maybe_hot_count_p): Assert we have cfun. (probably_never_executed_bb_p): Likewise. * profile.c (compute_branch_probabilities): Use gimple_dump_cfg instead of dump_flow_info. * sched-deps.c: Include tree.h with a FIXME. (call_may_noreturn_p): Add FIXME note why this function has to look at function decls instead of function decl flags. * sched-vis.c: Include tree.h with a FIXME. (print_rtl_slim): Adjust dump_bb_info uses. * statistics.c (statistics_fini_pass_2): Use current_function_name to avoid including tree.h. (statistics_counter_event): Use function_name for the same reason. (statistics_histogram_event): Likewise. * tracer.c (tracer): Remove bogus gcc_assert. Use brief_dump_cfg instead of dump_flow_info. * var-tracking.c (variable_tracking_main_1): Call dump_reg_info before dump_flow_info. * doc/cfg.texi: Update CFG documentation. * Makefile.in (RTL_H): Depend on FLAGS_H. (GIMPLE_H): Depend on TREE_H. (FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H, but no longer on TREE_H. (C_COMMON_H): Depend on TREE_H. (cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o, sched-deps.o, sched-vis.o): Fixup dependencies. c-family/ * c-common.h: Include tree.h. cp/ * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site. From-SVN: r189359
2012-07-08 12:06:14 +02:00
TODO: Document these "Available functionality" functions in the files
that implement them.
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
*/
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * testsuite/gcc.dg/plugin/ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c/c-typeck.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c-family/c-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * cp/cp-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * go/go-gcc.cc: Adjust include files. * go/go-lang.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * java/java-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * lto/lto-lang.c: Adjust include files. * lto/lto-object.c: Ditto. * lto/lto-partition.c: Ditto. * lto/lto-symtab.c: Ditto. * lto/lto.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * basic-block.h: Remove all includes. (enum profile_status_d, struct control_flow_graph): Move to cfg.h * cfg.h (profile_status_d, struct control_flow_graph): Relocate here. * Makefile.in (GTFILES): Add cfg.h to list. * cgraph.h (symbol_table::create_empty): Move to cgraph.c. * cgraph.c (symbol_table::create_empty): Relocate from cgraph.h. * genconditions.c (write_header): Add predict.h and basic-block.h to lits of includes. * genemit.c (main): Ditto. * genpreds.c (write_insn_preds_c): Ditto. * genrecog.c (write_header): Ditto. * gengtype.c (open_base_files): Add predict.h, basic-block.h, and cfg.h to list of includes. * alias.c: Adjust include files. * asan.c: Ditto. * auto-inc-dec.c: Ditto. * auto-profile.c: Ditto. * bb-reorder.c: Ditto. * bt-load.c: Ditto. * builtins.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfganal.c: Ditto. * cfgbuild.c: Ditto. * cfgcleanup.c: Ditto. * cfgexpand.c: Ditto. * cfghooks.c: Ditto. * cfgloop.c: Ditto. * cfgloopanal.c: Ditto. * cfgloopmanip.c: Ditto. * cfgrtl.c: Ditto. * cgraphbuild.c: Ditto. * cgraphclones.c: Ditto. * cgraphunit.c: Ditto. * combine-stack-adj.c: Ditto. * combine.c: Ditto. * compare-elim.c: Ditto. * coverage.c: Ditto. * cprop.c: Ditto. * cse.c: Ditto. * cselib.c: Ditto. * data-streamer-in.c: Ditto. * data-streamer-out.c: Ditto. * data-streamer.c: Ditto. * dce.c: Ditto. * ddg.c: Ditto. * ddg.h: Ditto. * df-core.c: Ditto. * df-problems.c: Ditto. * df-scan.c: Ditto. * df.h: Ditto. * dojump.c: Ditto. * dominance.c: Ditto. * domwalk.c: Ditto. * dse.c: Ditto. * dwarf2cfi.c: Ditto. * emit-rtl.c: Ditto. * et-forest.c: Ditto. * except.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * fwprop.c: Ditto. * gcc-plugin.h: Ditto. * gcse.c: Ditto. * generic-match-head.c: Ditto. * ggc-page.c: Ditto. * gimple-builder.c: Ditto. * gimple-expr.c: Ditto. * gimple-fold.c: Ditto. * gimple-iterator.c: Ditto. * gimple-low.c: Ditto. * gimple-match-head.c: Ditto. * gimple-pretty-print.c: Ditto. * gimple-ssa-isolate-paths.c: Ditto. * gimple-ssa-strength-reduction.c: Ditto. * gimple-streamer-in.c: Ditto. * gimple-streamer-out.c: Ditto. * gimple-streamer.h: Ditto. * gimple-walk.c: Ditto. * gimple.c: Ditto. * gimplify-me.c: Ditto. * gimplify.c: Ditto. * graph.c: Ditto. * graphite-blocking.c: Ditto. * graphite-clast-to-gimple.c: Ditto. * graphite-dependences.c: Ditto. * graphite-interchange.c: Ditto. * graphite-isl-ast-to-gimple.c: Ditto. * graphite-optimize-isl.c: Ditto. * graphite-poly.c: Ditto. * graphite-scop-detection.c: Ditto. * graphite-sese-to-poly.c: Ditto. * graphite.c: Ditto. * haifa-sched.c: Ditto. * hw-doloop.c: Ditto. * ifcvt.c: Ditto. * init-regs.c: Ditto. * internal-fn.c: Ditto. * ipa-cp.c: Ditto. * ipa-devirt.c: Ditto. * ipa-icf-gimple.c: Ditto. * ipa-icf.c: Ditto. * ipa-inline-analysis.c: Ditto. * ipa-inline.c: Ditto. * ipa-polymorphic-call.c: Ditto. * ipa-profile.c: Ditto. * ipa-prop.c: Ditto. * ipa-pure-const.c: Ditto. * ipa-reference.c: Ditto. * ipa-split.c: Ditto. * ipa-utils.c: Ditto. * ipa.c: Ditto. * ira-build.c: Ditto. * ira-color.c: Ditto. * ira-conflicts.c: Ditto. * ira-costs.c: Ditto. * ira-emit.c: Ditto. * ira-lives.c: Ditto. * ira.c: Ditto. * jump.c: Ditto. * lcm.c: Ditto. * loop-doloop.c: Ditto. * loop-init.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * loop-unroll.c: Ditto. * lower-subreg.c: Ditto. * lra-assigns.c: Ditto. * lra-coalesce.c: Ditto. * lra-constraints.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * lra.c: Ditto. * lto-cgraph.c: Ditto. * lto-compress.c: Ditto. * lto-opts.c: Ditto. * lto-section-in.c: Ditto. * lto-section-out.c: Ditto. * lto-streamer-in.c: Ditto. * lto-streamer-out.c: Ditto. * lto-streamer.c: Ditto. * mcf.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * omp-low.c: Ditto. * optabs.c: Ditto. * opts-global.c: Ditto. * passes.c: Ditto. * postreload-gcse.c: Ditto. * postreload.c: Ditto. * predict.c: Ditto. * print-rtl.c: Ditto. * profile.c: Ditto. * recog.c: Ditto. * ree.c: Ditto. * reg-stack.c: Ditto. * regcprop.c: Ditto. * regcprop.h: Ditto. * reginfo.c: Ditto. * regrename.c: Ditto. * regstat.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtlanal.c: Ditto. * sched-deps.c: Ditto. * sched-ebb.c: Ditto. * sched-int.h: Ditto. * sched-rgn.c: Ditto. * sched-vis.c: Ditto. * sel-sched-dump.c: Ditto. * sel-sched-ir.c: Ditto. * sel-sched-ir.h: Ditto. * sel-sched.c: Ditto. * sese.c: Ditto. * shrink-wrap.c: Ditto. * stack-ptr-mod.c: Ditto. * stmt.c: Ditto. * store-motion.c: Ditto. * symtab.c: Ditto. * toplev.c: Ditto. * tracer.c: Ditto. * trans-mem.c: Ditto. * tree-affine.c: Ditto. * tree-call-cdce.c: Ditto. * tree-cfg.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-chrec.c: Ditto. * tree-complex.c: Ditto. * tree-data-ref.c: Ditto. * tree-dfa.c: Ditto. * tree-eh.c: Ditto. * tree-emutls.c: Ditto. * tree-if-conv.c: Ditto. * tree-inline.c: Ditto. * tree-into-ssa.c: Ditto. * tree-loop-distribution.c: Ditto. * tree-nested.c: Ditto. * tree-nrv.c: Ditto. * tree-object-size.c: Ditto. * tree-outof-ssa.c: Ditto. * tree-parloops.c: Ditto. * tree-phinodes.c: Ditto. * tree-predcom.c: Ditto. * tree-pretty-print.c: Ditto. * tree-profile.c: Ditto. * tree-scalar-evolution.c: Ditto. * tree-sra.c: Ditto. * tree-ssa-address.c: Ditto. * tree-ssa-alias.c: Ditto. * tree-ssa-ccp.c: Ditto. * tree-ssa-coalesce.c: Ditto. * tree-ssa-copy.c: Ditto. * tree-ssa-copyrename.c: Ditto. * tree-ssa-dce.c: Ditto. * tree-ssa-dom.c: Ditto. * tree-ssa-dse.c: Ditto. * tree-ssa-forwprop.c: Ditto. * tree-ssa-ifcombine.c: Ditto. * tree-ssa-live.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * tree-ssa-loop-niter.c: Ditto. * tree-ssa-loop-prefetch.c: Ditto. * tree-ssa-loop-unswitch.c: Ditto. * tree-ssa-loop.c: Ditto. * tree-ssa-math-opts.c: Ditto. * tree-ssa-operands.c: Ditto. * tree-ssa-phiopt.c: Ditto. * tree-ssa-phiprop.c: Ditto. * tree-ssa-pre.c: Ditto. * tree-ssa-propagate.c: Ditto. * tree-ssa-reassoc.c: Ditto. * tree-ssa-sccvn.c: Ditto. * tree-ssa-sink.c: Ditto. * tree-ssa-strlen.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-tail-merge.c: Ditto. * tree-ssa-ter.c: Ditto. * tree-ssa-threadedge.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tree-ssa-uncprop.c: Ditto. * tree-ssa-uninit.c: Ditto. * tree-ssa.c: Ditto. * tree-ssanames.c: Ditto. * tree-stdarg.c: Ditto. * tree-streamer-in.c: Ditto. * tree-streamer-out.c: Ditto. * tree-streamer.c: Ditto. * tree-switch-conversion.c: Ditto. * tree-tailcall.c: Ditto. * tree-vect-data-refs.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-loop-manip.c: Ditto. * tree-vect-loop.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vectorizer.c: Ditto. * tree-vrp.c: Ditto. * tree.c: Ditto. * tsan.c: Ditto. * ubsan.c: Ditto. * valtrack.c: Ditto. * valtrack.h: Ditto. * value-prof.c: Ditto. * var-tracking.c: Ditto. * varasm.c: Ditto. * varpool.c: Ditto. * vtable-verify.c: Ditto. * web.c: Ditto. * config/aarch64/aarch64-builtins.c: Ditto. * config/aarch64/aarch64.c: Ditto. * config/alpha/alpha.c: Ditto. * config/arc/arc.c: Ditto. * config/arm/arm.c: Ditto. * config/avr/avr.c: Ditto. * config/bfin/bfin.c: Ditto. * config/c6x/c6x.c: Ditto. * config/cr16/cr16.c: Ditto. * config/cris/cris.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/epiphany/epiphany.c: Ditto. * config/epiphany/mode-switch-use.c: Ditto. * config/epiphany/resolve-sw-modes.c: Ditto. * config/fr30/fr30.c: Ditto. * config/frv/frv.c: Ditto. * config/h8300/h8300.c: Ditto. * config/i386/i386.c: Ditto. * config/i386/winnt.c: Ditto. * config/ia64/ia64.c: Ditto. * config/iq2000/iq2000.c: Ditto. * config/lm32/lm32.c: Ditto. * config/m32c/m32c.c: Ditto. * config/m32r/m32r.c: Ditto. * config/m68k/m68k.c: Ditto. * config/mcore/mcore.c: Ditto. * config/mep/mep.c: Ditto. * config/microblaze/microblaze.c: Ditto. * config/mips/mips.c: Ditto. * config/mmix/mmix.c: Ditto. * config/mn10300/mn10300.c: Ditto. * config/moxie/moxie.c: Ditto. * config/msp430/msp430.c: Ditto. * config/nds32/nds32-cost.c: Ditto. * config/nds32/nds32-fp-as-gp.c: Ditto. * config/nds32/nds32-intrinsic.c: Ditto. * config/nds32/nds32-isr.c: Ditto. * config/nds32/nds32-md-auxiliary.c: Ditto. * config/nds32/nds32-memory-manipulation.c: Ditto. * config/nds32/nds32-pipelines-auxiliary.c: Ditto. * config/nds32/nds32-predicates.c: Ditto. * config/nds32/nds32.c: Ditto. * config/nios2/nios2.c: Ditto. * config/pa/pa.c: Ditto. * config/pdp11/pdp11.c: Ditto. * config/rl78/rl78.c: Ditto. * config/rs6000/rs6000.c: Ditto. * config/rx/rx.c: Ditto. * config/s390/s390.c: Ditto. * config/sh/sh-mem.cc: Ditto. * config/sh/sh.c: Ditto. * config/sh/sh_optimize_sett_clrt.cc: Ditto. * config/sh/sh_treg_combine.cc: Ditto. * config/sparc/sparc.c: Ditto. * config/spu/spu.c: Ditto. * config/stormy16/stormy16.c: Ditto. * config/tilegx/tilegx.c: Ditto. * config/tilepro/tilepro.c: Ditto. * config/v850/v850.c: Ditto. * config/vax/vax.c: Ditto. * config/xtensa/xtensa.c: Ditto. From-SVN: r216735
2014-10-27 13:41:01 +01:00
#include "hard-reg-set.h"
alias.c: Reorder #include statements and remove duplicates. 2015-10-29 Andrew MacLeod <amacleod@redhat.com> * alias.c: Reorder #include statements and remove duplicates. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-common.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-poly.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. From-SVN: r229526
2015-10-29 14:57:32 +01:00
#include "tree.h"
#include "cfghooks.h"
#include "df.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "cfganal.h"
basic-block.h: Re-group most prototypes per file. gcc/ * basic-block.h: Re-group most prototypes per file. (struct edge_list): Remove num_blocks field. (dump_bb_info): Adjust prototypes. (dump_reg_info): Move prototype to regs.h. * function.h: Do not include tree.h. Include vec.h, vecir.h, input.h and machmode.h to compensate. (function_name): New prototype. * gimple.h: Include tree.h to compensate for basic-block.h change. * langhooks.h: Note that tree.h is only necessary for enum tree_code. * regs.h (dump_reg_info): Prototype here. * regset.h: Adjust file reference in comment. (debug_regset): Remove prototype. * rtl.h: Include flags.h for flag_var_tracking_assignments. (MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS. (dump_reg_info, dump_flow_info): Remove prototypes. * bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c to here, the only user. Make static. (reorder_basic_blocks): Call dump_reg_info before dump_flow_info. * cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h, flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h, tree-pass.h, cfgloop.h, and tree-flow.h. Include basic-block.h, the first header I'd expect to be included. (reg_obstack): Move to df-core.c. (free_edge): Remove bogus ATTRIBUTE_UNUSED. (remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Move to cfghooks.c. (dump_regset, debug_regset): Move to df-core.c. (dump_bb_info): Move to cfgrtl.c. (dump_reg_info): Move to regstat.c. (dump_flow_info): Move to cfgrtl.c. (debug_flow_info): Likewise. (dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense. * cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h, insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Move to cfgrtl.c. (set_edge_can_fallthru_flag): Moved to bb-reorder.c. (create_edge_list): Do not set edge_list's removed num_blocks. (print_edge_list): Look at n_basic_blocks instead of num_blocks. (flow_nodes_print): Remove. (flow_edge_list_print): Remove. (inverted_post_order_compute): Use FOR_ALL_BB. *cfgrtl.c (dump_flow_info): Moved from cfg.c. Do not call dump_reg_info. (debug_flow_info): Moved from cfg.c (dump_bb_info): Moved from cfg.c. Take 'verbose' argument to avoid looking at TDF_* flags from tree-pass.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Moved from cfganal.c. (print_rtl_with_bb): Adjust dump_bb_info calls. * cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c. (remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE. (cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS. * cselib.c: Include tree.h with a FIXME. * df-core.c (reg_obstack): Moved from cfg.c. (dump_regset): Likewise. (debug_regset): Likewise. Make a DEBUG_FUNCTION. * final.c (compute_alignments): Call dump_reg_info before dump_flow_info. * function.c (function_name): New function. (current_function_name): Use it. * ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before dump_flow_info. * ira-conflicts.c: Include tree.h with a note. * regstat.c (dump_reg_info): Moved here from cfg.c. * loop-init.c: Include regs.h instead of hard-reg-set.h. (rtl_loop_init): Call dump_reg_info before dump_flow_info. (rtl_loop_done): Likewise. * mcf.c: Include tree.h before langhooks.h. * predict.c (maybe_hot_count_p): Assert we have cfun. (probably_never_executed_bb_p): Likewise. * profile.c (compute_branch_probabilities): Use gimple_dump_cfg instead of dump_flow_info. * sched-deps.c: Include tree.h with a FIXME. (call_may_noreturn_p): Add FIXME note why this function has to look at function decls instead of function decl flags. * sched-vis.c: Include tree.h with a FIXME. (print_rtl_slim): Adjust dump_bb_info uses. * statistics.c (statistics_fini_pass_2): Use current_function_name to avoid including tree.h. (statistics_counter_event): Use function_name for the same reason. (statistics_histogram_event): Likewise. * tracer.c (tracer): Remove bogus gcc_assert. Use brief_dump_cfg instead of dump_flow_info. * var-tracking.c (variable_tracking_main_1): Call dump_reg_info before dump_flow_info. * doc/cfg.texi: Update CFG documentation. * Makefile.in (RTL_H): Depend on FLAGS_H. (GIMPLE_H): Depend on TREE_H. (FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H, but no longer on TREE_H. (C_COMMON_H): Depend on TREE_H. (cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o, sched-deps.o, sched-vis.o): Fixup dependencies. c-family/ * c-common.h: Include tree.h. cp/ * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site. From-SVN: r189359
2012-07-08 12:06:14 +02:00
#include "cfgloop.h" /* FIXME: For struct loop. */
system.h (dump_file): Do not define. gcc/ * system.h (dump_file): Do not define. * tree-pass.h: Include dumpfile.h, which is a new file containing... (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name, dump_file, dump_flags, dump_file_name, get_dump_file_info, struct dump_file_info): all of this, moved to... * dumpfile.h: Here, new file. * tree-dump.h: Include dumpfile.h, but not tree-pass.h. (dump_stmt): Remove prototype for C++ specific function. (dump_enumerated_decls): Move prototype from here... * tree-flow.h (dump_enumerated_decls): ... to here. (get_ref_base_and_extent) Move prototype from here ... * tree.h (get_ref_base_and_extent) ... to here. * tree-ssa-live.c: Do not inclde tree-pretty-print.h, because gimple-pretty-print.h is enough. Do not include tree-dump.h, include timevar.h and dumpfile.h instead. (struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls): Move from here ... * tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls):... to here. Do not include timevar.h. * tree.c: Do not include timevar.h. * tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and timevar.h. (dump_cfg_stats): Use current_function_name. (gimple_cfg2vcg): Likewise. (dump_function_to_file): Likewise. * df-scan.c: Do not include tree-pass.h and timevar.h. Include dumpfile.h. (df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not use print_current_pass. * df-problems.c: Include dumpfile.h. Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it leads to errors in the code not selected. (df_note_compute): Do not print_rtl_with_bb here. Fix compilation bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here. * lcm.c: Include dumpfile.h. Remove obsolete include of insn-attr.h. * dojump.c (do_compare_rtx_and_jump): Remove failure printing for missing probability notes. * stmt.c: Include dumpfile.h. (emit_case_decision_tree): Re-enable printing expand details only if TDF_DETAILS. * alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, function.c, fwprop.c, gcse.c, gimple-fold.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-interchange.c, graphite-optimize-isl.c, graphite-poly.c, graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, loop-unroll.c, loop-unswitch.c, lower-subreg.c, lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, store-motion.c, tracer.c, trans-mem.c, tree-affine.c, tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, tree-data-ref.c, tree-diagnostic.c, tree-dump.c, tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, tree-mudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vect-loop-manip.c, tree-vectorizer.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h only if needed. If tree-pass.h is included, do not include timevar.h and dumpfile.h. If tree-pass.h is not included but dump_file, or dump_flags, or the TDF_* flags are used, include dumpfile.h. If gimple-pretty-print.h is included, don't include tree-pretty-print.h. Remove assorted unnecessary includes. * config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c, config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c, config/spu/spu.c, config/mep/mep.c, config/i386/i386.c: Include dumpfile.h. * config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h. * arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep, spu/t-spu-elf: Fix dependencies. c-family/ * c-gimplify.c: Include dumpfile.h instead of tree-dump.h. * c-ada-spec.c: Likewise. * c-dump.c (dump_stmt): Move to cp/dump.c, the only user. c/ * c-decl.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. cp/ * dump.c (dump_stmt): Moved here from c-dump.c. * optimize.c: Include dumpfile.h instead of tree-dump.h. * class.c: Likewise. * decl2.c: Likewise. * Make-lang.in: Fix dependencies. fortran/ * f95-lang.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. java/ * java-gimplify.c Include dumpfile.h instead of tree-dump.h * Make-lang.in: Fix dependencies. lto/ * lto.c: Do not include timevar.h. * Make-lang.in: Fix dependencies. ada/ * gcc-interface/utils.c: Include timevar.h. * Make-lang.in: Fix dependencies. From-SVN: r189519
2012-07-16 13:32:42 +02:00
#include "dumpfile.h"
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
/* Called once at initialization time. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
init_flow (struct function *the_fun)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
if (!the_fun->cfg)
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
the_fun->cfg = ggc_cleared_alloc<control_flow_graph> ();
n_edges_for_fn (the_fun) = 0;
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
ENTRY_BLOCK_PTR_FOR_FN (the_fun)
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
= ggc_cleared_alloc<basic_block_def> ();
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
ENTRY_BLOCK_PTR_FOR_FN (the_fun)->index = ENTRY_BLOCK;
EXIT_BLOCK_PTR_FOR_FN (the_fun)
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
= ggc_cleared_alloc<basic_block_def> ();
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
EXIT_BLOCK_PTR_FOR_FN (the_fun)->index = EXIT_BLOCK;
ENTRY_BLOCK_PTR_FOR_FN (the_fun)->next_bb
= EXIT_BLOCK_PTR_FOR_FN (the_fun);
EXIT_BLOCK_PTR_FOR_FN (the_fun)->prev_bb
= ENTRY_BLOCK_PTR_FOR_FN (the_fun);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* Helper function for remove_edge and clear_edges. Frees edge structure
basic-block.h: Re-group most prototypes per file. gcc/ * basic-block.h: Re-group most prototypes per file. (struct edge_list): Remove num_blocks field. (dump_bb_info): Adjust prototypes. (dump_reg_info): Move prototype to regs.h. * function.h: Do not include tree.h. Include vec.h, vecir.h, input.h and machmode.h to compensate. (function_name): New prototype. * gimple.h: Include tree.h to compensate for basic-block.h change. * langhooks.h: Note that tree.h is only necessary for enum tree_code. * regs.h (dump_reg_info): Prototype here. * regset.h: Adjust file reference in comment. (debug_regset): Remove prototype. * rtl.h: Include flags.h for flag_var_tracking_assignments. (MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS. (dump_reg_info, dump_flow_info): Remove prototypes. * bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c to here, the only user. Make static. (reorder_basic_blocks): Call dump_reg_info before dump_flow_info. * cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h, flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h, tree-pass.h, cfgloop.h, and tree-flow.h. Include basic-block.h, the first header I'd expect to be included. (reg_obstack): Move to df-core.c. (free_edge): Remove bogus ATTRIBUTE_UNUSED. (remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Move to cfghooks.c. (dump_regset, debug_regset): Move to df-core.c. (dump_bb_info): Move to cfgrtl.c. (dump_reg_info): Move to regstat.c. (dump_flow_info): Move to cfgrtl.c. (debug_flow_info): Likewise. (dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense. * cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h, insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Move to cfgrtl.c. (set_edge_can_fallthru_flag): Moved to bb-reorder.c. (create_edge_list): Do not set edge_list's removed num_blocks. (print_edge_list): Look at n_basic_blocks instead of num_blocks. (flow_nodes_print): Remove. (flow_edge_list_print): Remove. (inverted_post_order_compute): Use FOR_ALL_BB. *cfgrtl.c (dump_flow_info): Moved from cfg.c. Do not call dump_reg_info. (debug_flow_info): Moved from cfg.c (dump_bb_info): Moved from cfg.c. Take 'verbose' argument to avoid looking at TDF_* flags from tree-pass.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Moved from cfganal.c. (print_rtl_with_bb): Adjust dump_bb_info calls. * cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c. (remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE. (cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS. * cselib.c: Include tree.h with a FIXME. * df-core.c (reg_obstack): Moved from cfg.c. (dump_regset): Likewise. (debug_regset): Likewise. Make a DEBUG_FUNCTION. * final.c (compute_alignments): Call dump_reg_info before dump_flow_info. * function.c (function_name): New function. (current_function_name): Use it. * ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before dump_flow_info. * ira-conflicts.c: Include tree.h with a note. * regstat.c (dump_reg_info): Moved here from cfg.c. * loop-init.c: Include regs.h instead of hard-reg-set.h. (rtl_loop_init): Call dump_reg_info before dump_flow_info. (rtl_loop_done): Likewise. * mcf.c: Include tree.h before langhooks.h. * predict.c (maybe_hot_count_p): Assert we have cfun. (probably_never_executed_bb_p): Likewise. * profile.c (compute_branch_probabilities): Use gimple_dump_cfg instead of dump_flow_info. * sched-deps.c: Include tree.h with a FIXME. (call_may_noreturn_p): Add FIXME note why this function has to look at function decls instead of function decl flags. * sched-vis.c: Include tree.h with a FIXME. (print_rtl_slim): Adjust dump_bb_info uses. * statistics.c (statistics_fini_pass_2): Use current_function_name to avoid including tree.h. (statistics_counter_event): Use function_name for the same reason. (statistics_histogram_event): Likewise. * tracer.c (tracer): Remove bogus gcc_assert. Use brief_dump_cfg instead of dump_flow_info. * var-tracking.c (variable_tracking_main_1): Call dump_reg_info before dump_flow_info. * doc/cfg.texi: Update CFG documentation. * Makefile.in (RTL_H): Depend on FLAGS_H. (GIMPLE_H): Depend on TREE_H. (FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H, but no longer on TREE_H. (C_COMMON_H): Depend on TREE_H. (cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o, sched-deps.o, sched-vis.o): Fixup dependencies. c-family/ * c-common.h: Include tree.h. cp/ * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site. From-SVN: r189359
2012-07-08 12:06:14 +02:00
without actually removing it from the pred/succ arrays. */
static void
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
free_edge (function *fn, edge e)
{
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
n_edges_for_fn (fn)--;
ggc_free (e);
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Free the memory associated with the edge structures. */
void
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
clear_edges (struct function *fn)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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;
edge e;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
FOR_EACH_BB_FN (bb, fn)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, bb->succs)
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
free_edge (fn, e);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_truncate (bb->succs, 0);
vec_safe_truncate (bb->preds, 0);
}
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (fn)->succs)
free_edge (fn, e);
vec_safe_truncate (EXIT_BLOCK_PTR_FOR_FN (fn)->preds, 0);
vec_safe_truncate (ENTRY_BLOCK_PTR_FOR_FN (fn)->succs, 0);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
gcc_assert (!n_edges_for_fn (fn));
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
/* Allocate memory for basic_block. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. * basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. (EDGE_CRITICAL_P): New predicate. * cfg.c (force_nonfallthru_and_redirect, split_edge): Kill EDGE_CRITICAL handling. (insert_insn_on_edge): Use EDGE_CRITICAL_P. (dump_edge_info): Remove "crit". * cfganal.c (mark_critical_edges): Kill. * cfgbuild.c (find_basic_blocks): Remove mark_critical_edges call. * cfgcleanup.c (cleanup_cfg): Likewise. * profile.c (instrument_edges): Use EDGE_CRITICAL_P. (find_spanning_tree): Likewise. * reg-stack.c (convert_regs_1): Likewise. * ssa.c (mark_regs_equivalent_over_bad_edges): Likewise. * basic-block.h (create_basic_block_structure): New. (create_basic_block): Update prototype. (force_nonfallthru): New. * bb-reorder.c (fixup_reorder_chain): Fixup use force_nonfallthru. * cfg.c (create_basic_block_structure): Rename from create_basic_block; handle updating of block_for_insn, creating of empty BBs and BBs at the end of INSN chain. (create_basic_block): New function. (split_block): Use create_basic_block. (force_nonfallthru_and_redirect): Break out from ...; cleanup (redirect_edge_and_branch_force): ... here. (force_nonfallthru): New. (split_edge): Rewrite to use force_nonfallthru and create_block. * cfgbuild.c (find_basic_blocks_1): Use create_basic_block_structure. (find_basic_blocks): Free basic_block_for_insn. * cfgcleanup.c (merge_blocks): Use force_nonfallthru. * cfg.c: Fix formating. * cfgcleanup.c: Fix formating. (merge_blocks, tail_recursion_label_p): Return bool. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Return void. From-SVN: r45549
2001-09-11 18:58:57 +02:00
basic_block
alloc_block (void)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
basic_block bb;
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
bb = ggc_cleared_alloc<basic_block_def> ();
basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. * basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. (EDGE_CRITICAL_P): New predicate. * cfg.c (force_nonfallthru_and_redirect, split_edge): Kill EDGE_CRITICAL handling. (insert_insn_on_edge): Use EDGE_CRITICAL_P. (dump_edge_info): Remove "crit". * cfganal.c (mark_critical_edges): Kill. * cfgbuild.c (find_basic_blocks): Remove mark_critical_edges call. * cfgcleanup.c (cleanup_cfg): Likewise. * profile.c (instrument_edges): Use EDGE_CRITICAL_P. (find_spanning_tree): Likewise. * reg-stack.c (convert_regs_1): Likewise. * ssa.c (mark_regs_equivalent_over_bad_edges): Likewise. * basic-block.h (create_basic_block_structure): New. (create_basic_block): Update prototype. (force_nonfallthru): New. * bb-reorder.c (fixup_reorder_chain): Fixup use force_nonfallthru. * cfg.c (create_basic_block_structure): Rename from create_basic_block; handle updating of block_for_insn, creating of empty BBs and BBs at the end of INSN chain. (create_basic_block): New function. (split_block): Use create_basic_block. (force_nonfallthru_and_redirect): Break out from ...; cleanup (redirect_edge_and_branch_force): ... here. (force_nonfallthru): New. (split_edge): Rewrite to use force_nonfallthru and create_block. * cfgbuild.c (find_basic_blocks_1): Use create_basic_block_structure. (find_basic_blocks): Free basic_block_for_insn. * cfgcleanup.c (merge_blocks): Use force_nonfallthru. * cfg.c: Fix formating. * cfgcleanup.c: Fix formating. (merge_blocks, tail_recursion_label_p): Return bool. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Return void. From-SVN: r45549
2001-09-11 18:58:57 +02:00
return bb;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* Link block B to chain after AFTER. */
void
link_block (basic_block b, basic_block after)
{
b->next_bb = after->next_bb;
b->prev_bb = after;
after->next_bb = b;
b->next_bb->prev_bb = b;
}
/* Unlink block B from chain. */
void
unlink_block (basic_block b)
{
b->next_bb->prev_bb = b->prev_bb;
b->prev_bb->next_bb = b->next_bb;
b->prev_bb = NULL;
b->next_bb = NULL;
}
/* Sequentially order blocks and compact the arrays. */
void
compact_blocks (void)
{
int i;
SET_BASIC_BLOCK_FOR_FN (cfun, ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN (cfun));
SET_BASIC_BLOCK_FOR_FN (cfun, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN (cfun));
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (df)
df_compact_blocks ();
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
else
{
basic_block bb;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
i = NUM_FIXED_BLOCKS;
Eliminate FOR_EACH_BB macro. gcc/ * basic-block.h (FOR_EACH_BB): Eliminate macro. * asan.c (transform_statements, execute_sanopt): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges, set_edge_can_fallthru_flag, fix_up_fall_thru_edges, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes, insert_section_boundary_note, rest_of_handle_reorder_blocks, duplicate_computed_gotos): Likewise. * cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise. * cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges, compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise. * cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs): Likewise. * cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits, verify_loop_structure): Likewise. * cfgloopanal.c (mark_loop_exit_edges): Likewise. * cfgrtl.c (compute_bb_for_insn, find_partition_fixes, verify_hot_cold_block_grouping, purge_all_dead_edges, fixup_abnormal_edges, record_effective_endpoints, outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru, break_superblocks): Likewise. * cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges, cgraph_rebuild_references): Likewise. * combine-stack-adj.c (combine_stack_adjustments): Likewise. * combine.c (delete_noop_moves, create_log_links, combine_instructions): Likewise. * config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise. * config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched, c6x_reorg): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. * config/ia64/ia64.c (ia64_reorg): Likewise. * config/mips/mips.c (mips_annotate_pic_calls): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * config/tilegx/tilegx.c (tilegx_gen_bundles, reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (tilepro_gen_bundles, reorder_var_tracking_notes): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (compute_hash_table_work, compute_cprop_data, local_cprop_pass, find_implicit_sets): Likewise. * cse.c (cse_condition_code_reg): Likewise. * dce.c (prescan_insns_for_dce): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_word_lr_alloc): Likewise. * df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all, df_update_entry_exit_and_calls): Likewise. * dominance.c (calculate_dominance_info, verify_dominators, debug_dominance_info): Likewise. * dse.c (dse_step5_nospill): Likewise. * except.c (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns, rest_of_match_asm_constraints): Likewise. * gcse.c (compute_hash_table_work, prune_expressions, compute_pre_data, compute_code_hoist_vbeinout, hoist_code, calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour, find_explicit_erroneous_behaviour): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa, rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * hw-doloop.c (discover_loops, set_bb_indices, reorder_loops): Likewise. * ifcvt.c (if_convert): Likewise. * init-regs.c (initialize_uninitialized_regs): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * ipa-split.c (find_split_points, execute_split_functions): Likewise. * ira-build.c (form_loop_tree): Likewise. * ira-costs.c (find_costs_and_classes): Likewise. * ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise. * ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered, mark_elimination, update_equiv_regs, find_moveable_pseudos, split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise. * jump.c (mark_all_labels): Likewise. * lcm.c (compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete): Likewise. * loop-init.c (fix_loop_structure): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (decompose_multiword_subregs, decompose_multiword_subregs): Likewise. * lra-assigns.c (assign_by_spills): Likewise. * lra-coalesce.c (lra_coalesce): Likewise. * lra-constraints.c (lra_inheritance, remove_inheritance_pseudos): Likewise. * lra-eliminations.c (lra_init_elimination): Likewise. * lra-spills.c (assign_spill_hard_regs, spill_pseudos, lra_final_code_change): Likewise. * lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver, update_inc_notes): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * modulo-sched.c (rest_of_handle_sms): Likewise. * omp-low.c (optimize_omp_library_calls, expand_omp_taskreg, expand_omp_target): Likewise. * postreload-gcse.c (alloc_mem, compute_hash_table): Likewise. * postreload.c (reload_cse_regs_1): Likewise. * predict.c (strip_predict_hints, tree_bb_level_predictions, tree_estimate_probability, expensive_function_p, estimate_bb_frequencies, compute_function_frequency): Likewise. * profile.c (is_inconsistent, compute_branch_probabilities, branch_prob): Likewise. * ree.c (find_removable_extensions): Likewise. * reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * reginfo.c (init_subregs_of_mode): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (has_nonexceptional_receiver, reload, calculate_elim_costs_all_insns): Likewise. * resource.c (init_resource_info, free_resource_info): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_single_block_region, haifa_find_rgns, sched_rgn_local_init): Likewise. * sel-sched-dump.c (sel_dump_cfg_2): Likewise. * sel-sched-ir.c (init_lv_sets, free_lv_sets, make_regions_from_the_rest): Likewise. * sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification): Likewise. * store-motion.c (compute_store_table, build_store_vectors, one_store_motion_pass): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (compute_transaction_bits): Likewise. * tree-call-cdce.c (tree_call_cdce): Likewise. * tree-cfg.c (replace_loop_annotate, factor_computed_gotos, fold_cond_expr_cond, make_edges, assign_discriminators, make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels, dump_cfg_stats, gimple_verify_flow_info, print_loop, execute_fixup_cfg): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise. * tree-complex.c (init_dont_simulate_again, tree_lower_complex): Likewise. * tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise. * tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch, mark_reachable_handlers): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise. * tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees, insert_backedge_copies, tree_profiling): Likewise. * tree-scalar-evolution.c (scev_const_prop): Likewise. * tree-sra.c (scan_function, sra_modify_function_body, propagate_dereference_distances, ipa_sra_modify_function_body, convert_callers): Likewise. * tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. create_outofssa_var_map, coalesce_partitions): Likewise. * tree-ssa-copy.c (init_copy_prop): Likewise. * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts, eliminate_unnecessary_stmts): Likewise. * tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize): Likewise. * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise. * tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals, new_tree_live_info, calculate_live_on_exit, dump_live_info, analyze_memory_references, fill_always_executed_in, tree_ssa_lim_finalize): Likewise. * tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos, execute_optimize_bswap, execute_optimize_widening_mul): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors): Likewise. * tree-ssa-ter.c (find_replaceable_exprs): Likewise. * tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges, tree_ssa_uncprop): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars, execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise. * tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg): Likewise. * tree-switch-conversion.c (do_switchconv): Likewise. * tree-vect-generic.c (expand_vector_operations): Likewise. * tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses, execute_vect_slp): Likewise. * tree-vrp.c (check_all_array_refs, remove_range_assertions, vrp_initialize, identify_jump_threads, instrument_memory_accesses): Likewise. * ubsan.c (ubsan_pass): Likewise. * value-prof.c (verify_histograms, gimple_value_profile_transformations, gimple_find_values_to_profile): Likewise. * var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes, vt_initialize, delete_debug_insns, vt_finalize): Likewise. gcc/testsuite/ * g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise. From-SVN: r205828
2013-12-09 22:06:06 +01:00
FOR_EACH_BB_FN (bb, cfun)
{
SET_BASIC_BLOCK_FOR_FN (cfun, i, bb);
bb->index = i;
i++;
}
Eliminate n_basic_blocks macro gcc/ * basic-block.h (n_basic_blocks_for_function): Rename macro to... (n_basic_blocks_for_fn): ...this. (n_basic_blocks): Eliminate macro as work towards making uses of cfun be explicit. * cfgloop.c (init_loops_structure): Update for renaming of "n_basic_blocks_for_function" to "n_basic_blocks_for_fn". * graph.c (draw_cfg_nodes_no_loops): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. * lto-streamer-in.c (make_new_block): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. (dump_function_to_file): Likewise. * alias.c (init_alias_analysis): Replace usage of "n_basic_blocks" macro with "n_basic_blocks_for_fn (cfun)". * bb-reorder.c (partition_hot_cold_basic_blocks): Likewise. (duplicate_computed_gotos): Likewise. (reorder_basic_blocks): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (expunge_block): Likewise. (compact_blocks): Likewise. * cfganal.c (single_pred_before_succ_order): Likewise. (compute_idf): Likewise. (flow_dfs_compute_reverse_init): Likewise. (pre_and_rev_post_order_compute): Likewise. (pre_and_rev_post_order_compute_fn): Likewise. (inverted_post_order_compute): Likewise. (post_order_compute): Likewise. (print_edge_list): Likewise. (find_unreachable_blocks): Likewise. (mark_dfs_back_edges): Likewise. * cfgcleanup.c (try_optimize_cfg): Likewise. (try_forward_edges): Likewise. * cfghooks.c (dump_flow_info): Likewise. * cfgloop.c (verify_loop_structure): Likewise. (get_loop_body): Likewise. (flow_loops_find): Likewise. * cfgloopmanip.c (add_loop): Likewise. (remove_path): Likewise. (find_path): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. (rtl_verify_bb_layout): Likewise. (entry_of_function): Likewise. (rtl_create_basic_block): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (one_cprop_pass): Likewise. (is_too_expensive): Likewise. * df-core.c (df_compute_cfg_image): Likewise. (df_compact_blocks): Likewise. (df_worklist_dataflow_doublequeue): Likewise. * dominance.c (calculate_dominance_info): Likewise. (calc_dfs_tree): Likewise. (calc_dfs_tree_nonrec): Likewise. (init_dom_info): Likewise. * domwalk.c (cmp_bb_postorder): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. (generate_setjmp_warnings): Likewise. * fwprop.c (build_single_def_use_links): Likewise. * gcse.c (is_too_expensive): Likewise. (one_code_hoisting_pass): Likewise. (one_pre_gcse_pass): Likewise. * graphite.c (graphite_initialize): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * ipa-inline-analysis.c (estimate_function_body_sizes): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Likewise. * ira-build.c (ira_build): Likewise. * lcm.c (compute_nearerout): Likewise. (compute_available): Likewise. (compute_laterin): Likewise. (compute_antinout_edge): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * lra.c (has_nonexceptional_receiver): Likewise. * mcf.c (create_fixup_graph): Likewise. * profile.c (branch_prob): Likewise. * reg-stack.c (convert_regs_2): Likewise. * regrename.c (regrename_analyze): Likewise. * reload1.c (has_nonexceptional_receiver): Likewise. * reorg.c (dbr_schedule): Likewise. * sched-deps.c (sched_deps_init): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (extend_regions): Likewise. (schedule_insns): Likewise. (sched_rgn_init): Likewise. (extend_rgns): Likewise. (haifa_find_rgns): Likewise. * sel-sched-ir.c (recompute_rev_top_order): Likewise. (sel_recompute_toporder): Likewise. * sel-sched.c (run_selective_scheduling): Likewise. * store-motion.c (one_store_motion_pass): Likewise. (remove_reachable_equiv_notes): Likewise. * tracer.c (tracer): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (gimple_flow_call_edges_add): Likewise. (dump_cfg_stats): Likewise. (gimple_dump_cfg): Likewise. (create_bb): Likewise. (build_gimple_cfg): Likewise. * tree-cfgcleanup.c (merge_phi_nodes): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. (fold_marked_statements): Likewise. * tree-ssa-ifcombine.c (tree_ssa_ifcombine): Likewise. * tree-ssa-loop-ch.c (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (analyze_memory_references): Likewise. * tree-ssa-loop-manip.c (compute_live_loop_exits): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-pre.c (do_pre): Likewise. (init_pre): Likewise. (compute_avail): Likewise. * tree-ssa-reassoc.c (init_reassoc): Likewise. * tree-ssa-sccvn.c (init_scc_vn): Likewise. * tree-ssa-tail-merge.c (alloc_cluster_vectors): Likewise. (init_worklist): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * var-tracking.c (variable_tracking_main_1): Likewise. (vt_find_locations): Likewise. (vt_stack_adjustments): Likewise. * config/s390/s390.c (s390_optimize_nonescaping_tx): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. From-SVN: r204995
2013-11-19 02:13:23 +01:00
gcc_assert (i == n_basic_blocks_for_fn (cfun));
Eliminate last_basic_block macro. * basic-block.h (last_basic_block): Eliminate macro. * asan.c (transform_statements): Eliminate use of last_basic_block in favor of last_basic_block_for_fn, in order to make use of cfun explicit. * bb-reorder.c (copy_bb, reorder_basic_blocks): Likewise. * bt-load.c (compute_defs_uses_and_gen, compute_kill, compute_out, link_btr_uses, build_btr_def_use_webs, migrate_btr_defs): Likewise. * cfg.c (compact_blocks): Likewise. * cfganal.c (mark_dfs_back_edges, control_dependences::control_dependences, post_order_compute, pre_and_rev_post_order_compute_fn, dfs_enumerate_from, compute_idf, single_pred_before_succ_order): Likewise. * cfgbuild.c (make_edges): Likewise. * cfgexpand.c (add_scope_conflicts, gimple_expand_cfg): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloop.c (verify_loop_structure): Likewise. * cfgloopanal.c (just_once_each_iteration_p, mark_irreducible_loops): Likewise. * cfgloopmanip.c (fix_bb_placements, remove_path, update_dominators_in_loop): Likewise. * cfgrtl.c (create_basic_block_structure, rtl_create_basic_block, break_superblocks, rtl_flow_call_edges_add): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/mips/mips.c (r10k_insert_cache_barriers): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * cprop.c (compute_local_properties, find_implicit_sets, bypass_conditional_jumps, one_cprop_pass): Likewise. * cse.c (cse_main): Likewise. * df-core.c (rest_of_handle_df_initialize, df_worklist_dataflow, df_analyze, df_grow_bb_info, df_compact_blocks): Likewise. * df-problems.c (df_lr_verify_solution_start, df_live_verify_solution_start, df_md_local_compute): Likewise. * dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree, calc_idoms): Likewise. * domwalk.c (dom_walker::walk): Likewise. * dse.c (dse_step0, dse_step3): Likewise. * function.c (epilogue_done): Likewise. * gcse.c (alloc_gcse_mem, compute_local_properties, prune_insertions_deletions, compute_pre_data, pre_expr_reaches_here_p, one_pre_gcse_pass, compute_code_hoist_vbeinout, should_hoist_expr_to_dom, hoist_code, one_code_hoisting_pass): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * graphite-sese-to-poly.c (build_scop_bbs): Likewise. * haifa-sched.c (unlink_bb_notes): Likewise. * ipa-split.c (execute_split_functions): Likewise. * ira-build.c (create_loop_tree_nodes, remove_unnecessary_regions): Likewise. * ira-emit.c (ira_emit): Likewise. * ira.c (find_moveable_pseudos, ira): 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): Likewise. * loop-unroll.c (opt_info_start_duplication, apply_opt_in_copies): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * lra.c (lra): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * regrename.c (regrename_analyze): Likewise. * reload1.c (reload): Likewise. * resource.c (init_resource_info): Likewise. * sched-rgn.c (haifa_find_rgns, extend_rgns, compute_trg_info, realloc_bb_state_array, schedule_region, extend_regions): Likewise. * sel-sched-ir.c (sel_extend_global_bb_info, extend_region_bb_info, recompute_rev_top_order, sel_init_pipelining, make_regions_from_the_rest): Likewise. * store-motion.c (remove_reachable_equiv_notes,build_store_vectors) Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (tm_region_init, get_bb_regions_instrumented): Likewise. * tree-cfg.c (create_bb, cleanup_dead_labels, gimple_dump_cfg, gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (split_bbs_on_noreturn_calls, cleanup_tree_cfg_1): Likewise. * tree-complex.c (tree_lower_complex): Likewise. * tree-inline.c (copy_cfg_body): Likewise. * tree-into-ssa.c (mark_phi_for_rewrite, rewrite_into_ssa, prepare_def_site_for, update_ssa): Likewise. * tree-ssa-dce.c (tree_dce_init, perform_tree_ssa_dce): Likewise. * tree-ssa-dom.c (record_edge_info): Likewise. * tree-ssa-live.c (new_tree_live_info, live_worklist): Likewise. * tree-ssa-loop-im.c (fill_always_executed_in_1): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args gimple_duplicate_loop_to_header_edge): Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. * tree-ssa-reassoc.c (init_reassoc): Likewise. * tree-ssa-sccvn.c (init_scc_vn): Likewise. * tree-ssa-tail-merge.c (init_worklist): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-vrp.c (find_assert_locations): Likewise. * var-tracking.c (vt_find_locations): Likewise. From-SVN: r205826
2013-12-09 21:44:49 +01:00
for (; i < last_basic_block_for_fn (cfun); i++)
SET_BASIC_BLOCK_FOR_FN (cfun, i, NULL);
}
Eliminate last_basic_block macro. * basic-block.h (last_basic_block): Eliminate macro. * asan.c (transform_statements): Eliminate use of last_basic_block in favor of last_basic_block_for_fn, in order to make use of cfun explicit. * bb-reorder.c (copy_bb, reorder_basic_blocks): Likewise. * bt-load.c (compute_defs_uses_and_gen, compute_kill, compute_out, link_btr_uses, build_btr_def_use_webs, migrate_btr_defs): Likewise. * cfg.c (compact_blocks): Likewise. * cfganal.c (mark_dfs_back_edges, control_dependences::control_dependences, post_order_compute, pre_and_rev_post_order_compute_fn, dfs_enumerate_from, compute_idf, single_pred_before_succ_order): Likewise. * cfgbuild.c (make_edges): Likewise. * cfgexpand.c (add_scope_conflicts, gimple_expand_cfg): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloop.c (verify_loop_structure): Likewise. * cfgloopanal.c (just_once_each_iteration_p, mark_irreducible_loops): Likewise. * cfgloopmanip.c (fix_bb_placements, remove_path, update_dominators_in_loop): Likewise. * cfgrtl.c (create_basic_block_structure, rtl_create_basic_block, break_superblocks, rtl_flow_call_edges_add): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/mips/mips.c (r10k_insert_cache_barriers): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * cprop.c (compute_local_properties, find_implicit_sets, bypass_conditional_jumps, one_cprop_pass): Likewise. * cse.c (cse_main): Likewise. * df-core.c (rest_of_handle_df_initialize, df_worklist_dataflow, df_analyze, df_grow_bb_info, df_compact_blocks): Likewise. * df-problems.c (df_lr_verify_solution_start, df_live_verify_solution_start, df_md_local_compute): Likewise. * dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree, calc_idoms): Likewise. * domwalk.c (dom_walker::walk): Likewise. * dse.c (dse_step0, dse_step3): Likewise. * function.c (epilogue_done): Likewise. * gcse.c (alloc_gcse_mem, compute_local_properties, prune_insertions_deletions, compute_pre_data, pre_expr_reaches_here_p, one_pre_gcse_pass, compute_code_hoist_vbeinout, should_hoist_expr_to_dom, hoist_code, one_code_hoisting_pass): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * graphite-sese-to-poly.c (build_scop_bbs): Likewise. * haifa-sched.c (unlink_bb_notes): Likewise. * ipa-split.c (execute_split_functions): Likewise. * ira-build.c (create_loop_tree_nodes, remove_unnecessary_regions): Likewise. * ira-emit.c (ira_emit): Likewise. * ira.c (find_moveable_pseudos, ira): 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): Likewise. * loop-unroll.c (opt_info_start_duplication, apply_opt_in_copies): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * lra.c (lra): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * regrename.c (regrename_analyze): Likewise. * reload1.c (reload): Likewise. * resource.c (init_resource_info): Likewise. * sched-rgn.c (haifa_find_rgns, extend_rgns, compute_trg_info, realloc_bb_state_array, schedule_region, extend_regions): Likewise. * sel-sched-ir.c (sel_extend_global_bb_info, extend_region_bb_info, recompute_rev_top_order, sel_init_pipelining, make_regions_from_the_rest): Likewise. * store-motion.c (remove_reachable_equiv_notes,build_store_vectors) Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (tm_region_init, get_bb_regions_instrumented): Likewise. * tree-cfg.c (create_bb, cleanup_dead_labels, gimple_dump_cfg, gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (split_bbs_on_noreturn_calls, cleanup_tree_cfg_1): Likewise. * tree-complex.c (tree_lower_complex): Likewise. * tree-inline.c (copy_cfg_body): Likewise. * tree-into-ssa.c (mark_phi_for_rewrite, rewrite_into_ssa, prepare_def_site_for, update_ssa): Likewise. * tree-ssa-dce.c (tree_dce_init, perform_tree_ssa_dce): Likewise. * tree-ssa-dom.c (record_edge_info): Likewise. * tree-ssa-live.c (new_tree_live_info, live_worklist): Likewise. * tree-ssa-loop-im.c (fill_always_executed_in_1): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args gimple_duplicate_loop_to_header_edge): Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. * tree-ssa-reassoc.c (init_reassoc): Likewise. * tree-ssa-sccvn.c (init_scc_vn): Likewise. * tree-ssa-tail-merge.c (init_worklist): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-vrp.c (find_assert_locations): Likewise. * var-tracking.c (vt_find_locations): Likewise. From-SVN: r205826
2013-12-09 21:44:49 +01:00
last_basic_block_for_fn (cfun) = n_basic_blocks_for_fn (cfun);
}
/* Remove block B from the basic block array. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
expunge_block (basic_block b)
{
unlink_block (b);
SET_BASIC_BLOCK_FOR_FN (cfun, b->index, NULL);
Eliminate n_basic_blocks macro gcc/ * basic-block.h (n_basic_blocks_for_function): Rename macro to... (n_basic_blocks_for_fn): ...this. (n_basic_blocks): Eliminate macro as work towards making uses of cfun be explicit. * cfgloop.c (init_loops_structure): Update for renaming of "n_basic_blocks_for_function" to "n_basic_blocks_for_fn". * graph.c (draw_cfg_nodes_no_loops): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. * lto-streamer-in.c (make_new_block): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. (dump_function_to_file): Likewise. * alias.c (init_alias_analysis): Replace usage of "n_basic_blocks" macro with "n_basic_blocks_for_fn (cfun)". * bb-reorder.c (partition_hot_cold_basic_blocks): Likewise. (duplicate_computed_gotos): Likewise. (reorder_basic_blocks): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (expunge_block): Likewise. (compact_blocks): Likewise. * cfganal.c (single_pred_before_succ_order): Likewise. (compute_idf): Likewise. (flow_dfs_compute_reverse_init): Likewise. (pre_and_rev_post_order_compute): Likewise. (pre_and_rev_post_order_compute_fn): Likewise. (inverted_post_order_compute): Likewise. (post_order_compute): Likewise. (print_edge_list): Likewise. (find_unreachable_blocks): Likewise. (mark_dfs_back_edges): Likewise. * cfgcleanup.c (try_optimize_cfg): Likewise. (try_forward_edges): Likewise. * cfghooks.c (dump_flow_info): Likewise. * cfgloop.c (verify_loop_structure): Likewise. (get_loop_body): Likewise. (flow_loops_find): Likewise. * cfgloopmanip.c (add_loop): Likewise. (remove_path): Likewise. (find_path): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. (rtl_verify_bb_layout): Likewise. (entry_of_function): Likewise. (rtl_create_basic_block): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (one_cprop_pass): Likewise. (is_too_expensive): Likewise. * df-core.c (df_compute_cfg_image): Likewise. (df_compact_blocks): Likewise. (df_worklist_dataflow_doublequeue): Likewise. * dominance.c (calculate_dominance_info): Likewise. (calc_dfs_tree): Likewise. (calc_dfs_tree_nonrec): Likewise. (init_dom_info): Likewise. * domwalk.c (cmp_bb_postorder): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. (generate_setjmp_warnings): Likewise. * fwprop.c (build_single_def_use_links): Likewise. * gcse.c (is_too_expensive): Likewise. (one_code_hoisting_pass): Likewise. (one_pre_gcse_pass): Likewise. * graphite.c (graphite_initialize): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * ipa-inline-analysis.c (estimate_function_body_sizes): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Likewise. * ira-build.c (ira_build): Likewise. * lcm.c (compute_nearerout): Likewise. (compute_available): Likewise. (compute_laterin): Likewise. (compute_antinout_edge): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * lra.c (has_nonexceptional_receiver): Likewise. * mcf.c (create_fixup_graph): Likewise. * profile.c (branch_prob): Likewise. * reg-stack.c (convert_regs_2): Likewise. * regrename.c (regrename_analyze): Likewise. * reload1.c (has_nonexceptional_receiver): Likewise. * reorg.c (dbr_schedule): Likewise. * sched-deps.c (sched_deps_init): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (extend_regions): Likewise. (schedule_insns): Likewise. (sched_rgn_init): Likewise. (extend_rgns): Likewise. (haifa_find_rgns): Likewise. * sel-sched-ir.c (recompute_rev_top_order): Likewise. (sel_recompute_toporder): Likewise. * sel-sched.c (run_selective_scheduling): Likewise. * store-motion.c (one_store_motion_pass): Likewise. (remove_reachable_equiv_notes): Likewise. * tracer.c (tracer): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (gimple_flow_call_edges_add): Likewise. (dump_cfg_stats): Likewise. (gimple_dump_cfg): Likewise. (create_bb): Likewise. (build_gimple_cfg): Likewise. * tree-cfgcleanup.c (merge_phi_nodes): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. (fold_marked_statements): Likewise. * tree-ssa-ifcombine.c (tree_ssa_ifcombine): Likewise. * tree-ssa-loop-ch.c (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (analyze_memory_references): Likewise. * tree-ssa-loop-manip.c (compute_live_loop_exits): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-pre.c (do_pre): Likewise. (init_pre): Likewise. (compute_avail): Likewise. * tree-ssa-reassoc.c (init_reassoc): Likewise. * tree-ssa-sccvn.c (init_scc_vn): Likewise. * tree-ssa-tail-merge.c (alloc_cluster_vectors): Likewise. (init_worklist): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * var-tracking.c (variable_tracking_main_1): Likewise. (vt_find_locations): Likewise. (vt_stack_adjustments): Likewise. * config/s390/s390.c (s390_optimize_nonescaping_tx): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. From-SVN: r204995
2013-11-19 02:13:23 +01:00
n_basic_blocks_for_fn (cfun)--;
/* We should be able to ggc_free here, but we are not.
The dead SSA_NAMES are left pointing to dead statements that are pointing
to dead basic blocks making garbage collector to die.
We should be able to release all dead SSA_NAMES and at the same time we should
clear out BB pointer of dead statements consistently. */
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Connect E to E->src. */
static inline void
connect_src (edge e)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_push (e->src->succs, e);
df_mark_solutions_dirty ();
}
/* Connect E to E->dest. */
static inline void
connect_dest (edge e)
{
basic_block dest = e->dest;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_push (dest->preds, e);
e->dest_idx = EDGE_COUNT (dest->preds) - 1;
df_mark_solutions_dirty ();
}
/* Disconnect edge E from E->src. */
static inline void
disconnect_src (edge e)
{
basic_block src = e->src;
edge_iterator ei;
edge tmp;
for (ei = ei_start (src->succs); (tmp = ei_safe_edge (ei)); )
{
if (tmp == e)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
src->succs->unordered_remove (ei.index);
df_mark_solutions_dirty ();
return;
}
else
ei_next (&ei);
}
gcc_unreachable ();
}
/* Disconnect edge E from E->dest. */
static inline void
disconnect_dest (edge e)
{
basic_block dest = e->dest;
unsigned int dest_idx = e->dest_idx;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dest->preds->unordered_remove (dest_idx);
/* If we removed an edge in the middle of the edge vector, we need
to update dest_idx of the edge that moved into the "hole". */
if (dest_idx < EDGE_COUNT (dest->preds))
EDGE_PRED (dest, dest_idx)->dest_idx = dest_idx;
df_mark_solutions_dirty ();
}
/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly
created edge. Use this only if you are sure that this edge can't
possibly already exist. */
edge
unchecked_make_edge (basic_block src, basic_block dst, int flags)
{
edge e;
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
e = ggc_cleared_alloc<edge_def> ();
n_edges_for_fn (cfun)++;
e->src = src;
e->dest = dst;
e->flags = flags;
connect_src (e);
connect_dest (e);
execute_on_growing_pred (e);
return e;
}
/* Create an edge connecting SRC and DST with FLAGS optionally using
edge cache CACHE. Return the new edge, NULL if already exist. */
basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. * basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. (EDGE_CRITICAL_P): New predicate. * cfg.c (force_nonfallthru_and_redirect, split_edge): Kill EDGE_CRITICAL handling. (insert_insn_on_edge): Use EDGE_CRITICAL_P. (dump_edge_info): Remove "crit". * cfganal.c (mark_critical_edges): Kill. * cfgbuild.c (find_basic_blocks): Remove mark_critical_edges call. * cfgcleanup.c (cleanup_cfg): Likewise. * profile.c (instrument_edges): Use EDGE_CRITICAL_P. (find_spanning_tree): Likewise. * reg-stack.c (convert_regs_1): Likewise. * ssa.c (mark_regs_equivalent_over_bad_edges): Likewise. * basic-block.h (create_basic_block_structure): New. (create_basic_block): Update prototype. (force_nonfallthru): New. * bb-reorder.c (fixup_reorder_chain): Fixup use force_nonfallthru. * cfg.c (create_basic_block_structure): Rename from create_basic_block; handle updating of block_for_insn, creating of empty BBs and BBs at the end of INSN chain. (create_basic_block): New function. (split_block): Use create_basic_block. (force_nonfallthru_and_redirect): Break out from ...; cleanup (redirect_edge_and_branch_force): ... here. (force_nonfallthru): New. (split_edge): Rewrite to use force_nonfallthru and create_block. * cfgbuild.c (find_basic_blocks_1): Use create_basic_block_structure. (find_basic_blocks): Free basic_block_for_insn. * cfgcleanup.c (merge_blocks): Use force_nonfallthru. * cfg.c: Fix formating. * cfgcleanup.c: Fix formating. (merge_blocks, tail_recursion_label_p): Return bool. (merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Return void. From-SVN: r45549
2001-09-11 18:58:57 +02:00
edge
cached_make_edge (sbitmap edge_cache, basic_block src, basic_block dst, int flags)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
if (edge_cache == NULL
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
|| src == ENTRY_BLOCK_PTR_FOR_FN (cfun)
|| dst == EXIT_BLOCK_PTR_FOR_FN (cfun))
return make_edge (src, dst, flags);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Does the requested edge already exist? */
This patch normalizes more bitmap function names. sbitmap.h TEST_BIT -> bitmap_bit_p SET_BIT -> bitmap_set_bit SET_BIT_WITH_POPCOUNT -> bitmap_set_bit_with_popcount RESET_BIT -> bitmap_clear_bit RESET_BIT_WITH_POPCOUNT -> bitmap_clear_bit_with_popcount basic-block.h sbitmap_intersection_of_succs -> bitmap_intersection_of_succs sbitmap_intersection_of_preds -> bitmap_intersection_of_preds sbitmap_union_of_succs -> bitmap_union_of_succs sbitmap_union_of_preds -> bitmap_union_of_preds The sbitmap.h functions also needed their numeric paramter changed from unsigned int to int to match the bitmap functions. Callers updated to match. Tested on x86-64, config-list.mk testing. Index: gcc/ChangeLog 2012-11-01 Lawrence Crowl <crowl@google.com> * sbitmap.h (TEST_BIT): Rename bitmap_bit_p, normalizing parameter type. Update callers to match. (SET_BIT): Rename bitmap_set_bit, normalizing parameter type. Update callers to match. (SET_BIT_WITH_POPCOUNT): Rename bitmap_set_bit_with_popcount, normalizing parameter type. Update callers to match. (RESET_BIT): Rename bitmap_clear_bit, normalizing parameter type. Update callers to match. (RESET_BIT_WITH_POPCOUNT): Rename bitmap_clear_bit_with_popcount, normalizing parameter type. Update callers to match. * basic-block.h (sbitmap_intersection_of_succs): Rename bitmap_intersection_of_succs. Update callers to match. * basic-block.h (sbitmap_intersection_of_preds): Rename bitmap_intersection_of_preds. Update callers to match. * basic-block.h (sbitmap_union_of_succs): Rename bitmap_union_of_succs. Update callers to match. * basic-block.h (sbitmap_union_of_preds): Rename bitmap_union_of_preds. Update callers to match. From-SVN: r193066
2012-11-01 20:23:35 +01:00
if (! bitmap_bit_p (edge_cache, dst->index))
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
/* The edge does not exist. Create one and update the
cache. */
This patch normalizes more bitmap function names. sbitmap.h TEST_BIT -> bitmap_bit_p SET_BIT -> bitmap_set_bit SET_BIT_WITH_POPCOUNT -> bitmap_set_bit_with_popcount RESET_BIT -> bitmap_clear_bit RESET_BIT_WITH_POPCOUNT -> bitmap_clear_bit_with_popcount basic-block.h sbitmap_intersection_of_succs -> bitmap_intersection_of_succs sbitmap_intersection_of_preds -> bitmap_intersection_of_preds sbitmap_union_of_succs -> bitmap_union_of_succs sbitmap_union_of_preds -> bitmap_union_of_preds The sbitmap.h functions also needed their numeric paramter changed from unsigned int to int to match the bitmap functions. Callers updated to match. Tested on x86-64, config-list.mk testing. Index: gcc/ChangeLog 2012-11-01 Lawrence Crowl <crowl@google.com> * sbitmap.h (TEST_BIT): Rename bitmap_bit_p, normalizing parameter type. Update callers to match. (SET_BIT): Rename bitmap_set_bit, normalizing parameter type. Update callers to match. (SET_BIT_WITH_POPCOUNT): Rename bitmap_set_bit_with_popcount, normalizing parameter type. Update callers to match. (RESET_BIT): Rename bitmap_clear_bit, normalizing parameter type. Update callers to match. (RESET_BIT_WITH_POPCOUNT): Rename bitmap_clear_bit_with_popcount, normalizing parameter type. Update callers to match. * basic-block.h (sbitmap_intersection_of_succs): Rename bitmap_intersection_of_succs. Update callers to match. * basic-block.h (sbitmap_intersection_of_preds): Rename bitmap_intersection_of_preds. Update callers to match. * basic-block.h (sbitmap_union_of_succs): Rename bitmap_union_of_succs. Update callers to match. * basic-block.h (sbitmap_union_of_preds): Rename bitmap_union_of_preds. Update callers to match. From-SVN: r193066
2012-11-01 20:23:35 +01:00
bitmap_set_bit (edge_cache, dst->index);
return unchecked_make_edge (src, dst, flags);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* At this point, we know that the requested edge exists. Adjust
flags if necessary. */
if (flags)
{
edge e = find_edge (src, dst);
e->flags |= flags;
}
return NULL;
}
/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly
created edge or NULL if already exist. */
edge
make_edge (basic_block src, basic_block dest, int flags)
{
edge e = find_edge (src, dest);
/* Make sure we don't add duplicate edges. */
if (e)
{
e->flags |= flags;
return NULL;
}
return unchecked_make_edge (src, dest, flags);
}
/* Create an edge connecting SRC to DEST and set probability by knowing
that it is the single edge leaving SRC. */
edge
make_single_succ_edge (basic_block src, basic_block dest, int flags)
{
edge e = make_edge (src, dest, flags);
e->probability = REG_BR_PROB_BASE;
e->count = src->count;
return e;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* This function will remove an edge from the flow graph. */
void
remove_edge_raw (edge e)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
remove_predictions_associated_with_edge (e);
execute_on_shrinking_pred (e);
disconnect_src (e);
disconnect_dest (e);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
cfg.c (free_edge): Add function argument and use it instead of cfun. 2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
2015-10-27 09:56:03 +01:00
free_edge (cfun, e);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* Redirect an edge's successor from one block to another. */
void
redirect_edge_succ (edge e, basic_block new_succ)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
execute_on_shrinking_pred (e);
disconnect_dest (e);
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
e->dest = new_succ;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Reconnect the edge to the new successor block. */
connect_dest (e);
execute_on_growing_pred (e);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
/* Redirect an edge's predecessor from one block to another. */
void
redirect_edge_pred (edge e, basic_block new_pred)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
disconnect_src (e);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
e->src = new_pred;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Reconnect the edge to the new predecessor block. */
connect_src (e);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
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
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
/* Clear all basic block flags that do not have to be preserved. */
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
void
clear_bb_flags (void)
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-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_ALL_BB_FN (bb, cfun)
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
bb->flags &= BB_FLAGS_TO_PRESERVE;
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
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Check the consistency of profile information. We can't do that
in verify_flow_info, as the counts may get invalid for incompletely
solved graphs, later eliminating of conditionals or roundoff errors.
It is still practical to have them reported for debugging of simple
testcases. */
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
static void
check_bb_profile (basic_block bb, FILE * file, int indent, int flags)
{
edge e;
int sum = 0;
gcov_type lsum;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
predict.c (maybe_hot_frequency_p): New parameter fun. 2012-08-24 Martin Jambor <mjambor@suse.cz> * predict.c (maybe_hot_frequency_p): New parameter fun. Use its decl instead of current_function_decl, use profile_status_for_function and ENTRY_BLOCK_PTR_FOR_FUNCTION with fun instead of their cfun variants. (maybe_hot_count_p): New parameter fun, use profile_status_for_function instead of its cfun_variant. (maybe_hot_bb_p): New parameter fun, checking-assert it, pass it to all callees. (maybe_hot_edge_p): Pass cfun to maybe_hot_count_p and maybe_hot_frequency_p. (probably_never_executed_bb_p): New parameter fun, use its decl instead of current_function_decl. (optimize_bb_for_size_p): Pass cfun to maybe_hot_bb_p. (rtl_profile_for_bb): Likewise. (compute_function_frequency): Pass cfun to maybe_hot_bb_p and probably_never_executed_bb_p. * tree-ssa-operands.c (ssa_operands_active): New operator fun. Use it instead of cfun. (update_stmt_operands): Pass cfun as an argument of ssa_operands_active. (swap_tree_operands): Likewise. * gimple-iterator.c (update_modified_stmt): Likewise. (update_modified_stmts): Likewise. * tree-flow-inline.h (delink_stmt_imm_use): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. * bb-reorder.c (bb_to_key): Pass cfun to probably_never_executed_bb_p. (push_to_next_round_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges ): Likewise. * cfg.c: Inlude tree.h. (check_bb_profile): Use profile_status_for_function, EXIT_BLOCK_PTR_FOR_FUNCTION and ENTRY_BLOCK_PTR_FOR_FUNCTION with DECL_STRUCT_FUNCTION (current_function_decl) instead of their cfun variants. (dump_bb_info): Pass DECL_STRUCT_FUNCTION (current_function_decl) to maybe_hot_bb_p and probably_never_executed_bb_p. * gimple-pretty-print.c (gimple_dump_bb_buff): Checking-assert that DECL_STRUCT_FUNCTION (current_function_decl) is not NULL. Pass it to dump_histograms_for_stmt. (dump_gimple_mem_ops): Pass DECL_STRUCT_FUNCTION (current_function_decl) as an argument to dump_gimple_mem_ops. * tree-cfg.c (dump_function_to_file): Rename parameter fn to fndecl. Do not change cfun. Change and restore current_function_decl. * Makefile.in (cfg.o): Include TREE_H in dependencies. From-SVN: r190645
2012-08-24 14:57:24 +02:00
struct function *fun = DECL_STRUCT_FUNCTION (current_function_decl);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
char *s_indent = (char *) alloca ((size_t) indent + 1);
memset ((void *) s_indent, ' ', (size_t) indent);
s_indent[indent] = '\0';
if (profile_status_for_fn (fun) == PROFILE_ABSENT)
return;
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
if (bb != EXIT_BLOCK_PTR_FOR_FN (fun))
{
bool found = false;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, bb->succs)
{
if (!(e->flags & EDGE_EH))
found = true;
sum += e->probability;
}
/* Only report mismatches for non-EH control flow. If there are only EH
edges it means that the BB ends by noreturn call. Here the control
flow may just terminate. */
if (found)
{
if (EDGE_COUNT (bb->succs) && abs (sum - REG_BR_PROB_BASE) > 100)
fprintf (file, "%s%sInvalid sum of outgoing probabilities %.1f%%\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent,
sum * 100.0 / REG_BR_PROB_BASE);
lsum = 0;
FOR_EACH_EDGE (e, ei, bb->succs)
lsum += e->count;
if (EDGE_COUNT (bb->succs)
&& (lsum - bb->count > 100 || lsum - bb->count < -100))
fprintf (file, "%s%sInvalid sum of outgoing counts %i, should be %i\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent,
(int) lsum, (int) bb->count);
}
}
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
if (bb != ENTRY_BLOCK_PTR_FOR_FN (fun))
{
sum = 0;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, bb->preds)
sum += EDGE_FREQUENCY (e);
if (abs (sum - bb->frequency) > 100)
fprintf (file,
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
"%s%sInvalid sum of incoming frequencies %i, should be %i\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent,
sum, bb->frequency);
lsum = 0;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, bb->preds)
lsum += e->count;
if (lsum - bb->count > 100 || lsum - bb->count < -100)
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
fprintf (file, "%s%sInvalid sum of incoming counts %i, should be %i\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent,
(int) lsum, (int) bb->count);
}
2013-08-31 03:43:33 +02:00
if (BB_PARTITION (bb) == BB_COLD_PARTITION)
{
/* Warn about inconsistencies in the partitioning that are
currently caused by profile insanities created via optimization. */
if (!probably_never_executed_bb_p (fun, bb))
fprintf (file, "%s%sBlock in cold partition with hot count\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent);
FOR_EACH_EDGE (e, ei, bb->preds)
{
if (!probably_never_executed_edge_p (fun, e))
fprintf (file,
"%s%sBlock in cold partition with incoming hot edge\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent);
}
}
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
dump_edge_info (FILE *file, edge e, int flags, int do_succ)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
basic_block side = (do_succ ? e->dest : e->src);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
bool do_details = false;
if ((flags & TDF_DETAILS) != 0
&& (flags & TDF_SLIM) == 0)
do_details = true;
basic-block.h: Re-group most prototypes per file. gcc/ * basic-block.h: Re-group most prototypes per file. (struct edge_list): Remove num_blocks field. (dump_bb_info): Adjust prototypes. (dump_reg_info): Move prototype to regs.h. * function.h: Do not include tree.h. Include vec.h, vecir.h, input.h and machmode.h to compensate. (function_name): New prototype. * gimple.h: Include tree.h to compensate for basic-block.h change. * langhooks.h: Note that tree.h is only necessary for enum tree_code. * regs.h (dump_reg_info): Prototype here. * regset.h: Adjust file reference in comment. (debug_regset): Remove prototype. * rtl.h: Include flags.h for flag_var_tracking_assignments. (MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS. (dump_reg_info, dump_flow_info): Remove prototypes. * bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c to here, the only user. Make static. (reorder_basic_blocks): Call dump_reg_info before dump_flow_info. * cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h, flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h, tree-pass.h, cfgloop.h, and tree-flow.h. Include basic-block.h, the first header I'd expect to be included. (reg_obstack): Move to df-core.c. (free_edge): Remove bogus ATTRIBUTE_UNUSED. (remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Move to cfghooks.c. (dump_regset, debug_regset): Move to df-core.c. (dump_bb_info): Move to cfgrtl.c. (dump_reg_info): Move to regstat.c. (dump_flow_info): Move to cfgrtl.c. (debug_flow_info): Likewise. (dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense. * cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h, insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Move to cfgrtl.c. (set_edge_can_fallthru_flag): Moved to bb-reorder.c. (create_edge_list): Do not set edge_list's removed num_blocks. (print_edge_list): Look at n_basic_blocks instead of num_blocks. (flow_nodes_print): Remove. (flow_edge_list_print): Remove. (inverted_post_order_compute): Use FOR_ALL_BB. *cfgrtl.c (dump_flow_info): Moved from cfg.c. Do not call dump_reg_info. (debug_flow_info): Moved from cfg.c (dump_bb_info): Moved from cfg.c. Take 'verbose' argument to avoid looking at TDF_* flags from tree-pass.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Moved from cfganal.c. (print_rtl_with_bb): Adjust dump_bb_info calls. * cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c. (remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE. (cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS. * cselib.c: Include tree.h with a FIXME. * df-core.c (reg_obstack): Moved from cfg.c. (dump_regset): Likewise. (debug_regset): Likewise. Make a DEBUG_FUNCTION. * final.c (compute_alignments): Call dump_reg_info before dump_flow_info. * function.c (function_name): New function. (current_function_name): Use it. * ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before dump_flow_info. * ira-conflicts.c: Include tree.h with a note. * regstat.c (dump_reg_info): Moved here from cfg.c. * loop-init.c: Include regs.h instead of hard-reg-set.h. (rtl_loop_init): Call dump_reg_info before dump_flow_info. (rtl_loop_done): Likewise. * mcf.c: Include tree.h before langhooks.h. * predict.c (maybe_hot_count_p): Assert we have cfun. (probably_never_executed_bb_p): Likewise. * profile.c (compute_branch_probabilities): Use gimple_dump_cfg instead of dump_flow_info. * sched-deps.c: Include tree.h with a FIXME. (call_may_noreturn_p): Add FIXME note why this function has to look at function decls instead of function decl flags. * sched-vis.c: Include tree.h with a FIXME. (print_rtl_slim): Adjust dump_bb_info uses. * statistics.c (statistics_fini_pass_2): Use current_function_name to avoid including tree.h. (statistics_counter_event): Use function_name for the same reason. (statistics_histogram_event): Likewise. * tracer.c (tracer): Remove bogus gcc_assert. Use brief_dump_cfg instead of dump_flow_info. * var-tracking.c (variable_tracking_main_1): Call dump_reg_info before dump_flow_info. * doc/cfg.texi: Update CFG documentation. * Makefile.in (RTL_H): Depend on FLAGS_H. (GIMPLE_H): Depend on TREE_H. (FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H, but no longer on TREE_H. (C_COMMON_H): Depend on TREE_H. (cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o, sched-deps.o, sched-vis.o): Fixup dependencies. c-family/ * c-common.h: Include tree.h. cp/ * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site. From-SVN: r189359
2012-07-08 12:06:14 +02:00
if (side->index == ENTRY_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
fputs (" ENTRY", file);
basic-block.h: Re-group most prototypes per file. gcc/ * basic-block.h: Re-group most prototypes per file. (struct edge_list): Remove num_blocks field. (dump_bb_info): Adjust prototypes. (dump_reg_info): Move prototype to regs.h. * function.h: Do not include tree.h. Include vec.h, vecir.h, input.h and machmode.h to compensate. (function_name): New prototype. * gimple.h: Include tree.h to compensate for basic-block.h change. * langhooks.h: Note that tree.h is only necessary for enum tree_code. * regs.h (dump_reg_info): Prototype here. * regset.h: Adjust file reference in comment. (debug_regset): Remove prototype. * rtl.h: Include flags.h for flag_var_tracking_assignments. (MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS. (dump_reg_info, dump_flow_info): Remove prototypes. * bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c to here, the only user. Make static. (reorder_basic_blocks): Call dump_reg_info before dump_flow_info. * cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h, flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h, tree-pass.h, cfgloop.h, and tree-flow.h. Include basic-block.h, the first header I'd expect to be included. (reg_obstack): Move to df-core.c. (free_edge): Remove bogus ATTRIBUTE_UNUSED. (remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Move to cfghooks.c. (dump_regset, debug_regset): Move to df-core.c. (dump_bb_info): Move to cfgrtl.c. (dump_reg_info): Move to regstat.c. (dump_flow_info): Move to cfgrtl.c. (debug_flow_info): Likewise. (dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense. * cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h, insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Move to cfgrtl.c. (set_edge_can_fallthru_flag): Moved to bb-reorder.c. (create_edge_list): Do not set edge_list's removed num_blocks. (print_edge_list): Look at n_basic_blocks instead of num_blocks. (flow_nodes_print): Remove. (flow_edge_list_print): Remove. (inverted_post_order_compute): Use FOR_ALL_BB. *cfgrtl.c (dump_flow_info): Moved from cfg.c. Do not call dump_reg_info. (debug_flow_info): Moved from cfg.c (dump_bb_info): Moved from cfg.c. Take 'verbose' argument to avoid looking at TDF_* flags from tree-pass.h. (flow_active_insn_p, forwarder_block_p, can_fallthru, could_fall_through): Moved from cfganal.c. (print_rtl_with_bb): Adjust dump_bb_info calls. * cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c. (remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE. (cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS. * cselib.c: Include tree.h with a FIXME. * df-core.c (reg_obstack): Moved from cfg.c. (dump_regset): Likewise. (debug_regset): Likewise. Make a DEBUG_FUNCTION. * final.c (compute_alignments): Call dump_reg_info before dump_flow_info. * function.c (function_name): New function. (current_function_name): Use it. * ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before dump_flow_info. * ira-conflicts.c: Include tree.h with a note. * regstat.c (dump_reg_info): Moved here from cfg.c. * loop-init.c: Include regs.h instead of hard-reg-set.h. (rtl_loop_init): Call dump_reg_info before dump_flow_info. (rtl_loop_done): Likewise. * mcf.c: Include tree.h before langhooks.h. * predict.c (maybe_hot_count_p): Assert we have cfun. (probably_never_executed_bb_p): Likewise. * profile.c (compute_branch_probabilities): Use gimple_dump_cfg instead of dump_flow_info. * sched-deps.c: Include tree.h with a FIXME. (call_may_noreturn_p): Add FIXME note why this function has to look at function decls instead of function decl flags. * sched-vis.c: Include tree.h with a FIXME. (print_rtl_slim): Adjust dump_bb_info uses. * statistics.c (statistics_fini_pass_2): Use current_function_name to avoid including tree.h. (statistics_counter_event): Use function_name for the same reason. (statistics_histogram_event): Likewise. * tracer.c (tracer): Remove bogus gcc_assert. Use brief_dump_cfg instead of dump_flow_info. * var-tracking.c (variable_tracking_main_1): Call dump_reg_info before dump_flow_info. * doc/cfg.texi: Update CFG documentation. * Makefile.in (RTL_H): Depend on FLAGS_H. (GIMPLE_H): Depend on TREE_H. (FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H, but no longer on TREE_H. (C_COMMON_H): Depend on TREE_H. (cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o, sched-deps.o, sched-vis.o): Fixup dependencies. c-family/ * c-common.h: Include tree.h. cp/ * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site. From-SVN: r189359
2012-07-08 12:06:14 +02:00
else if (side->index == EXIT_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
fputs (" EXIT", file);
else
fprintf (file, " %d", side->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
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
if (e->probability && do_details)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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 (file, " [%.1f%%] ", e->probability * 100.0 / REG_BR_PROB_BASE);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
if (e->count && do_details)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
fputs (" count:", file);
fprintf (file, "%" PRId64, e->count);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
if (e->flags && do_details)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
static const char * const bitnames[] =
{
#define DEF_EDGE_FLAG(NAME,IDX) #NAME ,
#include "cfg-flags.def"
NULL
#undef DEF_EDGE_FLAG
};
bool comma = 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
int i, flags = e->flags;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
gcc_assert (e->flags <= EDGE_ALL_FLAGS);
fputs (" (", file);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
for (i = 0; flags; i++)
if (flags & (1 << i))
{
flags &= ~(1 << i);
if (comma)
fputc (',', file);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
fputs (bitnames[i], file);
comma = true;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
fputc (')', file);
}
}
Add uniform debug dump function names. Add some overloaded functions that provide uniform debug dump function names. These names are: debug: the general debug dumper debug_verbose: for more details debug_raw: for the gory details debug_head: for the heads of declarations, e.g. function heads debug_body: for the bodies of declarations, e.g. function bodies Not all types have the last four versions. The debug functions come in two flavors, those that take pointers to the type, and those that take references to the type. The first handles printing of '<nil>' for null pointers. The second assumes a valid reference, and prints the content. Example uses are as follows: cp_token t, *p; debug (t); debug (p); From the debugger, use call debug (t) The functions sets implemented are: debug (only) basic_block_def, const bitmap_head_def, cp_binding_level, cp_parser, cp_token, data_reference, die_struct, edge_def, gimple_statement_d, ira_allocno, ira_allocno_copy, live_range, lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal, tree_live_info_d, _var_map, vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>, vec<rtx>, vec<tree, va_gc>, debug and debug_raw simple_bitmap_def debug and debug_verbose expr_def, struct loop, vinsn_def debug, debug_raw, debug_verbose, debug_head, debug_body const tree_node This patch is somewhat different from the original plan at gcc.gnu.org/wiki/cxx-conversion/debugging-dumps. The reason is that gdb has an incomplete implementation of C++ call syntax; requiring explicit specification of template arguments and explicit specification of function arguments even when they have default values. So, the original plan would have required typing call dump <cp_token> (t, 0, 0, stderr) which is undesireable. Instead instead of templates, we overload plain functions. This adds a small burden of manually adding the pointer version of dump for each type. Instead of default function arguments, we simply assume the default values. Most of the underlying dump functions did not use the options and indent parameters anyway. Several provide FILE* parameters, but we expect debugging to use stderr anyway. So, the explicit specification of arguments was not as valuable as we thought initially. Finally, a change of name from dump to debug reflect the implicit output to stderr. Index: gcc/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Makefile.in: Add several missing include dependences. (DUMPFILE_H): New. (test-dump.o): New. This object is not added to any executable, but is present for ad-hoc testing. * bitmap.c (debug (const bitmap_head_def &)): New. (debug (const bitmap_head_def *)): New. * bitmap.h (extern debug (const bitmap_head_def &)): New. (extern debug (const bitmap_head_def *)): New. * cfg.c (debug (edge_def &)): New. (debug (edge_def *)): New. * cfghooks.c (debug (basic_block_def &)): New. (debug (basic_block_def *)): New. * dumpfile.h (dump_node (const_tree, int, FILE *)): Correct source file. * dwarf2out.c (debug (die_struct &)): New. (debug (die_struct *)): New. * dwarf2out.h (extern debug (die_struct &)): New. (extern debug (die_struct *)): New. * gimple-pretty-print.c (debug (gimple_statement_d &)): New. (debug (gimple_statement_d *)): New. * gimple-pretty-print.h (extern debug (gimple_statement_d &)): New. (extern debug (gimple_statement_d *)): New. * ira-build.c (debug (ira_allocno_copy &)): New. (debug (ira_allocno_copy *)): New. (debug (ira_allocno &)): New. (debug (ira_allocno *)): New. * ira-int.h (extern debug (ira_allocno_copy &)): New. (extern debug (ira_allocno_copy *)): New. (extern debug (ira_allocno &)): New. (extern debug (ira_allocno *)): New. * ira-lives.c (debug (live_range &)): New. (debug (live_range *)): New. * lra-int.h (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * lra-lives.c (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * omega.c (debug (omega_pb_d &)): New. (debug (omega_pb_d *)): New. * omega.h (extern debug (omega_pb_d &)): New. (extern debug (omega_pb_d *)): New. * print-rtl.c (debug (const rtx_def &)): New. (debug (const rtx_def *)): New. * print-tree.c (debug_tree (tree): Move within file. (debug_raw (const tree_node &)): New. (debug_raw (const tree_node *)): New. (dump_tree_via_hooks (const tree_node *, int)): New. (debug (const tree_node &)): New. (debug (const tree_node *)): New. (debug_verbose (const tree_node &)): New. (debug_verbose (const tree_node *)): New. (debug_head (const tree_node &)): New. (debug_head (const tree_node *)): New. (debug_body (const tree_node &)): New. (debug_body (const tree_node *)): New. (debug_vec_tree (tree): Move and reimplement in terms of dump. (debug (vec<tree, va_gc> &)): New. (debug (vec<tree, va_gc> *)): New. * rtl.h (extern debug (const rtx_def &)): New. (extern debug (const rtx_def *)): New. * sbitmap.c (debug_raw (simple_bitmap_def &)): New. (debug_raw (simple_bitmap_def *)): New. (debug (simple_bitmap_def &)): New. (debug (simple_bitmap_def *)): New. * sbitmap.h (extern debug (simple_bitmap_def &)): New. (extern debug (simple_bitmap_def *)): New. (extern debug_raw (simple_bitmap_def &)): New. (extern debug_raw (simple_bitmap_def *)): New. * sel-sched-dump.c (debug (vinsn_def &)): New. (debug (vinsn_def *)): New. (debug_verbose (vinsn_def &)): New. (debug_verbose (vinsn_def *)): New. (debug (expr_def &)): New. (debug (expr_def *)): New. (debug_verbose (expr_def &)): New. (debug_verbose (expr_def *)): New. (debug (vec<rtx> &)): New. (debug (vec<rtx> *)): New. * sel-sched-dump.h (extern debug (vinsn_def &)): New. (extern debug (vinsn_def *)): New. (extern debug_verbose (vinsn_def &)): New. (extern debug_verbose (vinsn_def *)): New. (extern debug (expr_def &)): New. (extern debug (expr_def *)): New. (extern debug_verbose (expr_def &)): New. (extern debug_verbose (expr_def *)): New. (extern debug (vec<rtx> &)): New. (extern debug (vec<rtx> *)): New. * sel-sched-ir.h (_list_iter_cond_expr): Make inline instead of static. * sreal.c (debug (sreal &)): New. (debug (sreal *)): New. * sreal.h (extern debug (sreal &)): New. (extern debug (sreal *)): New. * tree.h (extern debug_raw (const tree_node &)): New. (extern debug_raw (const tree_node *)): New. (extern debug (const tree_node &)): New. (extern debug (const tree_node *)): New. (extern debug_verbose (const tree_node &)): New. (extern debug_verbose (const tree_node *)): New. (extern debug_head (const tree_node &)): New. (extern debug_head (const tree_node *)): New. (extern debug_body (const tree_node &)): New. (extern debug_body (const tree_node *)): New. (extern debug (vec<tree, va_gc> &)): New. (extern debug (vec<tree, va_gc> *)): New. * tree-cfg.c (debug (struct loop &)): New. (debug (struct loop *)): New. (debug_verbose (struct loop &)): New. (debug_verbose (struct loop *)): New. * tree-dump.c: Add header dependence. * tree-flow.h (extern debug (struct loop &)): New. (extern debug (struct loop *)): New. (extern debug_verbose (struct loop &)): New. (extern debug_verbose (struct loop *)): New. * tree-data-ref.c (debug (data_reference &)): New. (debug (data_reference *)): New. (debug (vec<data_reference_p> &)): New. (debug (vec<data_reference_p> *)): New. (debug (vec<ddr_p> &)): New. (debug (vec<ddr_p> *)): New. * tree-data-ref.h (extern debug (data_reference &)): New. (extern debug (data_reference *)): New. (extern debug (vec<data_reference_p> &)): New. (extern debug (vec<data_reference_p> *)): New. (extern debug (vec<ddr_p> &)): New. (extern debug (vec<ddr_p> *)): New. * tree-ssa-alias.c (debug (pt_solution &)): New. (debug (pt_solution *)): New. * tree-ssa-alias.h (extern debug (pt_solution &)): New. (extern debug (pt_solution *)): New. * tree-ssa-alias.c (debug (_var_map &)): New. (debug (_var_map *)): New. (debug (tree_live_info_d &)): New. (debug (tree_live_info_d *)): New. * tree-ssa-alias.h (extern debug (_var_map &)): New. (extern debug (_var_map *)): New. (extern debug (tree_live_info_d &)): New. (extern debug (tree_live_info_d *)): New. Index: gcc/cp/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Make-lang.in (CXX_PARSER_H): Add header dependence. * cp-tree.h (extern debug (cp_binding_level &)): New. (extern debug (cp_binding_level *)): New. * name-lookup.h (debug (cp_binding_level &)): New. (debug (cp_binding_level *)): New. * parser.c (debug (cp_parser &)): New. (debug (cp_parser *)): New. (debug (cp_token &)): New. (debug (cp_token *)): New. (debug (vec<cp_token, va_gc> &)): New. (debug (vec<cp_token, va_gc> *)): New. * parser.c: Add header dependence. (extern debug (cp_parser &)): New. (extern debug (cp_parser *)): New. (extern debug (cp_token &)): New. (extern debug (cp_token *)): New. (extern debug (vec<cp_token, va_gc> &)): New. (extern debug (vec<cp_token, va_gc> *)): New. From-SVN: r197224
2013-03-29 04:42:21 +01:00
DEBUG_FUNCTION void
debug (edge_def &ref)
{
/* FIXME (crowl): Is this desireable? */
dump_edge_info (stderr, &ref, 0, false);
dump_edge_info (stderr, &ref, 0, true);
}
DEBUG_FUNCTION void
debug (edge_def *ptr)
{
if (ptr)
debug (*ptr);
else
fprintf (stderr, "<nil>\n");
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Simple routines to easily allocate AUX fields of 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
static struct obstack block_aux_obstack;
static void *first_block_aux_obj = 0;
static struct obstack edge_aux_obstack;
static void *first_edge_aux_obj = 0;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Allocate a memory block of SIZE as BB->aux. The obstack must
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
be first initialized by alloc_aux_for_blocks. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
static void
alloc_aux_for_block (basic_block bb, int size)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
/* Verify that aux field is clear. */
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (!bb->aux && first_block_aux_obj);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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 = obstack_alloc (&block_aux_obstack, size);
memset (bb->aux, 0, size);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
/* Initialize the block_aux_obstack and if SIZE is nonzero, call
alloc_aux_for_block for each basic block. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
alloc_aux_for_blocks (int size)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
static int initialized;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
if (!initialized)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
gcc_obstack_init (&block_aux_obstack);
initialized = 1;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
else
/* Check whether AUX data are still allocated. */
gcc_assert (!first_block_aux_obj);
2006-05-19 00:16:23 +02:00
first_block_aux_obj = obstack_alloc (&block_aux_obstack, 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 (size)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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;
Eliminate FOR_ALL_BB macro. gcc/ * basic-block.h (FOR_ALL_BB): Eliminate macro. * cfg.c (alloc_aux_for_blocks, clear_aux_for_blocks): Replace uses of FOR_ALL_BB with FOR_ALL_BB_FN, making uses of cfun explicit. * cfganal.c (inverted_post_order_compute): Likewise. * cfgcleanup.c (try_optimize_cfg): Likewise. * cfgexpand.c (add_scope_conflicts): Likewise. * cfghooks.c (dump_flow_info, account_profile_record): Likewise. * cfgrtl.c (relink_block_chain): Likewise. * dce.c (mark_artificial_uses): Likewise. * df-core.c (df_set_blocks, df_compute_cfg_image, df_dump): Likewise. * df-problems.c (df_lr_verify_solution_start, df_lr_verify_solution_end, df_lr_verify_transfer_functions, df_live_verify_solution_start, df_live_verify_solution_end, df_live_set_all_dirty, df_live_verify_transfer_functions, df_md_local_comput): Likewise. * df-scan.c (df_scan_free_internal, df_scan_alloc) df_reorganize_refs_by_insn, df_scan_verify): Likewise. * dominance.c (compute_dom_fast_query, calculate_dominance_info, free_dominance_info): Likewise. * dse.c (dse_step1, dse_step3, dse_step4, dse_step6): Likewise. * graph.c (draw_cfg_edges): Likewise. * graphite-scop-detection.c (print_graphite_scop_statistics, dot_all_scops_1): Likewise. * graphite.c (print_global_statistics, print_graphite_scop_statistics): Likewise. * ira.c (do_reload): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * lto-streamer-in.c (input_function): Likewise. * lto-streamer-out.c (output_function): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * predict.c (estimate_loops): Likewise. * sched-rgn.c (haifa_find_rgns): Likewise. * tree-cfg.c (split_critical_edges): Likewise. * tree-dfa.c (renumber_gimple_stmt_uids): Likewise. * tree-loop-distribution.c (tree_loop_distribution): Likewise. * tree-ssa-pre.c (compute_antic, insert, init_pre): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. * var-tracking.c (vt_initialize, vt_finalize): Likewise. * vtable-verify.c (vtable_verify_main): Likewise. * web.c (web_main): Likewise. From-SVN: r205830
2013-12-09 22:29:15 +01:00
FOR_ALL_BB_FN (bb, cfun)
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
alloc_aux_for_block (bb, size);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
/* Clear AUX pointers of all blocks. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
clear_aux_for_blocks (void)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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;
Eliminate FOR_ALL_BB macro. gcc/ * basic-block.h (FOR_ALL_BB): Eliminate macro. * cfg.c (alloc_aux_for_blocks, clear_aux_for_blocks): Replace uses of FOR_ALL_BB with FOR_ALL_BB_FN, making uses of cfun explicit. * cfganal.c (inverted_post_order_compute): Likewise. * cfgcleanup.c (try_optimize_cfg): Likewise. * cfgexpand.c (add_scope_conflicts): Likewise. * cfghooks.c (dump_flow_info, account_profile_record): Likewise. * cfgrtl.c (relink_block_chain): Likewise. * dce.c (mark_artificial_uses): Likewise. * df-core.c (df_set_blocks, df_compute_cfg_image, df_dump): Likewise. * df-problems.c (df_lr_verify_solution_start, df_lr_verify_solution_end, df_lr_verify_transfer_functions, df_live_verify_solution_start, df_live_verify_solution_end, df_live_set_all_dirty, df_live_verify_transfer_functions, df_md_local_comput): Likewise. * df-scan.c (df_scan_free_internal, df_scan_alloc) df_reorganize_refs_by_insn, df_scan_verify): Likewise. * dominance.c (compute_dom_fast_query, calculate_dominance_info, free_dominance_info): Likewise. * dse.c (dse_step1, dse_step3, dse_step4, dse_step6): Likewise. * graph.c (draw_cfg_edges): Likewise. * graphite-scop-detection.c (print_graphite_scop_statistics, dot_all_scops_1): Likewise. * graphite.c (print_global_statistics, print_graphite_scop_statistics): Likewise. * ira.c (do_reload): Likewise. * loop-init.c (loop_optimizer_finalize): Likewise. * lto-streamer-in.c (input_function): Likewise. * lto-streamer-out.c (output_function): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * predict.c (estimate_loops): Likewise. * sched-rgn.c (haifa_find_rgns): Likewise. * tree-cfg.c (split_critical_edges): Likewise. * tree-dfa.c (renumber_gimple_stmt_uids): Likewise. * tree-loop-distribution.c (tree_loop_distribution): Likewise. * tree-ssa-pre.c (compute_antic, insert, init_pre): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. * var-tracking.c (vt_initialize, vt_finalize): Likewise. * vtable-verify.c (vtable_verify_main): Likewise. * web.c (web_main): Likewise. From-SVN: r205830
2013-12-09 22:29:15 +01:00
FOR_ALL_BB_FN (bb, cfun)
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
bb->aux = NULL;
}
/* Free data allocated in block_aux_obstack and clear AUX pointers
of all blocks. */
void
free_aux_for_blocks (void)
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (first_block_aux_obj);
obstack_free (&block_aux_obstack, first_block_aux_obj);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
first_block_aux_obj = NULL;
clear_aux_for_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 (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
/* Allocate a memory edge of SIZE as E->aux. The obstack must
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
be first initialized by alloc_aux_for_edges. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
void
alloc_aux_for_edge (edge e, int size)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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 aux field is clear. */
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (!e->aux && first_edge_aux_obj);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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->aux = obstack_alloc (&edge_aux_obstack, size);
memset (e->aux, 0, size);
}
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
/* Initialize the edge_aux_obstack and if SIZE is nonzero, call
alloc_aux_for_edge for each basic edge. */
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
void
alloc_aux_for_edges (int size)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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 initialized;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
if (!initialized)
{
gcc_obstack_init (&edge_aux_obstack);
initialized = 1;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
else
/* Check whether AUX data are still allocated. */
gcc_assert (!first_edge_aux_obj);
first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 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 (size)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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;
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun),
EXIT_BLOCK_PTR_FOR_FN (cfun), next_bb)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23: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
edge e;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, bb->succs)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
alloc_aux_for_edge (e, size);
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
}
}
/* Clear AUX pointers of all edges. */
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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
clear_aux_for_edges (void)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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;
edge e;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun),
EXIT_BLOCK_PTR_FOR_FN (cfun), next_bb)
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
{
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->succs)
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_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->aux = NULL;
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +02:00
}
}
/* Free data allocated in edge_aux_obstack and clear AUX pointers
of all edges. */
void
free_aux_for_edges (void)
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (first_edge_aux_obj);
obstack_free (&edge_aux_obstack, first_edge_aux_obj);
Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807
2001-09-25 17:26:55 +02:00
first_edge_aux_obj = NULL;
clear_aux_for_edges ();
Makefile.in (cfg.o, [...]): New. * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): New. * basic-block.h (flow_obstack, label_value_list, tail_recursion_label_list): Declare (tidy_fallthru_edges): Declare. (expunge_block, last_loop_beg_note): Delete. (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. * cfg.c: New file (basic_block_for_insn, label_value_list): Move from flow.c; make global. (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, init_flow, clear_edges, can_delete_note_p, can_delete_label_p, flow_delete_insn, flow_delete_insn_chain, create_basic_block, expunge_block, flow_delete_block, compute_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred, split_block, marge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_flow_info, debug_flow_info, dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move here from flow.c * cfganal.c: New file. (forwarder_block_p, can_fallthru, mark_critical_edges, mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, find_unreachable_blocks, create_edge_list, free_edge_list, print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, flow_edge_list_print, remove_fake_successors, remove_fake_edges, add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); Move here from flow.c * cfgbuild.c: New file (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, make_edges, find_basic_blocks_1, find_basic_blocks, find_sub_basic_blocks): Move here from flow.c * cfgcleanup.c: New file. (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, try_optimize_cfg): Move here from flow.c (delete_unreachable_blocks, cleanup_cfg): Likewise; return true if succeeded. * cfgloop.c: New file (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_nodes_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): Move here from flow.c * flow.c: Remove everything moved elsewhere * output.h (cleanup_cfg): Return bool. * bb-reorder.c (reorder_block_def): Remove 'index'. (insert_intra_1): Add argument BB, set block for new note. (make_reorder_chain): Do not depdent on BB indexes. (make_reorder_chain_1): Do not use BB indexes. (label_for_bb): Likewise; set BB for new insn. (emit_jump_to_block_after): Likewise. (fixup_reoder_chain): Sanity check that all basic blocks are chained; verify newly created insn chain; remove undocnitional jump simplifying; Do not use BB indexes; properly initialize count and frequency information; dump reordered sequence. (insert_intra_bb_scope_notes): update call of insert_intra_1. (insert_inter_bb_scope_notes): Set block for new insn. (reorder_basic_blocks): Dump flow info before reoredering. From-SVN: r45504
2001-09-10 14:23:08 +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
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION. * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. From-SVN: r160036
2010-05-29 22:31:45 +02:00
DEBUG_FUNCTION void
debug_bb (basic_block bb)
{
dump_bb (stderr, bb, 0, dump_flags);
}
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION. * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. From-SVN: r160036
2010-05-29 22:31:45 +02:00
DEBUG_FUNCTION basic_block
debug_bb_n (int n)
{
Eliminate BASIC_BLOCK macro. gcc/ * basic-block.h (BASIC_BLOCK): Eliminate macro. * alias.c (init_alias_analysis): Eliminate BASIC_BLOCK macro in favor of uses of BASIC_BLOCK_FOR_FN, making uses of cfun explicit. * bt-load.c (compute_defs_uses_and_gen, compute_out, link_btr_uses, block_at_edge_of_live_range_p, migrate_btr_defs): Likewise. * caller-save.c (insert_one_insn): Likewise. * cfg.c (debug_bb, get_bb_original, get_bb_copy): Likewise. * cfgexpand.c (add_scope_conflicts): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloop.c (flow_loops_find): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * config/mips/mips.c (r10k_insert_cache_barriers): Likewise. * config/s390/s390.c (s390_optimize_nonescaping_tx): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * cse.c (cse_main): Likewise. * dce.c (fast_dce): Likewise. * df-core.c (df_set_blocks, df_worklist_propagate_forward, df_worklist_propagate_backward, df_worklist_dataflow_doublequeue, df_bb_replace, df_dump_region): Likewise. * df-problems.c (df_rd_bb_local_compute, df_lr_bb_local_compute, df_live_bb_local_compute, df_chain_remove_problem) df_chain_create_bb, df_word_lr_bb_local_compute, df_note_bb_compute, df_md_bb_local_compute, df_md_local_compute, df_md_transfer_function): Likewise. * df-scan.c (df_scan_blocks, df_reorganize_refs_by_reg_by_insn, df_reorganize_refs_by_insn, df_bb_refs_collect, df_record_entry_block_defs, df_update_entry_block_defs, df_record_exit_block_uses): Likewise. * dominance.c (nearest_common_dominator_for_set): Likewise. * gcse.c (hoist_code): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * ipa-inline-analysis.c (param_change_prob, estimate_function_body_sizes): Likewise. * ipa-split.c (dominated_by_forbidden): Likewise. * loop-unroll.c (apply_opt_in_copies): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * predict.c (propagate_freq): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_bb_compute_ri, regstat_bb_compute_calls_crossed): Likewise. * resource.c (mark_target_live_regs): Likewise. * sched-ebb.c (ebb_fix_recovery_cfg): Likewise. * sched-int.h (EBB_FIRST_BB, EBB_LAST_BB): Likewise. * sched-rgn.c (debug_region, dump_region_dot, too_large, haifa_find_rgns, extend_rgns, compute_dom_prob_ps, update_live, propagate_deps, sched_is_disabled_for_current_region_p): Likewise. * sched-vis.c (debug_bb_n_slim): Likewise. * sel-sched-ir.c (sel_finish_global_and_expr, verify_backedges, purge_empty_blocks, sel_remove_loop_preheader): Likewise. * sel-sched.c (remove_insns_that_need_bookkeeping) (current_region_empty_p, sel_region_init, simplify_changed_insns): Likewise. * trans-mem.c (execute_tm_mark, execute_tm_edges, tm_memopt_compute_antic, ipa_tm_scan_irr_function): Likewise. * tree-cfg.c (make_edges, end_recording_case_labels, label_to_block_fn, gimple_debug_bb, gimple_flow_call_edges_add, remove_edge_and_dominated_blocks, remove_edge_and_dominated_blocks, gimple_purge_all_dead_eh_edges, gimple_purge_all_dead_abnormal_call_edges): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call, split_bbs_on_noreturn_calls, cleanup_tree_cfg_1): Likewise. * tree-inline.c (copy_cfg_body, fold_marked_statements): Likewise. * tree-into-ssa.c (set_livein_block, prune_unused_phi_nodes, insert_phi_nodes_for, insert_updated_phi_nodes_for): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. * tree-ssa-live.c (live_worklist): Likewise. * tree-ssa-loop-manip.c (compute_live_loop_exits, add_exit_phis_var, find_uses_to_rename, copy_phi_node_args): Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-reassoc.c (update_range_test, optimize_range_tests): Likewise. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. * tree-ssa-tail-merge.c (same_succ_hash, same_succ_def::equal, same_succ_flush_bbs, update_worklist, set_cluster, same_phi_alternatives, find_clusters_1, apply_clusters, update_debug_stmts): Likewise. * tree-ssa-threadupdate.c (mark_threaded_blocks, thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * tree-vrp.c (find_assert_locations): Likewise. From-SVN: r205822
2013-12-09 21:09:29 +01:00
basic_block bb = BASIC_BLOCK_FOR_FN (cfun, n);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
debug_bb (bb);
return 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
}
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
/* Dumps cfg related information about basic block BB to OUTF.
If HEADER is true, dump things that appear before the instructions
contained in BB. If FOOTER is true, dump things that appear after.
Flags are the TDF_* masks as documented in dumpfile.h.
NB: With TDF_DETAILS, it is assumed that cfun is available, so
that maybe_hot_bb_p and probably_never_executed_bb_p don't ICE. */
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
void
dump_bb_info (FILE *outf, basic_block bb, int indent, int flags,
bool do_header, bool do_footer)
{
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
edge e;
static const char * const bb_bitnames[] =
{
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
#define DEF_BASIC_BLOCK_FLAG(NAME,IDX) #NAME ,
#include "cfg-flags.def"
NULL
#undef DEF_BASIC_BLOCK_FLAG
};
const unsigned n_bitnames = sizeof (bb_bitnames) / sizeof (char *);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
bool first;
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
char *s_indent = (char *) alloca ((size_t) indent + 1);
memset ((void *) s_indent, ' ', (size_t) indent);
s_indent[indent] = '\0';
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
gcc_assert (bb->flags <= BB_ALL_FLAGS);
if (do_header)
{
unsigned i;
if (flags & TDF_COMMENT)
fputs (";; ", outf);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
fprintf (outf, "%sbasic block %d, loop depth %d",
s_indent, bb->index, bb_loop_depth (bb));
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
if (flags & TDF_DETAILS)
{
predict.c (maybe_hot_frequency_p): New parameter fun. 2012-08-24 Martin Jambor <mjambor@suse.cz> * predict.c (maybe_hot_frequency_p): New parameter fun. Use its decl instead of current_function_decl, use profile_status_for_function and ENTRY_BLOCK_PTR_FOR_FUNCTION with fun instead of their cfun variants. (maybe_hot_count_p): New parameter fun, use profile_status_for_function instead of its cfun_variant. (maybe_hot_bb_p): New parameter fun, checking-assert it, pass it to all callees. (maybe_hot_edge_p): Pass cfun to maybe_hot_count_p and maybe_hot_frequency_p. (probably_never_executed_bb_p): New parameter fun, use its decl instead of current_function_decl. (optimize_bb_for_size_p): Pass cfun to maybe_hot_bb_p. (rtl_profile_for_bb): Likewise. (compute_function_frequency): Pass cfun to maybe_hot_bb_p and probably_never_executed_bb_p. * tree-ssa-operands.c (ssa_operands_active): New operator fun. Use it instead of cfun. (update_stmt_operands): Pass cfun as an argument of ssa_operands_active. (swap_tree_operands): Likewise. * gimple-iterator.c (update_modified_stmt): Likewise. (update_modified_stmts): Likewise. * tree-flow-inline.h (delink_stmt_imm_use): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. * bb-reorder.c (bb_to_key): Pass cfun to probably_never_executed_bb_p. (push_to_next_round_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges ): Likewise. * cfg.c: Inlude tree.h. (check_bb_profile): Use profile_status_for_function, EXIT_BLOCK_PTR_FOR_FUNCTION and ENTRY_BLOCK_PTR_FOR_FUNCTION with DECL_STRUCT_FUNCTION (current_function_decl) instead of their cfun variants. (dump_bb_info): Pass DECL_STRUCT_FUNCTION (current_function_decl) to maybe_hot_bb_p and probably_never_executed_bb_p. * gimple-pretty-print.c (gimple_dump_bb_buff): Checking-assert that DECL_STRUCT_FUNCTION (current_function_decl) is not NULL. Pass it to dump_histograms_for_stmt. (dump_gimple_mem_ops): Pass DECL_STRUCT_FUNCTION (current_function_decl) as an argument to dump_gimple_mem_ops. * tree-cfg.c (dump_function_to_file): Rename parameter fn to fndecl. Do not change cfun. Change and restore current_function_decl. * Makefile.in (cfg.o): Include TREE_H in dependencies. From-SVN: r190645
2012-08-24 14:57:24 +02:00
struct function *fun = DECL_STRUCT_FUNCTION (current_function_decl);
fprintf (outf, ", count " "%" PRId64,
system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. 2014-05-23 Richard Biener <rguenther@suse.de> * system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. * hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT, HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC, HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED, HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX, HOST_WIDEST_INT_C): Remove. (PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define if C99 inttypes.h is not available. * coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t. * gcov-io.h (gcov_type, gcov_type_unsigned): Likewise. * gcov-io.c (gcov_histo_index): Drop non-64bit hwi case. * cfgloop.h (struct niter_desc): Use uint64_t for niter field. * bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters. (struct output_info): Likewise. (print_statistics): Adjust. (dump_bitmap_statistics): Likewise. * bt-load.c (migrate_btr_defs): Print with PRId64. * cfg.c (dump_edge_info, dump_bb_info): Likewise. (MAX_SAFE_MULTIPLIER): Adjust. * cfghooks.c (dump_bb_for_graph): Print with PRId64. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee, dump_cgraph_node): Likewise. * final.c (dump_basic_block_info): Likewise. * gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise. * gcov.c (format_gcov): Likewise. * ipa-cp.c (good_cloning_opportunity_p): Likewise. Use int64_t for calculation. (get_clone_agg_value): Use HOST_WIDE_INT for offset. * ipa-inline.c (compute_max_insns): Use int64_t for calcuation. (inline_small_functions, dump_overall_stats, dump_inline_stats): Use PRId64 for dumping. * ipa-profile.c (dump_histogram, ipa_profile): Likewise. * ira-color.c (struct allocno_hard_regs): Use int64_t for cost. (add_allocno_hard_regs): Adjust. * loop-doloop.c (doloop_modify): Print using PRId64. * loop-iv.c (inverse): Compute in uint64_t. (determine_max_iter, iv_number_of_iterations): Likewise. * loop-unroll.c (decide_peel_completely, decide_peel_simple): Print using PRId64. * lto-streamer-out.c (write_symbol): Use uint64_t. * mcf.c (CAP_INFINITY): Use int64_t maximum. (dump_fixup_edge, create_fixup_graph, cancel_negative_cycle, find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64. * modulo-sched.c (const_iteration_count): Use int64_t. (sms_schedule): Dump using PRId64. * predict.c (dump_prediction): Likewise. * pretty-print.h (pp_widest_integer): Remove. * profile.c (get_working_sets, is_edge_inconsistent, is_inconsistent, read_profile_edge_counts): Dump using PRId64. * tree-pretty-print.c (pp_double_int): Remove case handling HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT. * tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t and adjust users. (pass_optimize_bswap::execute): Remove restriction on hosts. * tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT. * tree-streamer-out.c (streamer_write_tree_header): Likewise. * tree.c (widest_int_cst_value): Remove. * tree.h (widest_int_cst_value): Likewise. * value-prof.c (dump_histogram_value): Print using PRId64. * gengtype.c (main): Also inject int64_t. * ggc-page.c (struct max_alignment): Use int64_t. * alloc-pool.c (struct allocation_object_def): Likewise. * ira-conflicts.c (build_conflict_bit_table): Use uint64_t for computation. * doc/tm.texi.in: Remove reference to HOST_WIDEST_INT. * doc/tm.texi: Regenerated. * gengtype-lex.l (IWORD): Handle [u]int64_t. * config/sh/sh.c (expand_cbranchdi4): Use gcov_type. * config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value, mmix_output_register_setting): Use [u]int64_t in prototypes. * config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting, mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str, mmix_output_octa, mmix_output_shifted_value): Adjust. (mmix_intval): Adjust. Remove unreachable case. * config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use int64_t. lto/ * lto.c (lto_parse_hex): Use int64_t. (lto_resolution_read): Likewise. From-SVN: r210931
2014-05-26 12:42:43 +02:00
(int64_t) bb->count);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
fprintf (outf, ", freq %i", bb->frequency);
predict.c (maybe_hot_frequency_p): New parameter fun. 2012-08-24 Martin Jambor <mjambor@suse.cz> * predict.c (maybe_hot_frequency_p): New parameter fun. Use its decl instead of current_function_decl, use profile_status_for_function and ENTRY_BLOCK_PTR_FOR_FUNCTION with fun instead of their cfun variants. (maybe_hot_count_p): New parameter fun, use profile_status_for_function instead of its cfun_variant. (maybe_hot_bb_p): New parameter fun, checking-assert it, pass it to all callees. (maybe_hot_edge_p): Pass cfun to maybe_hot_count_p and maybe_hot_frequency_p. (probably_never_executed_bb_p): New parameter fun, use its decl instead of current_function_decl. (optimize_bb_for_size_p): Pass cfun to maybe_hot_bb_p. (rtl_profile_for_bb): Likewise. (compute_function_frequency): Pass cfun to maybe_hot_bb_p and probably_never_executed_bb_p. * tree-ssa-operands.c (ssa_operands_active): New operator fun. Use it instead of cfun. (update_stmt_operands): Pass cfun as an argument of ssa_operands_active. (swap_tree_operands): Likewise. * gimple-iterator.c (update_modified_stmt): Likewise. (update_modified_stmts): Likewise. * tree-flow-inline.h (delink_stmt_imm_use): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. * bb-reorder.c (bb_to_key): Pass cfun to probably_never_executed_bb_p. (push_to_next_round_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges ): Likewise. * cfg.c: Inlude tree.h. (check_bb_profile): Use profile_status_for_function, EXIT_BLOCK_PTR_FOR_FUNCTION and ENTRY_BLOCK_PTR_FOR_FUNCTION with DECL_STRUCT_FUNCTION (current_function_decl) instead of their cfun variants. (dump_bb_info): Pass DECL_STRUCT_FUNCTION (current_function_decl) to maybe_hot_bb_p and probably_never_executed_bb_p. * gimple-pretty-print.c (gimple_dump_bb_buff): Checking-assert that DECL_STRUCT_FUNCTION (current_function_decl) is not NULL. Pass it to dump_histograms_for_stmt. (dump_gimple_mem_ops): Pass DECL_STRUCT_FUNCTION (current_function_decl) as an argument to dump_gimple_mem_ops. * tree-cfg.c (dump_function_to_file): Rename parameter fn to fndecl. Do not change cfun. Change and restore current_function_decl. * Makefile.in (cfg.o): Include TREE_H in dependencies. From-SVN: r190645
2012-08-24 14:57:24 +02:00
if (maybe_hot_bb_p (fun, bb))
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
fputs (", maybe hot", outf);
predict.c (maybe_hot_frequency_p): New parameter fun. 2012-08-24 Martin Jambor <mjambor@suse.cz> * predict.c (maybe_hot_frequency_p): New parameter fun. Use its decl instead of current_function_decl, use profile_status_for_function and ENTRY_BLOCK_PTR_FOR_FUNCTION with fun instead of their cfun variants. (maybe_hot_count_p): New parameter fun, use profile_status_for_function instead of its cfun_variant. (maybe_hot_bb_p): New parameter fun, checking-assert it, pass it to all callees. (maybe_hot_edge_p): Pass cfun to maybe_hot_count_p and maybe_hot_frequency_p. (probably_never_executed_bb_p): New parameter fun, use its decl instead of current_function_decl. (optimize_bb_for_size_p): Pass cfun to maybe_hot_bb_p. (rtl_profile_for_bb): Likewise. (compute_function_frequency): Pass cfun to maybe_hot_bb_p and probably_never_executed_bb_p. * tree-ssa-operands.c (ssa_operands_active): New operator fun. Use it instead of cfun. (update_stmt_operands): Pass cfun as an argument of ssa_operands_active. (swap_tree_operands): Likewise. * gimple-iterator.c (update_modified_stmt): Likewise. (update_modified_stmts): Likewise. * tree-flow-inline.h (delink_stmt_imm_use): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. * bb-reorder.c (bb_to_key): Pass cfun to probably_never_executed_bb_p. (push_to_next_round_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges ): Likewise. * cfg.c: Inlude tree.h. (check_bb_profile): Use profile_status_for_function, EXIT_BLOCK_PTR_FOR_FUNCTION and ENTRY_BLOCK_PTR_FOR_FUNCTION with DECL_STRUCT_FUNCTION (current_function_decl) instead of their cfun variants. (dump_bb_info): Pass DECL_STRUCT_FUNCTION (current_function_decl) to maybe_hot_bb_p and probably_never_executed_bb_p. * gimple-pretty-print.c (gimple_dump_bb_buff): Checking-assert that DECL_STRUCT_FUNCTION (current_function_decl) is not NULL. Pass it to dump_histograms_for_stmt. (dump_gimple_mem_ops): Pass DECL_STRUCT_FUNCTION (current_function_decl) as an argument to dump_gimple_mem_ops. * tree-cfg.c (dump_function_to_file): Rename parameter fn to fndecl. Do not change cfun. Change and restore current_function_decl. * Makefile.in (cfg.o): Include TREE_H in dependencies. From-SVN: r190645
2012-08-24 14:57:24 +02:00
if (probably_never_executed_bb_p (fun, bb))
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
fputs (", probably never executed", outf);
}
fputc ('\n', outf);
if (flags & TDF_DETAILS)
{
check_bb_profile (bb, outf, indent, flags);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s prev block ", s_indent);
if (bb->prev_bb)
fprintf (outf, "%d", bb->prev_bb->index);
else
fprintf (outf, "(nil)");
fprintf (outf, ", next block ");
if (bb->next_bb)
fprintf (outf, "%d", bb->next_bb->index);
else
fprintf (outf, "(nil)");
fputs (", flags:", outf);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
first = true;
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
for (i = 0; i < n_bitnames; i++)
if (bb->flags & (1 << i))
{
if (first)
fputs (" (", outf);
else
fputs (", ", outf);
first = false;
fputs (bb_bitnames[i], outf);
}
if (!first)
fputc (')', outf);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
fputc ('\n', outf);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
}
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s pred: ", s_indent);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
first = true;
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
FOR_EACH_EDGE (e, ei, bb->preds)
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
{
if (! first)
{
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s ", s_indent);
}
first = false;
dump_edge_info (outf, e, flags, 0);
fputc ('\n', outf);
}
if (first)
fputc ('\n', outf);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
}
if (do_footer)
{
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s succ: ", s_indent);
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
first = true;
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
FOR_EACH_EDGE (e, ei, bb->succs)
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
{
if (! first)
{
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s ", s_indent);
}
first = false;
dump_edge_info (outf, e, flags, 1);
fputc ('\n', outf);
}
if (first)
fputc ('\n', outf);
dumpfile.h (TDF_COMMENT): New define. * dumpfile.h (TDF_COMMENT): New define. * basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL, EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU, EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE, EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE): Move to new file cfg-flags.h. (enum cfg_edge_flags): New enum, using cfg-flags.h. (EDGE_ALL_FLAGS): Compute value automatically. (BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK, BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION, BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL, BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED, BB_IN_TRANSACTION): Move to new file cfg-flags.h. (enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h. (BB_ALL_FLAGS): New, compute value automatically. (dump_bb_info): Update prototype. (dump_edge_info): Update prototype. * cfg-flags.h: New file. * cfg.c (dump_edge_info): Take flags argument. Be verbose only if TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames. Check that the edge flags are within the range of EDGE_ALL_FLAGS. (debug_bb): Update dump_bb call. (dump_cfg_bb_info): Remove. (dump_bb_info): New function. Use cfg-flags.h for bitnames. Adjust verbosity using TDF_* flags. Check that the basic block flags are within the range of BB_ALL_FLAGS. (brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info. * cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE first for consistency with other dump functions. (dump_bb): Update prototype accordingly. * cfghooks.c: Include dumpfile.h. (verify_flow_info): Update dump_edge_info calls. (dump_bb): Take a flags argument and pass it around. Use dump_bb_info to dump common information about a basic block. (dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic. (debug_flow_info): Moved here from cfgrtl.c. * profile.c (is_edge_inconsistent): Update dump_bb calls. * loop-invariant.c (find_defs): Update print_rtl_with_bb call. * rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim, print_rtl_slim_with_bb): Remove prototypes. (dump_insn_slim): Adjust prototype to take a const_rtx. (print_rtl_with_bb): Adjust prototype. * sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim. * sched-vis.c (dump_insn_slim): Take a const_rtx. (debug_insn_slim): Prototype here near DEBUG_FUNCTION marker. (print_rtl_slim_with_bb): Remove. (print_rtl_slim): Rename to debug_rtl_slim. Print only insn info, not basic block info (print_rtl_with_bb with TDF_SLIM should be used for that. Prototype here near DEBUG_FUNCTION marker. (debug_bb_slim): Prototype here near DEBUG_FUNCTION marker. Use dump_bb. (debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker. * tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX. (remove_bb): Update dump_bb call. (gimple_debug_bb): Use dump_bb. (dump_function_to_file): Update gimple_dump_bb call. (print_loops_bb): Likewise. * tree-flow.h (gimple_dump_bb): Update prototype. * gimple-pretty-print.c (dump_bb_header): Rename to dump_gimple_bb_header. Write to a stream instead of a pretty printer. Use dump_bb_info to dump basic block info. (dump_bb_end): Rename to dump_gimple_bb_footer. Write to a stream instead of a pretty printer. Use dump_bb_info. (gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end. (gimple_dump_bb): Do it here with dump_gimple_bb_header and dump_gimple_bb_footer. * cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM. (print_rtl_with_bb): Take a flags argument and pass it around. Use dump_insn_slim if TDF_SLIM. (dump_bb_info): Removed and re-incarnated in cfg.c. (dump_flow_info): Moved to cfghooks.c. (debug_flow_info): Moved to cfghooks.c. * passes.c (execute_function_dump): Unconditionally use print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM. * final.c (dump_basic_block_info): Update dump_edge_info calls. * tree-vrp.c (dump_asserts_for): Likewise. * ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb. * tree-if-conv.c (if_convertible_bb_p): Don't look at EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world. * trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL, for the same reason. * config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls. From-SVN: r189590
2012-07-18 01:17:20 +02:00
}
}
/* Dumps a brief description of cfg to FILE. */
void
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
brief_dump_cfg (FILE *file, int flags)
{
basic_block bb;
Eliminate FOR_EACH_BB macro. gcc/ * basic-block.h (FOR_EACH_BB): Eliminate macro. * asan.c (transform_statements, execute_sanopt): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges, set_edge_can_fallthru_flag, fix_up_fall_thru_edges, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes, insert_section_boundary_note, rest_of_handle_reorder_blocks, duplicate_computed_gotos): Likewise. * cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise. * cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges, compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise. * cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs): Likewise. * cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits, verify_loop_structure): Likewise. * cfgloopanal.c (mark_loop_exit_edges): Likewise. * cfgrtl.c (compute_bb_for_insn, find_partition_fixes, verify_hot_cold_block_grouping, purge_all_dead_edges, fixup_abnormal_edges, record_effective_endpoints, outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru, break_superblocks): Likewise. * cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges, cgraph_rebuild_references): Likewise. * combine-stack-adj.c (combine_stack_adjustments): Likewise. * combine.c (delete_noop_moves, create_log_links, combine_instructions): Likewise. * config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise. * config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched, c6x_reorg): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. * config/ia64/ia64.c (ia64_reorg): Likewise. * config/mips/mips.c (mips_annotate_pic_calls): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * config/tilegx/tilegx.c (tilegx_gen_bundles, reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (tilepro_gen_bundles, reorder_var_tracking_notes): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (compute_hash_table_work, compute_cprop_data, local_cprop_pass, find_implicit_sets): Likewise. * cse.c (cse_condition_code_reg): Likewise. * dce.c (prescan_insns_for_dce): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_word_lr_alloc): Likewise. * df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all, df_update_entry_exit_and_calls): Likewise. * dominance.c (calculate_dominance_info, verify_dominators, debug_dominance_info): Likewise. * dse.c (dse_step5_nospill): Likewise. * except.c (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns, rest_of_match_asm_constraints): Likewise. * gcse.c (compute_hash_table_work, prune_expressions, compute_pre_data, compute_code_hoist_vbeinout, hoist_code, calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour, find_explicit_erroneous_behaviour): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa, rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * hw-doloop.c (discover_loops, set_bb_indices, reorder_loops): Likewise. * ifcvt.c (if_convert): Likewise. * init-regs.c (initialize_uninitialized_regs): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * ipa-split.c (find_split_points, execute_split_functions): Likewise. * ira-build.c (form_loop_tree): Likewise. * ira-costs.c (find_costs_and_classes): Likewise. * ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise. * ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered, mark_elimination, update_equiv_regs, find_moveable_pseudos, split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise. * jump.c (mark_all_labels): Likewise. * lcm.c (compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete): Likewise. * loop-init.c (fix_loop_structure): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (decompose_multiword_subregs, decompose_multiword_subregs): Likewise. * lra-assigns.c (assign_by_spills): Likewise. * lra-coalesce.c (lra_coalesce): Likewise. * lra-constraints.c (lra_inheritance, remove_inheritance_pseudos): Likewise. * lra-eliminations.c (lra_init_elimination): Likewise. * lra-spills.c (assign_spill_hard_regs, spill_pseudos, lra_final_code_change): Likewise. * lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver, update_inc_notes): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * modulo-sched.c (rest_of_handle_sms): Likewise. * omp-low.c (optimize_omp_library_calls, expand_omp_taskreg, expand_omp_target): Likewise. * postreload-gcse.c (alloc_mem, compute_hash_table): Likewise. * postreload.c (reload_cse_regs_1): Likewise. * predict.c (strip_predict_hints, tree_bb_level_predictions, tree_estimate_probability, expensive_function_p, estimate_bb_frequencies, compute_function_frequency): Likewise. * profile.c (is_inconsistent, compute_branch_probabilities, branch_prob): Likewise. * ree.c (find_removable_extensions): Likewise. * reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * reginfo.c (init_subregs_of_mode): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (has_nonexceptional_receiver, reload, calculate_elim_costs_all_insns): Likewise. * resource.c (init_resource_info, free_resource_info): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_single_block_region, haifa_find_rgns, sched_rgn_local_init): Likewise. * sel-sched-dump.c (sel_dump_cfg_2): Likewise. * sel-sched-ir.c (init_lv_sets, free_lv_sets, make_regions_from_the_rest): Likewise. * sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification): Likewise. * store-motion.c (compute_store_table, build_store_vectors, one_store_motion_pass): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (compute_transaction_bits): Likewise. * tree-call-cdce.c (tree_call_cdce): Likewise. * tree-cfg.c (replace_loop_annotate, factor_computed_gotos, fold_cond_expr_cond, make_edges, assign_discriminators, make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels, dump_cfg_stats, gimple_verify_flow_info, print_loop, execute_fixup_cfg): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise. * tree-complex.c (init_dont_simulate_again, tree_lower_complex): Likewise. * tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise. * tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch, mark_reachable_handlers): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise. * tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees, insert_backedge_copies, tree_profiling): Likewise. * tree-scalar-evolution.c (scev_const_prop): Likewise. * tree-sra.c (scan_function, sra_modify_function_body, propagate_dereference_distances, ipa_sra_modify_function_body, convert_callers): Likewise. * tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. create_outofssa_var_map, coalesce_partitions): Likewise. * tree-ssa-copy.c (init_copy_prop): Likewise. * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts, eliminate_unnecessary_stmts): Likewise. * tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize): Likewise. * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise. * tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals, new_tree_live_info, calculate_live_on_exit, dump_live_info, analyze_memory_references, fill_always_executed_in, tree_ssa_lim_finalize): Likewise. * tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos, execute_optimize_bswap, execute_optimize_widening_mul): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors): Likewise. * tree-ssa-ter.c (find_replaceable_exprs): Likewise. * tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges, tree_ssa_uncprop): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars, execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise. * tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg): Likewise. * tree-switch-conversion.c (do_switchconv): Likewise. * tree-vect-generic.c (expand_vector_operations): Likewise. * tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses, execute_vect_slp): Likewise. * tree-vrp.c (check_all_array_refs, remove_range_assertions, vrp_initialize, identify_jump_threads, instrument_memory_accesses): Likewise. * ubsan.c (ubsan_pass): Likewise. * value-prof.c (verify_histograms, gimple_value_profile_transformations, gimple_find_values_to_profile): Likewise. * var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes, vt_initialize, delete_debug_insns, vt_finalize): Likewise. gcc/testsuite/ * g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise. From-SVN: r205828
2013-12-09 22:06:06 +01:00
FOR_EACH_BB_FN (bb, cfun)
{
basic-block.h (BB_FLAGS_TO_PRESERVE): New define. gcc/ * basic-block.h (BB_FLAGS_TO_PRESERVE): New define. (brief_dump_cfg): Update prototype to take flags argument. (check_bb_profile): Remove prototype. * tracer.c (tracer): Update brief_dump_cfg calls. * cfghooks.c (dump_bb): Do not pass TDF_COMMENT to dump_bb_info. Call dump_bb_info before and after the cfghook dump_bb. Terminate the dump with a newline. (dump_flow_info): Do not call check_bb_profile. * cfg.c (clear_bb_flags): Update using BB_FLAGS_TO_PRESERVE. (check_bb_profile): Make static. Take indent and flags arguments. (dump_bb_info): Always dump loop depth. With TDF_DETAILS, call check_bb_profile. Print one edge per line. (brief_dump_cfg): Take a flags argument, and filter out TDF_COMMENT and TDF_DETAILS. * pretty-print.c (pp_base_newline): Set pp_needs_newline to false. * gimple-pretty-print.c (dump_gimple_bb_header): Do not use dump_bb_info here, it is already called from dump_bb. Idem for check_bb_profile. (dump_gimple_bb_footer): Likewise. (gimple_dump_bb_buff): Call pp_flush after dump_gimple_stmt to avoid broken dumps for statement histograms. (gimple_dump_bb): Handle ENTRY_BLOCK and EXIT_BLOCK. Do not call pp_flush here, the buffer should be empty. * sched-rgn.c (debug_region): Pass TDF_BLOCKS to dump_bb. * sched-vis.c (debug_bb_slim): Likewise. * tree-cfg.c (remove_bb): Pass dump_flags to dump_bb. (gimple_debug_bb): Pass TDF_BLOCKS to dump_bb. (gimple_dump_cfg): Do brief_dump_cfg with TDF_COMMENT. (dump_function_to_file): Do not call check_bb_profile on ENTRY_BLOCK and EXIT_BLOCK, check_bb_profile doesn't handle them. Use dump_bb instead of gimple_dump_bb. (print_loops_bb): Use dump_bb instead of gimple_dump_bb. * passes.c (execute_function_dump): Always call print_rtl_with_bb for RTL dumps. * cfgrtl.c (print_rtl_with_bb): Handle printing without an up-to-date CFG. With TDF_BLOCKS and TDF_DETAILS, do DF dumps at the top and bottom of each basic block. testsuite/ * gcc.dg/tree-prof/update-loopch.c: Look for counts on the dumps of the basic block and check loop depth. * gcc.dg/tree-ssa/pr18133-1.c: Dump details, not blocks. Update matching patterns and comments. * gcc.dg/tree-ssa/20031021-1.c: Fix check patterns. * gcc.dg/tree-ssa/vector-2.c: Likewise. From-SVN: r189717
2012-07-20 14:25:55 +02:00
dump_bb_info (file, bb, 0,
flags & (TDF_COMMENT | TDF_DETAILS),
true, true);
}
}
/* An edge originally destinating BB of FREQUENCY and COUNT has been proved to
leave the block by TAKEN_EDGE. Update profile of BB such that edge E can be
2006-05-19 00:16:23 +02:00
redirected to destination of TAKEN_EDGE.
This function may leave the profile inconsistent in the case TAKEN_EDGE
frequency or count is believed to be lower than FREQUENCY or COUNT
respectively. */
void
update_bb_profile_for_threading (basic_block bb, int edge_frequency,
gcov_type count, edge taken_edge)
{
edge c;
int prob;
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
edge_iterator ei;
bb->count -= count;
if (bb->count < 0)
{
if (dump_file)
fprintf (dump_file, "bb %i count became negative after threading",
bb->index);
bb->count = 0;
}
bb->frequency -= edge_frequency;
if (bb->frequency < 0)
bb->frequency = 0;
/* Compute the probability of TAKEN_EDGE being reached via threaded edge.
Watch for overflows. */
if (bb->frequency)
prob = GCOV_COMPUTE_SCALE (edge_frequency, bb->frequency);
else
prob = 0;
if (prob > taken_edge->probability)
{
if (dump_file)
fprintf (dump_file, "Jump threading proved probability of edge "
"%i->%i too small (it is %i, should be %i).\n",
taken_edge->src->index, taken_edge->dest->index,
taken_edge->probability, prob);
prob = taken_edge->probability * 6 / 8;
}
/* Now rescale the probabilities. */
taken_edge->probability -= prob;
prob = REG_BR_PROB_BASE - prob;
if (prob <= 0)
{
if (dump_file)
fprintf (dump_file, "Edge frequencies of bb %i has been reset, "
"frequency of block should end up being 0, it is %i\n",
bb->index, bb->frequency);
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
EDGE_SUCC (bb, 0)->probability = REG_BR_PROB_BASE;
ei = ei_start (bb->succs);
ei_next (&ei);
for (; (c = ei_safe_edge (ei)); ei_next (&ei))
c->probability = 0;
}
else if (prob != REG_BR_PROB_BASE)
{
int scale = RDIV (65536 * REG_BR_PROB_BASE, prob);
FOR_EACH_EDGE (c, ei, bb->succs)
{
/* Protect from overflow due to additional scaling. */
if (c->probability > prob)
c->probability = REG_BR_PROB_BASE;
else
{
c->probability = RDIV (c->probability * scale, 65536);
if (c->probability > REG_BR_PROB_BASE)
c->probability = REG_BR_PROB_BASE;
}
}
}
alias.c (true_dependence): Remove 'abort' from comments. * alias.c (true_dependence): Remove 'abort' from comments. Use gcc_assert and gcc_unreachable as appropriate. (canon_true_dependence): Likewise. * bb-reorder.c (connect_traces): Likewise. * c-common.c (c_add_case_label): Likewise. * c-decl.c (finish_function): Likewise. * caller-save.c (insert_restore, insert_save): Likewise. * cfg.c (update_bb_profile_for_threading): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * cfgexpand.c (add_reg_br_prob_note): Likewise. * cfgrtl.c (rtl_redirect_edge_and_branch_force, rtl_split_edge, cfg_layout_merge_blocks): Likewise. * ifcvt.c (cond_exec_process_insns, merge_if_block, find_if_block): Likewise. * integrate.c (allocate_initial_values): Likewise. * jump.c (reverse_condition, reverse_condition_maybe_unordered, swap_condition, unsigned_condition, signed_condition, mark_jump_label, invert_jump_1, rtx_renumbered_equal_p, reg_or_subregno): Likewise. * lambda-code.c (lambda_compute_auxillary_space, lambda_transform_legal_p): Likewise. * lambda-mat.c (lambda_matrix_inverse_hard): Likewise. * langhooks.c (lhd_set_decl_assembler_name, lhd_type_promotes_to, lhd_incomplete_type_error, lhd_expand_expr, lhd_types_compatible_p, lhd_tree_size): Likewise. * lcm.c (create_pre_exit, optimize_mode_switching): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-unroll.c (peel_loop_completely unroll_loop_constant_iterations, unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid, analyze_iv_to_split_insn): Likewise. * loop.c (gen_prefetch, find_and_verify_loops, basic_induction_var): Likewise. * modulo-sched.c (normalize_sched_times, check_nodes_order): Likewise. * value-prof.c (tree_find_values_to_profile): Likewise. * varasm.c (named_section, default_assemble_integer, decode_addr_const): Likewise. From-SVN: r98508
2005-04-21 17:47:33 +02:00
gcc_assert (bb == taken_edge->src);
taken_edge->count -= count;
if (taken_edge->count < 0)
{
if (dump_file)
fprintf (dump_file, "edge %i->%i count became negative after threading",
taken_edge->src->index, taken_edge->dest->index);
taken_edge->count = 0;
}
}
/* Multiply all frequencies of basic blocks in array BBS of length NBBS
by NUM/DEN, in int arithmetic. May lose some accuracy. */
void
scale_bbs_frequencies_int (basic_block *bbs, int nbbs, int num, int den)
{
int i;
edge e;
if (num < 0)
num = 0;
/* Scale NUM and DEN to avoid overflows. Frequencies are in order of
10^4, if we make DEN <= 10^3, we can afford to upscale by 100
and still safely fit in int during calculations. */
if (den > 1000)
{
if (num > 1000000)
return;
num = RDIV (1000 * num, den);
den = 1000;
}
if (num > 100 * den)
return;
for (i = 0; i < nbbs; i++)
{
edge_iterator ei;
bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den);
/* Make sure the frequencies do not grow over BB_FREQ_MAX. */
if (bbs[i]->frequency > BB_FREQ_MAX)
bbs[i]->frequency = BB_FREQ_MAX;
bbs[i]->count = RDIV (bbs[i]->count * num, den);
FOR_EACH_EDGE (e, ei, bbs[i]->succs)
e->count = RDIV (e->count * num, den);
}
}
/* numbers smaller than this value are safe to multiply without getting
64bit overflow. */
system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. 2014-05-23 Richard Biener <rguenther@suse.de> * system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. * hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT, HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC, HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED, HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX, HOST_WIDEST_INT_C): Remove. (PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define if C99 inttypes.h is not available. * coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t. * gcov-io.h (gcov_type, gcov_type_unsigned): Likewise. * gcov-io.c (gcov_histo_index): Drop non-64bit hwi case. * cfgloop.h (struct niter_desc): Use uint64_t for niter field. * bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters. (struct output_info): Likewise. (print_statistics): Adjust. (dump_bitmap_statistics): Likewise. * bt-load.c (migrate_btr_defs): Print with PRId64. * cfg.c (dump_edge_info, dump_bb_info): Likewise. (MAX_SAFE_MULTIPLIER): Adjust. * cfghooks.c (dump_bb_for_graph): Print with PRId64. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee, dump_cgraph_node): Likewise. * final.c (dump_basic_block_info): Likewise. * gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise. * gcov.c (format_gcov): Likewise. * ipa-cp.c (good_cloning_opportunity_p): Likewise. Use int64_t for calculation. (get_clone_agg_value): Use HOST_WIDE_INT for offset. * ipa-inline.c (compute_max_insns): Use int64_t for calcuation. (inline_small_functions, dump_overall_stats, dump_inline_stats): Use PRId64 for dumping. * ipa-profile.c (dump_histogram, ipa_profile): Likewise. * ira-color.c (struct allocno_hard_regs): Use int64_t for cost. (add_allocno_hard_regs): Adjust. * loop-doloop.c (doloop_modify): Print using PRId64. * loop-iv.c (inverse): Compute in uint64_t. (determine_max_iter, iv_number_of_iterations): Likewise. * loop-unroll.c (decide_peel_completely, decide_peel_simple): Print using PRId64. * lto-streamer-out.c (write_symbol): Use uint64_t. * mcf.c (CAP_INFINITY): Use int64_t maximum. (dump_fixup_edge, create_fixup_graph, cancel_negative_cycle, find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64. * modulo-sched.c (const_iteration_count): Use int64_t. (sms_schedule): Dump using PRId64. * predict.c (dump_prediction): Likewise. * pretty-print.h (pp_widest_integer): Remove. * profile.c (get_working_sets, is_edge_inconsistent, is_inconsistent, read_profile_edge_counts): Dump using PRId64. * tree-pretty-print.c (pp_double_int): Remove case handling HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT. * tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t and adjust users. (pass_optimize_bswap::execute): Remove restriction on hosts. * tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT. * tree-streamer-out.c (streamer_write_tree_header): Likewise. * tree.c (widest_int_cst_value): Remove. * tree.h (widest_int_cst_value): Likewise. * value-prof.c (dump_histogram_value): Print using PRId64. * gengtype.c (main): Also inject int64_t. * ggc-page.c (struct max_alignment): Use int64_t. * alloc-pool.c (struct allocation_object_def): Likewise. * ira-conflicts.c (build_conflict_bit_table): Use uint64_t for computation. * doc/tm.texi.in: Remove reference to HOST_WIDEST_INT. * doc/tm.texi: Regenerated. * gengtype-lex.l (IWORD): Handle [u]int64_t. * config/sh/sh.c (expand_cbranchdi4): Use gcov_type. * config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value, mmix_output_register_setting): Use [u]int64_t in prototypes. * config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting, mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str, mmix_output_octa, mmix_output_shifted_value): Adjust. (mmix_intval): Adjust. Remove unreachable case. * config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use int64_t. lto/ * lto.c (lto_parse_hex): Use int64_t. (lto_resolution_read): Likewise. From-SVN: r210931
2014-05-26 12:42:43 +02:00
#define MAX_SAFE_MULTIPLIER (1 << (sizeof (int64_t) * 4 - 1))
/* Multiply all frequencies of basic blocks in array BBS of length NBBS
by NUM/DEN, in gcov_type arithmetic. More accurate than previous
function but considerably slower. */
void
2006-05-19 00:16:23 +02:00
scale_bbs_frequencies_gcov_type (basic_block *bbs, int nbbs, gcov_type num,
gcov_type den)
{
int i;
edge e;
gcov_type fraction = RDIV (num * 65536, den);
gcc_assert (fraction >= 0);
if (num < MAX_SAFE_MULTIPLIER)
for (i = 0; i < nbbs; i++)
{
edge_iterator ei;
bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den);
if (bbs[i]->count <= MAX_SAFE_MULTIPLIER)
bbs[i]->count = RDIV (bbs[i]->count * num, den);
else
bbs[i]->count = RDIV (bbs[i]->count * fraction, 65536);
FOR_EACH_EDGE (e, ei, bbs[i]->succs)
if (bbs[i]->count <= MAX_SAFE_MULTIPLIER)
e->count = RDIV (e->count * num, den);
else
e->count = RDIV (e->count * fraction, 65536);
}
else
for (i = 0; i < nbbs; i++)
{
edge_iterator ei;
if (sizeof (gcov_type) > sizeof (int))
bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den);
else
bbs[i]->frequency = RDIV (bbs[i]->frequency * fraction, 65536);
bbs[i]->count = RDIV (bbs[i]->count * fraction, 65536);
FOR_EACH_EDGE (e, ei, bbs[i]->succs)
e->count = RDIV (e->count * fraction, 65536);
}
}
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
/* Helper types for hash tables. */
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
struct htab_bb_copy_original_entry
{
/* Block we are attaching info to. */
int index1;
/* Index of original or copy (depending on the hashtable) */
int index2;
};
hash-table.h: Update comments. gcc/ * hash-table.h: Update comments. * hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove. (nofree_ptr_hash): New class. * asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. * attribs.c (attribute_hasher): Likewise. * cfg.c (bb_copy_hasher): Likewise. * cselib.c (cselib_hasher): Likewise. * dse.c (invariant_group_base_hasher): Likewise. * dwarf2cfi.c (trace_info_hasher): Likewise. * dwarf2out.c (macinfo_entry_hasher): Likewise. (comdat_type_hasher, loc_list_hasher): Likewise. * gcse.c (pre_ldst_expr_hasher): Likewise. * genmatch.c (id_base): Likewise. * genrecog.c (test_pattern_hasher): Likewise. * gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise. * haifa-sched.c (delay_i1_hasher): Likewise. * hard-reg-set.h (simplifiable_subregs_hasher): Likewise. * ipa-icf.h (congruence_class_group_hash): Likewise. * ipa-profile.c (histogram_hash): Likewise. * ira-color.c (allocno_hard_regs_hasher): Likewise. * lto-streamer.h (string_slot_hasher): Likewise. * lto-streamer.c (tree_entry_hasher): Likewise. * plugin.c (event_hasher): Likewise. * postreload-gcse.c (expr_hasher): Likewise. * store-motion.c (st_expr_hasher): Likewise. * tree-sra.c (uid_decl_hasher): Likewise. * tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise. (ssa_name_var_hash): Likewise. * tree-ssa-live.c (tree_int_map_hasher): Likewise. * tree-ssa-loop-im.c (mem_ref_hasher): Likewise. * tree-ssa-pre.c (pre_expr_d): Likewise. * tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise. * vtable-verify.h (registration_hasher): Likewise. * vtable-verify.c (vtbl_map_hasher): Likewise. * config/arm/arm.c (libcall_hasher): Likewise. * config/i386/winnt.c (wrapped_symbol_hasher): Likewise. * config/ia64/ia64.c (bundle_state_hasher): Likewise. * config/sol2.c (comdat_entry_hasher): Likewise. * fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash. (print_fold_checksum, fold_checksum_tree): Likewise. (debug_fold_checksum, fold_build1_stat_loc): Likewise. (fold_build2_stat_loc, fold_build3_stat_loc): Likewise. (fold_build_call_array_loc): Likewise. * tree-ssa-ccp.c (gimple_htab): Likewise. * tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash rather than pointer_type. gcc/c/ * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash instead of pointer_hash. (detect_field_duplicates): Likewise. gcc/cp/ * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash rather than pointer_hash. (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash. * semantics.c (nrv_data): Likewise. * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise. gcc/java/ * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/lto/ * lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/objc/ * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. libcc1/ * plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. (plugin_context): Use nofree_ptr_hash rather than pointer_hash. (plugin_context::mark): Likewise. From-SVN: r224957
2015-06-25 19:06:13 +02:00
struct bb_copy_hasher : nofree_ptr_hash <htab_bb_copy_original_entry>
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
{
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
static inline hashval_t hash (const htab_bb_copy_original_entry *);
static inline bool equal (const htab_bb_copy_original_entry *existing,
const htab_bb_copy_original_entry * candidate);
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
};
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
inline hashval_t
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
bb_copy_hasher::hash (const htab_bb_copy_original_entry *data)
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
{
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
return data->index1;
}
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
inline bool
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
bb_copy_hasher::equal (const htab_bb_copy_original_entry *data,
const htab_bb_copy_original_entry *data2)
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
{
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
return data->index1 == data2->index1;
}
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
/* Data structures used to maintain mapping between basic blocks and
copies. */
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
static hash_table<bb_copy_hasher> *bb_original;
static hash_table<bb_copy_hasher> *bb_copy;
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
/* And between loops and copies. */
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
static hash_table<bb_copy_hasher> *loop_copy;
Add new object_allocator and clean-up allocator usage. * c-format.c (static void check_format_info_main): Use object_allocator instead of pool_allocator. (check_format_arg): Likewise. (check_format_info_main): Likewise. * alloc-pool.h (object_allocator): Add new class. (pool_allocator::initialize): Use the underlying class. (pool_allocator::allocate): Likewise. (pool_allocator::remove): Likewise. (operator new): A new generic allocator. * asan.c (struct asan_mem_ref): Remove unused members. (asan_mem_ref_new): Replace new operator with object_allocator::allocate. (free_mem_ref_resources): Change deallocation. * cfg.c (initialize_original_copy_tables): Replace pool_allocator with object_allocator. * config/sh/sh.c (add_constant): Replace new operator with object_allocator::allocate. (sh_reorg): Change call to a release method. * cselib.c (struct elt_list): Remove unused members. (new_elt_list): Replace new operator with object_allocator::allocate. (new_elt_loc_list): Likewise. (new_cselib_val): Likewise. (unchain_one_elt_list): Change delete operator with remove method. (unchain_one_elt_loc_list): Likewise. (unchain_one_value): Likewise. (cselib_finish): Release newly added static allocators. * cselib.h (struct cselib_val): Remove unused members. (struct elt_loc_list): Likewise. * df-problems.c (df_chain_alloc): Replace pool_allocator with object_allocator. * df-scan.c (struct df_scan_problem_data): Likewise. (df_scan_alloc): Likewise. * df.h (struct dataflow): Likewise. * dse.c (struct read_info_type): Likewise. (struct insn_info_type): Likewise. (struct dse_bb_info_type): Likewise. (struct group_info): Likewise. (struct deferred_change): Likewise. (get_group_info): Likewise. (delete_dead_store_insn): Likewise. (free_read_records): Likewise. (replace_read): Likewise. (check_mem_read_rtx): Likewise. (scan_insn): Likewise. (dse_step1): Likewise. (dse_step7): Likewise. * et-forest.c (struct et_occ): Remove unused members. (et_new_occ): Use allocate instead of new operator. (et_new_tree): Likewise. (et_free_tree): Call release method explicitly. (et_free_tree_force): Likewise. (et_free_pools): Likewise. (et_split): Use remove instead of delete operator. * et-forest.h (struct et_node): Remove unused members. * ipa-cp.c: Change pool_allocator to object_allocator. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ira-build.c (initiate_cost_vectors): Cast return value. (ira_allocate_cost_vector): Likewise. * ira-color.c (struct update_cost_record): Remove unused members. * lra-int.h (struct lra_live_range): Likewise. (struct lra_copy): Likewise. (struct lra_insn_reg): Likewise. * lra-lives.c (lra_live_ranges_finish): Release new static allocator. * lra.c (new_insn_reg): Replace new operator with allocate method. (free_insn_regs): Same for operator delete. (finish_insn_regs): Release new static allocator. (finish_insn_recog_data): Likewise. (lra_free_copies): Replace delete operator with remove method. (lra_create_copy): Replace operator new with allocate method. (invalidate_insn_data_regno_info): Same for remove method. * regcprop.c (struct queued_debug_insn_change): Remove unused members. (free_debug_insn_changes): Replace delete operator with remove method. (replace_oldest_value_reg): Replace operator new with allocate method. (pass_cprop_hardreg::execute): Release new static variable. * sched-deps.c (sched_deps_init): Change pool_allocator to object_allocator. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * stmt.c (expand_case): Likewise. (expand_sjlj_dispatch_table): Likewise. * tree-sra.c (struct access): Remove unused members. (struct assign_link): Likewise. (sra_deinitialize): Release newly added static pools. (create_access_1):Replace operator new with allocate method. (build_accesses_from_assign): Likewise. (create_artificial_child_access): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Change pool_allocator to object_allocator. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c (allocate_vn_table): Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * var-tracking.c (onepart_pool_allocate): New function. (unshare_variable): Use the newly added function. (variable_merge_over_cur): Likewise. (variable_from_dropped): Likewise. (variable_was_changed): Likewise. (set_slot_part): Likewise. (emit_notes_for_differences_1): Likewise. (vt_finalize): Release newly added static pools. From-SVN: r225869
2015-07-16 13:26:05 +02:00
static object_allocator<htab_bb_copy_original_entry> *original_copy_bb_pool;
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
/* Initialize the data structures to maintain mapping between blocks
and its copies. */
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
void
initialize_original_copy_tables (void)
{
Add new object_allocator and clean-up allocator usage. * c-format.c (static void check_format_info_main): Use object_allocator instead of pool_allocator. (check_format_arg): Likewise. (check_format_info_main): Likewise. * alloc-pool.h (object_allocator): Add new class. (pool_allocator::initialize): Use the underlying class. (pool_allocator::allocate): Likewise. (pool_allocator::remove): Likewise. (operator new): A new generic allocator. * asan.c (struct asan_mem_ref): Remove unused members. (asan_mem_ref_new): Replace new operator with object_allocator::allocate. (free_mem_ref_resources): Change deallocation. * cfg.c (initialize_original_copy_tables): Replace pool_allocator with object_allocator. * config/sh/sh.c (add_constant): Replace new operator with object_allocator::allocate. (sh_reorg): Change call to a release method. * cselib.c (struct elt_list): Remove unused members. (new_elt_list): Replace new operator with object_allocator::allocate. (new_elt_loc_list): Likewise. (new_cselib_val): Likewise. (unchain_one_elt_list): Change delete operator with remove method. (unchain_one_elt_loc_list): Likewise. (unchain_one_value): Likewise. (cselib_finish): Release newly added static allocators. * cselib.h (struct cselib_val): Remove unused members. (struct elt_loc_list): Likewise. * df-problems.c (df_chain_alloc): Replace pool_allocator with object_allocator. * df-scan.c (struct df_scan_problem_data): Likewise. (df_scan_alloc): Likewise. * df.h (struct dataflow): Likewise. * dse.c (struct read_info_type): Likewise. (struct insn_info_type): Likewise. (struct dse_bb_info_type): Likewise. (struct group_info): Likewise. (struct deferred_change): Likewise. (get_group_info): Likewise. (delete_dead_store_insn): Likewise. (free_read_records): Likewise. (replace_read): Likewise. (check_mem_read_rtx): Likewise. (scan_insn): Likewise. (dse_step1): Likewise. (dse_step7): Likewise. * et-forest.c (struct et_occ): Remove unused members. (et_new_occ): Use allocate instead of new operator. (et_new_tree): Likewise. (et_free_tree): Call release method explicitly. (et_free_tree_force): Likewise. (et_free_pools): Likewise. (et_split): Use remove instead of delete operator. * et-forest.h (struct et_node): Remove unused members. * ipa-cp.c: Change pool_allocator to object_allocator. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ira-build.c (initiate_cost_vectors): Cast return value. (ira_allocate_cost_vector): Likewise. * ira-color.c (struct update_cost_record): Remove unused members. * lra-int.h (struct lra_live_range): Likewise. (struct lra_copy): Likewise. (struct lra_insn_reg): Likewise. * lra-lives.c (lra_live_ranges_finish): Release new static allocator. * lra.c (new_insn_reg): Replace new operator with allocate method. (free_insn_regs): Same for operator delete. (finish_insn_regs): Release new static allocator. (finish_insn_recog_data): Likewise. (lra_free_copies): Replace delete operator with remove method. (lra_create_copy): Replace operator new with allocate method. (invalidate_insn_data_regno_info): Same for remove method. * regcprop.c (struct queued_debug_insn_change): Remove unused members. (free_debug_insn_changes): Replace delete operator with remove method. (replace_oldest_value_reg): Replace operator new with allocate method. (pass_cprop_hardreg::execute): Release new static variable. * sched-deps.c (sched_deps_init): Change pool_allocator to object_allocator. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * stmt.c (expand_case): Likewise. (expand_sjlj_dispatch_table): Likewise. * tree-sra.c (struct access): Remove unused members. (struct assign_link): Likewise. (sra_deinitialize): Release newly added static pools. (create_access_1):Replace operator new with allocate method. (build_accesses_from_assign): Likewise. (create_artificial_child_access): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Change pool_allocator to object_allocator. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c (allocate_vn_table): Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * var-tracking.c (onepart_pool_allocate): New function. (unshare_variable): Use the newly added function. (variable_merge_over_cur): Likewise. (variable_from_dropped): Likewise. (variable_was_changed): Likewise. (set_slot_part): Likewise. (emit_notes_for_differences_1): Likewise. (vt_finalize): Release newly added static pools. From-SVN: r225869
2015-07-16 13:26:05 +02:00
original_copy_bb_pool = new object_allocator<htab_bb_copy_original_entry>
Share memory blocks between pool allocators gcc/ * Makefile.in: Add memory-block.cc (pool_allocator::initialize): Use fixed block size. (pool_allocator::release): Use memory_block_pool. (pool_allocator::allocate): Likewise. * asan.c (asan_mem_ref_pool): Adjust to use common block size in all object pools. * cfg.c (initialize_original_copy_tables): Likewise. * cselib.c (elt_list_pool, elt_loc_list_pool, cselib_val_pool): Likewise. * df-problems.c (df_chain_alloc): Likewise. * df-scan.c (df_scan_alloc): Likewise. * dse.c (cse_store_info_pool, rtx_store_info_pool, read_info_type_pool, insn_info_type_pool, bb_info_pool, group_info_pool, deferred_change_pool): Likewise. * et-forest.c (et_nodes, et_occurrences): Likewise. * ipa-cp.c (ipcp_cst_values_pool, ipcp_sources_pool, ipcp_agg_lattice_pool): Likewise. * ipa-inline-analysis.c (edge_predicate_pool): Likewise. * ipa-profile.c (histogram_pool): Likewise. * ipa-prop.c (ipa_refdesc_pool): Likewise. * ira-build.c (live_range_pool, allocno_pool, object_pool, initiate_cost_vectors, pref_pool, copy_pool): Likewise. * ira-color.c (update_cost_record_pool): Likewise. * lra-lives.c (lra_live_range_pool): Likewise. * lra.c (lra_insn_reg_pool, lra_copy_pool): Likewise. * memory-block.cc: New file. * memory-block.h: New file. * regcprop.c (queued_debug_insn_change_pool): Use common block size. * sched-deps.c (sched_deps_init): Likewise. * sel-sched-ir.c (sched_lists_pool): Likewise. * stmt.c (expand_case, expand_sjlj_dispatch_table): Likewise. * tree-sra.c (access_pool): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-pre.c (pre_expr_pool, bitmap_set_pool): Likewise. * tree-ssa-reassoc.c (operand_entry_pool): Likewise. * tree-ssa-sccvn.c (allocate_vn_table): Likewise. * tree-ssa-strlen.c (strinfo_pool): Likewise. * tree-ssa-structalias.c (variable_info_pool): Likewise. * var-tracking.c (attrs_def_pool, var_pool, valvar_pool, location_chain_pool, shared_hash_pool, loc_exp_dep_pool): Likewise. gcc/c-family/ * c-format.c (check_format_arg): Adjust to use common block size in all object pools. From-SVN: r227817
2015-09-16 02:56:54 +02:00
("original_copy");
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
bb_original = new hash_table<bb_copy_hasher> (10);
bb_copy = new hash_table<bb_copy_hasher> (10);
loop_copy = new hash_table<bb_copy_hasher> (10);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
}
/* Reset the data structures to maintain mapping between blocks and
its copies. */
void
reset_original_copy_tables (void)
{
gcc_assert (original_copy_bb_pool);
bb_original->empty ();
bb_copy->empty ();
loop_copy->empty ();
}
/* Free the data structures to maintain mapping between blocks and
its copies. */
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
void
free_original_copy_tables (void)
{
gcc_assert (original_copy_bb_pool);
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
delete bb_copy;
bb_copy = NULL;
delete bb_original;
bb_original = NULL;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
delete loop_copy;
loop_copy = NULL;
delete original_copy_bb_pool;
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
original_copy_bb_pool = NULL;
}
Add "__RTL" to cc1 gcc/c-family/ChangeLog: * c-common.c (c_common_reswords): Add "__RTL". * c-common.h (enum rid): Add RID_RTL. gcc/c/ChangeLog: * c-parser.c: Include "read-rtl-function.h" and "run-rtl-passes.h". (c_parser_declaration_or_fndef): Rename "gimple-pass-list" in grammar to gimple-or-rtl-pass-list. Add rtl-function-definition production. Update for renaming of field "gimple_pass" to "gimple_or_rtl_pass". If __RTL was seen, call c_parser_parse_rtl_body. Convert a timevar_push/pop pair to an auto_timevar, to cope with early exit. (c_parser_declspecs): Update RID_GIMPLE handling for renaming of field "gimple_pass" to "gimple_or_rtl_pass", and for renaming of c_parser_gimple_pass_list to c_parser_gimple_or_rtl_pass_list. Handle RID_RTL. (c_parser_parse_rtl_body): New function. * c-tree.h (enum c_declspec_word): Add cdw_rtl. (struct c_declspecs): Rename field "gimple_pass" to "gimple_or_rtl_pass". Add field "rtl_p". * gimple-parser.c (c_parser_gimple_pass_list): Rename to... (c_parser_gimple_or_rtl_pass_list): ...this, updating accordingly. * gimple-parser.h (c_parser_gimple_pass_list): Rename to... (c_parser_gimple_or_rtl_pass_list): ...this. gcc/ChangeLog: * cfg.c (original_copy_tables_initialized_p): New function. * cfg.h (original_copy_tables_initialized_p): New decl. * cfgrtl.c (relink_block_chain): Guard the call to free_original_copy_tables with a call to original_copy_tables_initialized_p. * cgraph.h (symtab_node::native_rtl_p): New decl. * cgraphunit.c (symtab_node::native_rtl_p): New function. (symtab_node::needed_p): Don't assert for early assembly output for __RTL functions. (cgraph_node::finalize_function): Set "force_output" for __RTL functions. (cgraph_node::analyze): Bail out early for __RTL functions. (analyze_functions): Update assertion to support __RTL functions. (cgraph_node::expand): Bail out early for __RTL functions. * final.c (rest_of_clean_state): Don't call delete_tree_ssa for __RTL functions. * function.h (struct function): Update comment for field "pass_startwith". * gimple-expr.c: Include "tree-pass.h". (gimple_has_body_p): Return false for __RTL functions. * Makefile.in (OBJS): Add run-rtl-passes.o. * pass_manager.h (gcc::pass_manager::get_rest_of_compilation): New accessor. (gcc::pass_manager::get_clean_slate): New accessor. * passes.c: Include "insn-addr.h". (should_skip_pass_p): Add logging. Update logic for running "expand" to be compatible with both __GIMPLE and __RTL. Guard property-provider override so it is only done for gimple passes. Don't skip dfinit. (skip_pass): New function. (execute_one_pass): Call skip_pass when skipping passes. * read-md.c (md_reader::read_char): Support filtering the input to a subset of line numbers. (md_reader::md_reader): Initialize fields m_first_line and m_last_line. (md_reader::read_file_fragment): New function. * read-md.h (md_reader::read_file_fragment): New decl. (md_reader::m_first_line): New field. (md_reader::m_last_line): New field. * read-rtl-function.c (function_reader::create_function): Only create cfun if it doesn't already exist. Set PROP_rtl on cfun's curr_properties. Set DECL_INITIAL to a dummy block. (read_rtl_function_body_from_file_range): New function. * read-rtl-function.h (read_rtl_function_body_from_file_range): New decl. * run-rtl-passes.c: New file. * run-rtl-passes.h: New file. gcc/testsuite/ChangeLog: * gcc.dg/rtl/aarch64/asr_div1.c: New test case. * gcc.dg/rtl/aarch64/pr71779.c: New test case. * gcc.dg/rtl/rtl.exp: New file. * gcc.dg/rtl/test.c: New file. * gcc.dg/rtl/truncated-rtl-file.c: New test case. * gcc.dg/rtl/unknown-rtx-code.c: New test case. * gcc.dg/rtl/x86_64/dfinit.c: New test case. * gcc.dg/rtl/x86_64/different-structs.c: New test case. * gcc.dg/rtl/x86_64/final.c: New test case. * gcc.dg/rtl/x86_64/into-cfglayout.c: New test case. * gcc.dg/rtl/x86_64/ira.c: New test case. * gcc.dg/rtl/x86_64/pro_and_epilogue.c: New test case. * gcc.dg/rtl/x86_64/test-multiple-fns.c: New test case. * gcc.dg/rtl/x86_64/test-return-const.c.after-expand.c: New test case. * gcc.dg/rtl/x86_64/test-return-const.c.before-fwprop.c: New test case. * gcc.dg/rtl/x86_64/test-rtl.c: New test case. * gcc.dg/rtl/x86_64/test_1.h: New file. * gcc.dg/rtl/x86_64/times-two.c.after-expand.c: New test case. * gcc.dg/rtl/x86_64/times-two.c.before-df.c: New test case. * gcc.dg/rtl/x86_64/times-two.h: New file. * gcc.dg/rtl/x86_64/vregs.c: New test case. From-SVN: r244878
2017-01-24 18:07:36 +01:00
/* Return true iff we have had a call to initialize_original_copy_tables
without a corresponding call to free_original_copy_tables. */
bool
original_copy_tables_initialized_p (void)
{
return original_copy_bb_pool != NULL;
}
/* Removes the value associated with OBJ from table TAB. */
static void
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
copy_original_table_clear (hash_table<bb_copy_hasher> *tab, unsigned obj)
{
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
htab_bb_copy_original_entry **slot;
struct htab_bb_copy_original_entry key, *elt;
if (!original_copy_bb_pool)
return;
key.index1 = obj;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
slot = tab->find_slot (&key, NO_INSERT);
if (!slot)
return;
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
elt = *slot;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
tab->clear_slot (slot);
original_copy_bb_pool->remove (elt);
}
/* Sets the value associated with OBJ in table TAB to VAL.
Do nothing when data structures are not initialized. */
static void
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
copy_original_table_set (hash_table<bb_copy_hasher> *tab,
Change more non-GTY hash tables to use the new type-safe template hash table. Constify member function parameters that can be const. Correct a couple of expressions in formerly uninstantiated templates. The new code is 0.362% faster in bootstrap, with a 99.5% confidence of being faster. Tested on x86-64. Index: gcc/java/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. (JCFDUMP_OBJS): Add dependence on hash-table.o. (jcf-io.o): Add dependence on hash-table.h. * jcf-io.c (memoized_class_lookups): Change to use type-safe hash table. Index: gcc/c/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (c-decl.o): Add dependence on hash-table.h. * c-decl.c (detect_field_duplicates_hash): Change to new type-safe hash table. Index: gcc/objc/ChangeLog 2012-10-01 Lawrence Crowl <crowl@google.com> * Make-lang.in (OBJC_OBJS): Add dependence on hash-table.o. (objc-act.o): Add dependence on hash-table.h. * objc-act.c (objc_detect_field_duplicates): Change to new type-safe hash table. Index: gcc/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Makefile.in (fold-const.o): Add depencence on hash-table.h. (dse.o): Likewise. (cfg.o): Likewise. * fold-const.c (fold_checksum_tree): Change to new type-safe hash table. * (print_fold_checksum): Likewise. * cfg.c (var bb_original): Likewise. * (var bb_copy): Likewise. * (var loop_copy): Likewise. * hash-table.h (template hash_table): Constify parameters for find... and remove_elt... member functions. (hash_table::empty) Correct size expression. (hash_table::clear_slot) Correct deleted entry assignment. * dse.c (var rtx_group_table): Change to new type-safe hash table. Index: gcc/cp/ChangeLog 2012-10-09 Lawrence Crowl <crowl@google.com> * Make-lang.in (class.o): Add dependence on hash-table.h. (tree.o): Likewise. (semantics.o): Likewise. * class.c (fixed_type_or_null): Change to new type-safe hash table. * tree.c (verify_stmt_tree): Likewise. (verify_stmt_tree_r): Likewise. * semantics.c (struct nrv_data): Likewise. From-SVN: r192273
2012-10-09 23:21:36 +02:00
unsigned obj, unsigned val)
{
struct htab_bb_copy_original_entry **slot;
struct htab_bb_copy_original_entry key;
if (!original_copy_bb_pool)
return;
key.index1 = obj;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
slot = tab->find_slot (&key, INSERT);
if (!*slot)
{
*slot = original_copy_bb_pool->allocate ();
(*slot)->index1 = obj;
}
(*slot)->index2 = val;
}
/* Set original for basic block. Do nothing when data structures are not
initialized so passes not needing this don't need to care. */
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
void
set_bb_original (basic_block bb, basic_block original)
{
copy_original_table_set (bb_original, bb->index, original->index);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
}
/* Get the original basic block. */
basic_block
get_bb_original (basic_block bb)
{
struct htab_bb_copy_original_entry *entry;
struct htab_bb_copy_original_entry key;
gcc_assert (original_copy_bb_pool);
key.index1 = bb->index;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
entry = bb_original->find (&key);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
if (entry)
Eliminate BASIC_BLOCK macro. gcc/ * basic-block.h (BASIC_BLOCK): Eliminate macro. * alias.c (init_alias_analysis): Eliminate BASIC_BLOCK macro in favor of uses of BASIC_BLOCK_FOR_FN, making uses of cfun explicit. * bt-load.c (compute_defs_uses_and_gen, compute_out, link_btr_uses, block_at_edge_of_live_range_p, migrate_btr_defs): Likewise. * caller-save.c (insert_one_insn): Likewise. * cfg.c (debug_bb, get_bb_original, get_bb_copy): Likewise. * cfgexpand.c (add_scope_conflicts): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloop.c (flow_loops_find): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * config/mips/mips.c (r10k_insert_cache_barriers): Likewise. * config/s390/s390.c (s390_optimize_nonescaping_tx): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * cse.c (cse_main): Likewise. * dce.c (fast_dce): Likewise. * df-core.c (df_set_blocks, df_worklist_propagate_forward, df_worklist_propagate_backward, df_worklist_dataflow_doublequeue, df_bb_replace, df_dump_region): Likewise. * df-problems.c (df_rd_bb_local_compute, df_lr_bb_local_compute, df_live_bb_local_compute, df_chain_remove_problem) df_chain_create_bb, df_word_lr_bb_local_compute, df_note_bb_compute, df_md_bb_local_compute, df_md_local_compute, df_md_transfer_function): Likewise. * df-scan.c (df_scan_blocks, df_reorganize_refs_by_reg_by_insn, df_reorganize_refs_by_insn, df_bb_refs_collect, df_record_entry_block_defs, df_update_entry_block_defs, df_record_exit_block_uses): Likewise. * dominance.c (nearest_common_dominator_for_set): Likewise. * gcse.c (hoist_code): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * ipa-inline-analysis.c (param_change_prob, estimate_function_body_sizes): Likewise. * ipa-split.c (dominated_by_forbidden): Likewise. * loop-unroll.c (apply_opt_in_copies): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * predict.c (propagate_freq): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_bb_compute_ri, regstat_bb_compute_calls_crossed): Likewise. * resource.c (mark_target_live_regs): Likewise. * sched-ebb.c (ebb_fix_recovery_cfg): Likewise. * sched-int.h (EBB_FIRST_BB, EBB_LAST_BB): Likewise. * sched-rgn.c (debug_region, dump_region_dot, too_large, haifa_find_rgns, extend_rgns, compute_dom_prob_ps, update_live, propagate_deps, sched_is_disabled_for_current_region_p): Likewise. * sched-vis.c (debug_bb_n_slim): Likewise. * sel-sched-ir.c (sel_finish_global_and_expr, verify_backedges, purge_empty_blocks, sel_remove_loop_preheader): Likewise. * sel-sched.c (remove_insns_that_need_bookkeeping) (current_region_empty_p, sel_region_init, simplify_changed_insns): Likewise. * trans-mem.c (execute_tm_mark, execute_tm_edges, tm_memopt_compute_antic, ipa_tm_scan_irr_function): Likewise. * tree-cfg.c (make_edges, end_recording_case_labels, label_to_block_fn, gimple_debug_bb, gimple_flow_call_edges_add, remove_edge_and_dominated_blocks, remove_edge_and_dominated_blocks, gimple_purge_all_dead_eh_edges, gimple_purge_all_dead_abnormal_call_edges): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call, split_bbs_on_noreturn_calls, cleanup_tree_cfg_1): Likewise. * tree-inline.c (copy_cfg_body, fold_marked_statements): Likewise. * tree-into-ssa.c (set_livein_block, prune_unused_phi_nodes, insert_phi_nodes_for, insert_updated_phi_nodes_for): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. * tree-ssa-live.c (live_worklist): Likewise. * tree-ssa-loop-manip.c (compute_live_loop_exits, add_exit_phis_var, find_uses_to_rename, copy_phi_node_args): Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-reassoc.c (update_range_test, optimize_range_tests): Likewise. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. * tree-ssa-tail-merge.c (same_succ_hash, same_succ_def::equal, same_succ_flush_bbs, update_worklist, set_cluster, same_phi_alternatives, find_clusters_1, apply_clusters, update_debug_stmts): Likewise. * tree-ssa-threadupdate.c (mark_threaded_blocks, thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * tree-vrp.c (find_assert_locations): Likewise. From-SVN: r205822
2013-12-09 21:09:29 +01:00
return BASIC_BLOCK_FOR_FN (cfun, entry->index2);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
else
return NULL;
}
/* Set copy for basic block. Do nothing when data structures are not
initialized so passes not needing this don't need to care. */
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
void
set_bb_copy (basic_block bb, basic_block copy)
{
copy_original_table_set (bb_copy, bb->index, copy->index);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
}
/* Get the copy of basic block. */
basic_block
get_bb_copy (basic_block bb)
{
struct htab_bb_copy_original_entry *entry;
struct htab_bb_copy_original_entry key;
gcc_assert (original_copy_bb_pool);
key.index1 = bb->index;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
entry = bb_copy->find (&key);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
if (entry)
Eliminate BASIC_BLOCK macro. gcc/ * basic-block.h (BASIC_BLOCK): Eliminate macro. * alias.c (init_alias_analysis): Eliminate BASIC_BLOCK macro in favor of uses of BASIC_BLOCK_FOR_FN, making uses of cfun explicit. * bt-load.c (compute_defs_uses_and_gen, compute_out, link_btr_uses, block_at_edge_of_live_range_p, migrate_btr_defs): Likewise. * caller-save.c (insert_one_insn): Likewise. * cfg.c (debug_bb, get_bb_original, get_bb_copy): Likewise. * cfgexpand.c (add_scope_conflicts): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloop.c (flow_loops_find): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * config/mips/mips.c (r10k_insert_cache_barriers): Likewise. * config/s390/s390.c (s390_optimize_nonescaping_tx): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * cse.c (cse_main): Likewise. * dce.c (fast_dce): Likewise. * df-core.c (df_set_blocks, df_worklist_propagate_forward, df_worklist_propagate_backward, df_worklist_dataflow_doublequeue, df_bb_replace, df_dump_region): Likewise. * df-problems.c (df_rd_bb_local_compute, df_lr_bb_local_compute, df_live_bb_local_compute, df_chain_remove_problem) df_chain_create_bb, df_word_lr_bb_local_compute, df_note_bb_compute, df_md_bb_local_compute, df_md_local_compute, df_md_transfer_function): Likewise. * df-scan.c (df_scan_blocks, df_reorganize_refs_by_reg_by_insn, df_reorganize_refs_by_insn, df_bb_refs_collect, df_record_entry_block_defs, df_update_entry_block_defs, df_record_exit_block_uses): Likewise. * dominance.c (nearest_common_dominator_for_set): Likewise. * gcse.c (hoist_code): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * ipa-inline-analysis.c (param_change_prob, estimate_function_body_sizes): Likewise. * ipa-split.c (dominated_by_forbidden): Likewise. * loop-unroll.c (apply_opt_in_copies): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c (lra_create_live_ranges): Likewise. * predict.c (propagate_freq): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_bb_compute_ri, regstat_bb_compute_calls_crossed): Likewise. * resource.c (mark_target_live_regs): Likewise. * sched-ebb.c (ebb_fix_recovery_cfg): Likewise. * sched-int.h (EBB_FIRST_BB, EBB_LAST_BB): Likewise. * sched-rgn.c (debug_region, dump_region_dot, too_large, haifa_find_rgns, extend_rgns, compute_dom_prob_ps, update_live, propagate_deps, sched_is_disabled_for_current_region_p): Likewise. * sched-vis.c (debug_bb_n_slim): Likewise. * sel-sched-ir.c (sel_finish_global_and_expr, verify_backedges, purge_empty_blocks, sel_remove_loop_preheader): Likewise. * sel-sched.c (remove_insns_that_need_bookkeeping) (current_region_empty_p, sel_region_init, simplify_changed_insns): Likewise. * trans-mem.c (execute_tm_mark, execute_tm_edges, tm_memopt_compute_antic, ipa_tm_scan_irr_function): Likewise. * tree-cfg.c (make_edges, end_recording_case_labels, label_to_block_fn, gimple_debug_bb, gimple_flow_call_edges_add, remove_edge_and_dominated_blocks, remove_edge_and_dominated_blocks, gimple_purge_all_dead_eh_edges, gimple_purge_all_dead_abnormal_call_edges): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call, split_bbs_on_noreturn_calls, cleanup_tree_cfg_1): Likewise. * tree-inline.c (copy_cfg_body, fold_marked_statements): Likewise. * tree-into-ssa.c (set_livein_block, prune_unused_phi_nodes, insert_phi_nodes_for, insert_updated_phi_nodes_for): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. * tree-ssa-live.c (live_worklist): Likewise. * tree-ssa-loop-manip.c (compute_live_loop_exits, add_exit_phis_var, find_uses_to_rename, copy_phi_node_args): Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-reassoc.c (update_range_test, optimize_range_tests): Likewise. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. * tree-ssa-tail-merge.c (same_succ_hash, same_succ_def::equal, same_succ_flush_bbs, update_worklist, set_cluster, same_phi_alternatives, find_clusters_1, apply_clusters, update_debug_stmts): Likewise. * tree-ssa-threadupdate.c (mark_threaded_blocks, thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise. * tree-vrp.c (find_assert_locations): Likewise. From-SVN: r205822
2013-12-09 21:09:29 +01:00
return BASIC_BLOCK_FOR_FN (cfun, entry->index2);
Makefile.in (cfg.o): Add new dependencies. * Makefile.in (cfg.o): Add new dependencies. * basic-block.h (reorder_block_def): Kill original/copy/duplicated/copy_number fields. (BB_DUPLICATED): New flag. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. * cfg.c: Include hashtab.h and alloc-pool.h (bb_original, bb_copy, original_copy_bb_pool): New static vars. (htab_bb_copy_original_entry): New struct. (bb_copy_original_hash, bb_copy_original_eq): New static functions. (initialize_original_copy_tables, free_original_copy_tables, set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New global functions. * cfghooks.c (duplicate_block): Update original/copy handling. * cfglayout.c (fixup_reorder_chain): Likewise. (cfg_layout_initialize): Initialize orignal_copy tables. (cfg_layout_finalize): FInalize original_copy tables. (can_copy_bbs_p): Use BB_DUPLICATED flag. (copy_bbs): Likewise. * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. (duplicate_loop_to_header_edge): Likewise; update handling of copy_number. (loop_version): Likewise. * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. * except.c (expand_resx_expr): Check that reg->resume is not set. * loop-unroll.c (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, apply_opt_in_copies): Update copy/original handling. * loop-unwitch.c (unswitch_loop): Likewise. * tree-cfg.c (create_bb): Do not initialize RBI. (disband_implicit_edges): Do not kill RBI. (add_phi_args_after_copy_bb): Use new original/copy mapping. (add_phi_args_after_copy): Use BB_DUPLICATED flag. (tree_duplicate_sese_region): Update original/copy handling. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. From-SVN: r101000
2005-06-16 01:05:23 +02:00
else
return NULL;
}
/* Set copy for LOOP to COPY. Do nothing when data structures are not
initialized so passes not needing this don't need to care. */
void
set_loop_copy (struct loop *loop, struct loop *copy)
{
if (!copy)
copy_original_table_clear (loop_copy, loop->num);
else
copy_original_table_set (loop_copy, loop->num, copy->num);
}
/* Get the copy of LOOP. */
struct loop *
get_loop_copy (struct loop *loop)
{
struct htab_bb_copy_original_entry *entry;
struct htab_bb_copy_original_entry key;
gcc_assert (original_copy_bb_pool);
key.index1 = loop->num;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
entry = loop_copy->find (&key);
if (entry)
function.h (loops_for_fn): New inline function. 2013-04-30 Richard Biener <rguenther@suse.de> * function.h (loops_for_fn): New inline function. (set_loops_for_fn): Likewise. * cfgloop.h (place_new_loop): Add struct function parameter. (get_loop): Likewise. (get_loops): Likewise. (number_of_loops): Likewise. (fel_next): Adjust. (fel_init): Likewise. * cfg.c (get_loop_copy): Adjust. * cfgloop.c (flow_loops_dump): Likewise. (record_loop_exits): Likewise. (verify_loop_structure): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (estimate_reg_pressure_cost): Likewise. (mark_loop_exit_edges): Likewise. * cfgloopmanip.c (place_new_loop): Likewise. (add_loop): Likewise. (duplicate_loop): Likewise. * graph.c (draw_cfg_nodes): Likewise. * graphite-clast-to-gimple.c (translate_clast_user): Likewise. * graphite-sese-to-poly.c (build_scop_scattering): Likewise. (extract_affine_chrec): Likewise. (build_scop_iteration_domain): Likewise. * graphite.c (graphite_initialize): Likewise. * ira-build.c (create_loop_tree_nodes): Likewise. (more_one_region_p): Likewise. (rebuild_regno_allocno_maps): Likewise. (mark_loops_for_removal): Likewise. (mark_all_loops_for_removal): Likewise. (remove_unnecessary_regions): Likewise. (ira_build): Likewise. * ira-emit.c (setup_entered_from_non_parent_p): Likewise. * loop-init.c (fix_loop_structure): Likewise. (gate_rtl_move_loop_invariants): Likewise. (gate_rtl_unswitch): Likewise. (gate_rtl_unroll_and_peel_loops): Likewise. (rtl_doloop): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * lto-streamer-out.c (output_cfg): Likewise. * modulo-sched.c (sms_schedule): Likewise. * predict.c (tree_estimate_probability): Likewise. (tree_estimate_probability_driver): Likewise. (estimate_loops): Likewise. * tree-cfg.c (fixup_loop_arrays_after_move): Likewise. (move_sese_region_to_fn): Likewise. (debug_loop_num): Likewise. * tree-chrec.c (chrec_evaluate): Likewise. (hide_evolution_in_other_loops_than_loop): Likewise. (chrec_component_in_loop_num): Likewise. (reset_evolution_in_loop): Likewise. (evolution_function_is_invariant_rec_p): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (copy_loops): Likewise. (copy_cfg_body): Likewise. (tree_function_versioning): Likewise. * tree-loop-distribution.c (rdg_flag_loop_exits): Likewise. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Likewise. (add_to_evolution_1): Likewise. (scev_const_prop): Likewise. * tree-scalar-evolution.h (get_chrec_loop): Likewise. * tree-ssa-loop-ch.c (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (analyze_memory_references): Likewise. (tree_ssa_lim_initialize): Likewise. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Likewise. (verify_loop_closed_ssa): Likewise. * tree-ssa-loop.c (tree_ssa_loop_init): Likewise. (tree_ssa_loop_im): Likewise. (tree_ssa_loop_unswitch): Likewise. (tree_vectorize): Likewise. (check_data_deps): Likewise. (tree_ssa_loop_ivcanon): Likewise. (tree_ssa_loop_bounds): Likewise. (tree_complete_unroll): Likewise. (tree_complete_unroll_inner): Likewise. (tree_parallelize_loops): Likewise. (tree_ssa_loop_prefetch): Likewise. (tree_ssa_loop_ivopts): Likewise. * tree-ssa.c (execute_update_addresses_taken): Liekwise. * tree-vectorizer.c (vectorize_loops): Likewise. From-SVN: r198441
2013-04-30 10:14:09 +02:00
return get_loop (cfun, entry->index2);
else
return NULL;
}