Commit Graph

60 Commits

Author SHA1 Message Date
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Caroline Tice 750054a2ee basic-block.h (struct edge_def): Add new field, crossing_edge.
2004-04-09  Caroline Tice  <ctice@apple.com>

        * basic-block.h (struct edge_def):  Add new field, crossing_edge.
        (struct basic_block_def):  Add new field, partition.
        (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION):  New constant macro
        definitions.
        (partition_hot_cold_basic_blocks): Add extern function
        declaration.
        * bb-reorder.c (function.h, obstack.h, expr.h, regs.h):  Add four new
        include statements.
        (N_ROUNDS): Increase the maximum number of rounds by 1.
        (branch_threshold): Add array value for new round.
        (exec_threshold): Add array value for new round.
        (push_to_next_round_p): New function.
        (add_unlikely_executed_notes): New function.
        (find_rarely_executed_basic_blocks_and_crossing_edges): New function.
        (mark_bb_for_unlikely_executed_section): New function.
        (add_labels_and_missing_jumps): New function.
        (add_reg_crossing_jump_notes): New function.
        (fix_up_fall_thru_edges): New function.
        (find_jump_block): New function.
        (fix_crossing_conditional_branches): New function.
        (fix_crossing_unconditional_branches): New function.
        (fix_edges_for_rarely_executed_code): New function.
        (partition_hot_cold_basic_blocks): New function.
        (find_traces):  Add an extra round for partitioning hot/cold
        basic blocks.
        (find_traces_1_round): Add a parameter.  Modify to push all cold blocks,
        and only cold blocks, into the last (extra) round of collecting traces.
        (better_edge_p): Add a parameter.  Modify to favor non-crossing edges
        over crossing edges.
        (bb_to_key):  Add code to correctly identify cold blocks when
        doing partitioning.
        (connect_traces): Modify to connect all the non-cold traces first, then
        go back and connect up all the cold traces.
        (reorder_basic_blocks):  Add call to add_unlikely_executed_notes.
        * cfg.c (entry_exit_blocks): Add initialization for partition field in
        entry and exit blocks.
        * cfgbuild.c (make_edges): Update current_function_has_computed_jump
        if we are doing hot/cold partitioning.
        * cfgcleanup.c (cfglayout.h): Add new include statement.
        (try_simplify_condjump): Modify to not attempt on blocks with jumps
        that cross section boundaries.
        (try_forward_edges): Likewise.
        (merge_blocks_move_predecessor_nojumps): Likewise.
        (merge_blocks_move_successor_nojumps): Likewise.
        (merge_blocks_move): Likewise.
        (try_crossjump_to_edge): Modify to not attempt after we have done
        the block partitioning.
        (try_crossjump_bb): Modify to not attempt on blocks with jumps that
        cross section boundaries.
        (try_optimize_cfg): Likewise.
        * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect
        jumps that cross section boundaries.
        * cfglayout.c (flags.h): Add new include statement.
        (update_unlikely_executed_notes):  New function.
        (fixup_reorder_chain):  Add code so when a new jumping basic block is
        added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are
        updated appropriately.
        (duplicate_insn_chain):  Add code to duplicate the new NOTE insn
        introduced by this optimization.
        * cfglayout.h (scan_ahead_for_unlikely_executed_note):  Add new
        extern function declaration.
        * cfgrtl.c (can_delete_note_p):  Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to
        list of notes that can be deleted.
        (create_basic_block_structure):  Add initialization for partition field.
        (rtl_can_merge_blocks):  Modify to test blocks for jumps that cross
        section boundaries.
        (try_redirect_by_replacing_jump):  Modify to not attempt on jumps that
        cross section boundaries.
        (commit_one_edge_insertion): Add code so newly created basic block
        ends up in correct (hot or cold) section.  Modify to disallow
        insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
        (rtl_verify_flow_info_1):  Add code to verify that no fall_thru edge
        crosses section boundaries.
        (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that
        cross section boundaries.
        (force_nonfallthru_and_redirect): Modify to make sure new basic block
        ends up in correct section, with correct notes attached.
        * common.opt (freorder-blocks-and-partition):  Add new flag for this
        optimization.
        * dbxout.c (dbx_function_end):  Add code to make sure scope labels at
        the end of functions are written into the correct (hot or cold)
        section.
        (dbx_source_file): Add code so writing debug file information
        doesn't incorrectly change sections.
        * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use
        in partitioning hot/cold basic blocks into separate sections.
        (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold
        section partitioning.
        (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not
        conditional branches can span all of memory.
        (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not
        unconditional branches can span all of memory.
        * final.c (scan_ahead_for_unlikely_executed_note):  New function.
        (final_scan_insn):  Add code to check for NOTE instruction indicating
        whether basic block belongs in hot or cold section, and to make sure
        the current basic block is being written to the appropriate section.
        Also added code to ensure that jump table basic blocks end up in the
        correct section.
        * flags.h (flag_reorder_blocks_and_partition):  New flag.
        * ifcvt.c (find_if_case_1):  Modify to not attempt if conversion if
        one of the branches has a jump that crosses between sections.
        (find_if_case_2): Likewise.
        (ifcvt): Modify to not attempt to mark loop exit edges after
        hot/cold partitioning has occurred.
        * opts.c (decode_options): Code to handle new flag,
        flag_reorder_blocks_and_partition; also to turn it off if
        flag_exceptions is on.
        (common_handle_option): Code to handle new flag,
        flag_reorder_blocks_and_partition.
        * output.h (unlikely_text_section): New extern function declaration.
        (in_unlikely_text_section): New extern function declaration.
        * passes.c (rest_of_handle_stack_regs):  Add
        flag_reorder_blocks_and_partition as an 'or' condition for calling
        reorder_basic_blocks.
        (rest_of_handle_reorder_blocks):  Add flag_reorder_blocks_and_partition
        as an 'or' condition for calling reorder_basic_blocks.
        (rest_of_compilation):  Add call to partition_hot_cold_basic_blocks.
        * print-rtl.c (print_rtx): Add code for handling new note,
        NOTE_INSN_UNLIKELY_EXECUTED_CODE
        * rtl.c  (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below).
        (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that
        cross between section boundaries.
        * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE):  New note instruction,
        indicating the basic block containing it belongs in the cold section.
        (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross
        between hot and cold sections.
        * toplev.c (flag_reorder_blocks_and_partition):  Add code to
        initialize this flag, and to tie it to the command-line option
        freorder-blocks-and-partition.
        * varasm.c (cfglayout.h):  Add new include statement.
        (unlikely_section_label_printed):  New global variable, used for
        determining when to output section name labels for cold sections.
        (in_section):  Add in_unlikely_executed_text to enum data structure.
        (text_section):  Modify code to use SECTION_FORMAT_STRING and
        NORMAL_TEXT_SECTION_NAME macros.
        (unlikely_text_section):  New function.
        (in_unlikely_text_section):  New function.
        (function_section):  Add code to make sure beginning of function is
        written into correct section (hot or cold).
        (assemble_start_function):  Add code to make sure stuff is written to
        the correct section.
        (assemble_zeros):  Add in_unlikely_text_section as an 'or' condition
        to an if statement that was checking 'in_text_section'.
        (assemble_variable):  Add 'in_unlikely_text_section' as an 'or'
        condition to an if statement that was checking 'in_text_section'.
        (default_section_type_flags_1):  Add check: if in cold section
        flags = SECTION_CODE.
        * config/darwin.c (darwin_asm_named_section):  Modify to use
        SECTION_FORMAT_STRING if we are partitioning hot/cold blocks.
        * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro
        specifically for the i386.
        (HAS_LONG_UNCOND_BRANCH):  Defined this macro specifically for the i386.
        * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change
        text string to something more informative.
        (NORMAL_TEXT_SECTION_NAME): Add new definition.
        (SECTION_FORMAT_STRING):  Add new definition.
        * config/rs6000/rs6000.c (rs6000_assemble_integer):  Add
        '!in_unlikely_text_section' as an 'and' condition to an if statement
        that was already checking '!in_text_section'.
        * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME,
        UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make
        sure these are properly defined for linux on ppc.
        * doc/invoke.texi  (freorder-blocks-and-partition): Add documentation
        for this new flag.
        * doc/rtl.texi (REG_CROSSING_JUMP):  Add documentation for new
        reg_note.
        * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING,
        HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for
        these new macros.

From-SVN: r80564
2004-04-09 12:57:47 -07:00
Zdenek Dvorak f470c378ac Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
* Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
	* basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb,
	verify_flow_info): Declaration removed.
	* cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c.
	(debug_bb, debug_bb_n): Add argument to dump_bb call.
	* cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge,
	try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block
	instead of delete_block.
	* cfghooks.c: Include timevar.h and toplev.h.
	(cfg_hooks): Define here.
	(verify_flow_info, dump_bb): Moved from cfg.c.
	(redirect_edge_and_branch, redirect_edge_and_branch_force,
	split_block, split_block_after_labels, move_block_after,
	delete_basic_block, split_edge, create_basic_block,
	create_empty_bb, can_merge_blocks_p, merge_blocks,
	make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges):
	New functions.
	* cfghooks.h (struct cfg_hooks): Added fields name,
	make_forwarder_block, tidy_fallthru_edge and
	move_block_after. Changed type of verify_flow_info, dump_bb,
	split_block fields. Renamed cfgh_split_edge and delete_block
	fields.
	(redirect_edge_and_branch, redirect_edge_and_branch_force,
	split_block, delete_block, split_edge, create_basic_block,
	can_merge_blocks_p, merge_blocks): Macros removed.
	(cfg_hooks): Do not export.
	(verify_flow_info, dump_bb, redirect_edge_and_branch,
	redirect_edge_and_branch_force, split_block, split_block_after_labels,
	move_block_after, delete_basic_block, split_edge, create_basic_block,
	create_empty_bb, can_merge_blocks_p, merge_blocks,
	make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges):
	Declare.
	(cfg_layout_rtl_cfg_hooks): Declare.
	* cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch):
	New functions.
	(canonicalize_loop_headers): Use new semantics of make_forwarder_block.
	(redirect_edge_with_latch_update): Removed.
	(make_forwarder_block): Moved to cfghooks.c, semantics changed.
	* cfgloopmanip.c (remove_bbs): Do not update dominators here.
	* cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb,
	rtl_delete_block, rtl_split_block, rtl_merge_blocks,
	tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block,
	cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to
	cfghooks.c.
	(rtl_create_basic_block): Coding style fix.
	(rtl_tidy_fallthru_edge, rtl_move_block_after,
	rtl_make_forwarder_block): New functions.
	(update_cfg_after_block_merging): Removed.
	(rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries.
	* flow.c (verify_wide_reg, verify_local_live_at_start): Add argument
	to dump_bb.
	* ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1,
	find_if_case_2): Don't update dominators.
	* timevar.def (TV_CFG_VERIFY): New.
	* loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info.
	* cfglayout.c (copy_bbs): Don't call add_to_dominance_info.
	* cfgloopmanip.c (split_loop_bb): Don't update dominators.
	(remove_bbs): Don't call remove_bbs.
	(create_preheader): Use make_forwarder_block.
	(mfb_keep_just, mfb_update_loops): New static functions.

From-SVN: r76851
2004-01-29 07:47:56 +00:00
Kazu Hirata d9221e016b alias.c, [...]: Update copyright.
* alias.c, basic-block.h, c-common.c, c-common.h,
	c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
	calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
	combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
	cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
	defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
	expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
	genautomata.c, genconditions.c, genemit.c, genflags.c,
	gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
	ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
	langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
	line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
	ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
	rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
	target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
	unwind.h, varray.c, varray.h: Update copyright.

From-SVN: r76302
2004-01-21 20:40:04 +00:00
Zdenek Dvorak 9405162eba * cfg.c (dump_bb): Dump entry edges.
From-SVN: r75806
2004-01-13 16:48:19 +00:00
Kazu Hirata 5d3cc25206 alias.c: Fix comment typos.
* alias.c: Fix comment typos.
	* builtins.c: Likewise.
	* cfg.c: Likewise.
	* df.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.c: Likewise.
	* genrecog.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-zone.c: Likewise.
	* integrate.c: Likewise.
	* local-alloc.c: Likewise.
	* loop.c: Likewise.
	* recog.c: Likewise.
	* regmove.c: Likewise.
	* reg-stack.c: Likewise.
	* reorg.c: Likewise.
	* rtlanal.c: Likewise.
	* rtl.h: Likewise.
	* sched-ebb.c: Likewise.
	* simplify-rtx.c: Likewise.
	* toplev.c: Likewise.
	* varasm.c: Likewise.

From-SVN: r75475
2004-01-06 16:51:21 +00:00
Steven Bosscher d47cc544b6 backport: et-forest.h (et_forest_create, [...]): Declarations removed.
Backport from tree-ssa (relevant changes only):
	2003-12-18  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

	* et-forest.h (et_forest_create, et_forest_delete,
	et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
	et_forest_remove_edge, et_forest_parent,
	et_forest_common_ancestor, et_forest_node_value,
	et_forest_enumerate_sons): Declarations removed.
	(struct et_node): New.
	(et_new_tree, et_free_tree, et_set_father, et_split, et_nca,
	et_below): Declare.
	* et-forest.c (struct et_forest_occurrence, struct et_forest,
	struct et_forest_node): Removed.
	(et_forest_create, et_forest_delete,
	et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
	et_forest_remove_edge, et_forest_parent,
	et_forest_common_ancestor, et_forest_node_value,
	et_forest_enumerate_sons, splay, remove_all_occurrences,
	find_leftmost_node, find_rightmost_node, calculate_value): Removed.
	(struct et_occ): New.
	(et_nodes, et_occurences): New.
	(set_depth, set_depth_add, set_prev, set_next, et_recomp_min,
	et_check_occ_sanity, et_check_sanity, et_check_tree_sanity,
	record_path_before_1, record_path_before, check_path_after_1,
	check_path_after, et_splay, et_new_occ, et_new_tree,
	et_free_tree, et_set_father, et_split, et_nca, et_below): New.
	* basic-block.h (struct basic_block_def): New field dom.
	(struct dominance_info): Type removed.
	(calculate_dominance_info, free_dominance_info,
	nearest_common_dominator, set_immediate_dominator,
	get_immediate_dominator, dominated_by_p, get_dominated_by,
	add_to_dominance_info, delete_from_dominance_info,
	recount_dominator, redirect_immediate_dominators,
	iterate_fix_dominators, verify_dominators): Declarations
	changed.
	(enum dom_state): New.
	(dom_computed): New variable.
	(first_dom_son, next_dom_son): Declare.
	* dominance.c (struct dominance_info): Removed.
	(BB_NODE, SET_BB_NODE): Removed.
	(calculate_dominance_info, free_dominance_info,
	nearest_common_dominator, set_immediate_dominator,
	get_immediate_dominator, dominated_by_p, get_dominated_by,
	add_to_dominance_info, delete_from_dominance_info,
	recount_dominator, redirect_immediate_dominators,
	iterate_fix_dominators, verify_dominators,
	debug_dominance_info): Work over new datastructure.  Access
	dominance datastructures through CFG.
	(assign_dfs_numbers, compute_dom_fast_query, first_dom_son,
	next_dom_son): New.
	* bt-load.c (dom): Variable removed.
	(augment_live_range, combine_btr_defs, migrate_btr_def,
	migrate_btr_defs, branch_target_load_optimize): Updated for the
	new interface for dominance information.
	* cfg.c {exit_entry_blocks): Update initializer.
	* cfglayout.c (copy_bbs): Removed loops argument. Updated for
	the new interface for dominance information.
	* cfglayout.h (copy_bbs): Declaration changed.
	* cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump,
	flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated
	for the new interface for dominance information.
	(flow_loop_scan): Loops argument removed.
	(flow_loops_free): Don't release dominators.
	* cfgloop.h (struct cfg): Dom field removed.
	(flow_loop_scan, loop_split_edge_with, simple_loop_p,
	just_once_each_iteration_p, split_loop_bb): Declaration changed.
	* cfgloopanal.c (simple_loop_exit_p, simple_increment,
	just_once_each_iteration_p, simple_loop_p): Remove loops argument.
	Updated for the new interface for dominance information.
	* cfgloopmanip.c (remove_bbs, find_path, create_preheader,
	split_loop_bb, loopify, duplicate_loop_to_header_edge,
	force_single_succ_latches, loop_split_edge_with): Ditto.
	* gcse.c (dominators): Variable removed.
	(free_code_hoist_mem, compute_code_hoist_data, hoist_code):
	Updated for the new interface for dominance information.
	* ifcvt.c (post_dominators): Variable removed.
	(mark_loop_exit_edges, merge_if_block, find_if_header,
	find_cond_trap, find_if_case_1, find_if_case_2, if_convert):
	Updated for the new interface for dominance information.
	* loop-init.c (rtl_loop_optimizer_init,
	rtl_loop_optimizer_finalize): Ditto.
	* loop-unroll.c (decide_peel_simple, decide_peel_once_rolling,
	decide_peel_completely, decide_unroll_stupid,
	decide_unroll_constant_iterations,
	decide_unroll_runtime_iterations): Loops argument removed.
	Updated for the new interface for dominance information.
	(unroll_and_peel_loops, peel_loops_completely,
	unroll_loop_runtime_iterations): Updated for the new interface for
	dominance information.
	* loop-unswitch.c (may_unswitch_on_p, unswitch_loops,
	unswitch_single_loop, unswitch_loop): Updated for the new
	interface for dominance information.
	* predict.c (process_note_predictions, process_note_prediction,
	estimate_probability, note_prediction_to_br_prob): Ditto.
	* sched-rgn.c (find_rgns, init_regions): Ditto.
	* toplev.c (rest_of_handle_branch_prob): Free the dominators.

From-SVN: r75226
2003-12-30 10:40:56 +00:00
Steven Bosscher a813c11120 basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11  Steven Bosscher  <steven@gcc.gnu.org>

	* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
	(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
	(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
	(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
	fields of a basic block.
	* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
	cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
	cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
	final.c, flow.c, function.c, gcse.c, global.c, graph.c,
	haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
	loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
	ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
	regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
	sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
	config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
	accessing the `head' and `end' fields of a basic block directly.

	* gengtype.c: Add missing piece from earlier patch.  Dunno what
	I was thinking...

From-SVN: r74520
2003-12-11 00:20:51 +00:00
Richard Henderson 7d8405cf15 * cfg.c (dump_flow_info): Skip register dump if reg_n_info null.
From-SVN: r71485
2003-09-17 16:45:59 -07:00
Zdenek Dvorak 4139675b40 * cfg.c (dump_edge_info): Add name of loop_exit edge flag.
From-SVN: r70442
2003-08-14 18:18:42 +00:00
Kaveh R. Ghazi 703ad42b4b alias.c [...]: Remove unnecessary casts.
* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
	postreload.c prefix.c print-tree.c protoize.c ra-build.c
	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
	casts.

From-SVN: r69587
2003-07-19 14:47:15 +00:00
Kazu Hirata 4d6922ee32 bt-load.c: Fix comment typos.
* bt-load.c: Fix comment typos.
	* c-incpath.c: Likewise.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* et-forest.h: Likewise.
	* expr.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* jump.c: Likewise.
	* langhooks.h: Likewise.
	* local-alloc.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* ra-build.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* rtl.def: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* simplify-rtx.c: Likewise.
	* ssa.c: Likewise.
	* tracer.c: Likewise.
	* tree.c: Likewise.

From-SVN: r68975
2003-07-05 15:17:36 +00:00
Jan Hubicka bc35512f09 basic-block.h (create_basic_block, [...]): Kill.
* basic-block.h (create_basic_block, merge_blocks_nomove): Kill.
	* cfgcleanup.c (merge_blocks): Rename to merge_blocks_move.
	(merge_blocks_move_predecessor_nojumps,
	 merge_blocks_move_successor_nojumps): Use merge_blocks.
	(try_optimize_cfg): Use merge_blocks_move.
	* cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block.
	(merge_blocks_nomove): Rename to rtl_merge_blocks.
	(cfg_layout_create_basic_block): New.
	(rtl_can_merge_blocks): New.
	(cfg_layout_split_block): Do not alloc aux by hand.
	* cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p,
	merge_blocks.
	(create_basic_block, can_merge_blocks_p, merge_blocks): New macros.
	* cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand.
	* cfgloopmanip.c (loop_split_edge_with): Likewise.
	* ifcvt.c (merge_if_block): Use merge_blocks_nomove.

	* basic-block.h (basic_block_def): Add field 'rbi'.
	* bb-reorder.c (find_traces, rotate_loop, mark_bb_visited,
	find_traces_1_round, copy_bb, connect_traces): Update use of rbi.
	* cfg.c (entry_exit_blocks): Add new field.
	* cfglayout.c: Include alloc-pool.h;
	(cfg_layout_pool): New.
	(record_effective_endpoints, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use
	of rbi.
	(cfg_layout_initialize_rbi): New function.
	(cfg_layout_initialize): Use it.
	(cfg_layout_finalize): Clear rbi fields.
	* cfglayout.h (RBI): Kill.
	(cfg_layout_initialize_rbi): Declare.
	* cfgloopmanip.c (copy_bbs): Use rbi.
	(record_exit_edges): Likewise.
	(duplicate_loop_to_header_edge): Likewise.
	* cfgrtl.c (cfg_layout_create_basic_block): Use
	cfg_layout_initialize_rbi.
	(cfg_layout_split_block): Use rbi.
	(cfg_layout_delete_block): Likewise.
	* loop-init.c (loop_optimizer_finalize): Likewise.
	* loop-unswitch.c (unswitch_loop): Likewise.
	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.

	* cfgrtl.c: Update comments.
	(try_redirect_by_replacing_jump): New argument.
	(redirect_branch_edge): Break out from ...
	(rtl_redirect_edge_and_branch): ... this one.
	(update_cfg_after_block_merging): Break out from ...
	(rtl_merge_blocks): ... this one.
	(cfg_layout_split_edge): New.
	(cfg_layout_merge_blocks): New.
	(cfg_layout_can_merge_blocks_p): New.
	(cfg_layout_redirect_edge_and_branch): Reorganize.
	(cfg_layout_rtl_cfg_hooks): Fill in.
	(cfg_layout_delete_block): Kill barriers.
	* cfganal.c (can_fallthru): Deal with exit blocks
	* cfglayout.c (cfg_layout_function_header): New function
	(record_effective_endpoints): Record function header.
	(fixup_reorder_chain): Fixup dead jumptables; place header

	* basic-block.h (CLEANUP_CFGLAYOUT): New flag.
	* bb-reorder.c (cfg_layout_initialize): Update call.
	* cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru
	edges in cfglayout mode.
	* cfglayout.c (cleanup_unconditional_jumps): Kill.
	(cfg_layout_initialize): Kill agrument loops; use cfgcleanup.
	* cfglayout.h (cfg_layout_initialize): Update prototype.
	* cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill.
	* cfgloopmanip.c (loop_split_edge_with): Use split_edge.
	* flow.c (propagate_block): Do not crash when basic block ends
	by first insn in the chain.
	* loop-init.c (loop_optimizer_init):  First enter cfglayout mode; later
	do loop discovery.
	* tracer.c (tracer): Update call of cfg_layout_initialize.

From-SVN: r68899
2003-07-03 18:40:29 +00:00
Andreas Jaeger d329e058f2 caller-save.c: Convert to ISO C90.
* caller-save.c: Convert to ISO C90.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.c: Likewise.
	* cfglayout.c: Likewise.
	* cfglayout.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmainip.c: Likewise.
	* cfgrtl.c: Likewise.

From-SVN: r68331
2003-06-22 17:03:27 +02:00
Jan Hubicka 10e9fecc62 i386.md (subsi_3_zext, [...]): Fix predicates.
* i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates.
	* i386.c (k8_avoid_jump_misspredicts): Fix debug output.

	* cfg.c (verify_flow_info): Move IL independent checks from cfgrtl here.
	(dump_bb): New based on old dump_bb in cfgrtl.c
	(debug_bb, debug_bb_n): Move the functions from cfgrtl.c here.
	* cfghooks.h (cfgh_verify_flow_info): Return status.
	* cfglayout.c (cfg_layout_finalize): Verify CFG correctness.
	* cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c
	(dump_bb): Remove generic parts.
	(rtl_verify_flow_info_1): Break out from rtl_verify_flow_info.
	(rtl_verify_flow_info): Only check things dependeing on linearized RTL.

	* i386-cmov1.c: Fix regular expression.
	* i386-cvt-1.c: Likewise.
	* i386-local.c: Likewise.
	* i386-local2.c: Likewise.
	* i386-mul.c: Likewise.
	* i386-ssetype-1.c: Likewise.
	* i386-ssetype-3.c: Likewise.
	* i386-ssetype-5.c: Likewise.

From-SVN: r67630
2003-06-08 14:50:18 +00:00
Richard Henderson 1722c2c871 basic-block.h (EDGE_SIBCALL): New.
* basic-block.h (EDGE_SIBCALL): New.
        (EDGE_ALL_FLAGS): Update.
        * cfg.c (dump_edge_info): Add sibcall name.
        * cfgbuild.c (make_edges): Use EDGE_SIBCALL.
        * cfgrtl.c (purge_dead_edges): Handle sibcalls.

From-SVN: r67602
2003-06-07 14:30:49 -07:00
Jan Hubicka 9ee634e345 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 09:24:26 +00:00
Michael Matz e0fd3e7af4 cfg.c (unchecked_make_edge): New.
* cfg.c (unchecked_make_edge): New.
        (cached_make_edge): Use it.
        * basic-block.h (unchecked_make_edge): Declare.
        * cfglayout.c (cfg_layout_duplicate_bb): Use it.

From-SVN: r64077
2003-03-10 12:59:12 +00:00
Zdenek Dvorak 35b0708052 basic-block.h (EDGE_IRREDUCIBLE_LOOP, [...]): New.
* basic-block.h (EDGE_IRREDUCIBLE_LOOP, EDGE_ALL_FLAGS): New.
	* cfg.c (dump_edge_info): Add EDGE_IRREDUCIBLE_LOOP flag dump.
	* cfgloop.c (flow_loop_free): Made global.
	(establish_preds): New static function.
	(flow_loop_tree_node_add): Handle subloops of added loop correctly.
	(get_loop_exit_edges): New.
	(verify_loop_structure): Verify EDGE_IRREDUCIBLE_LOOP flags.
	* cfgloop.h (flow_loop_free, get_loop_exit_edges, unloop): Declare.
	* cfgloopanal.c (mark_irreducible_loops): Mark edges in irreducible
	loops.
	* cfgloopmanip.c (loop_delete_branch_edge): Allow to test for
	removability of an edge.
	(fix_irreducible_loops): New static function.
	(find_path, remove_path): Add ability to remove enclosing loops.
	(unloop): New.
	(copy_bbs, duplicate_loop_to_header_edge): Use EDGE_IRREDUCIBLE_LOOP
	flags.
	* cfgrtl.c (verify_flow_info): Handle EDGE_IRREDUCIBLE_LOOP flag.
	* loop-unroll.c (peel_loops_completely): Do not duplicate loop if
	not neccessary.
	(decide_peel_completely, peel_loops_completely): Allow complete peeling
	of non-duplicable once rolling loops.
	* loop-unswitch.c (unswitch_loop): Update EDGE_IRREDUCIBLE_LOOP flags.

From-SVN: r63864
2003-03-05 22:05:18 +00:00
Daniel Berlin 0816bcd206 cfg.c (dump_flow_info): Add back accidently deleted line.
2003-02-07  Daniel Berlin  <dberlin@dberlin.org>

	* cfg.c (dump_flow_info): Add back accidently deleted line.

From-SVN: r62542
2003-02-07 21:22:07 +00:00
Kazu Hirata 95bd1dd72f alias.c: Fix comment typos.
* alias.c: Fix comment typos.
	* basic-block.h: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.h: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* convert.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.h: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarf2.h: Likewise.

From-SVN: r61462
2003-01-18 02:26:43 +00:00
Daniel Berlin f6cb56fa00 cfg.c: Include alloc-pool.h
2003-01-07  Daniel Berlin  <dberlin@dberlin.org>

	* cfg.c: Include alloc-pool.h
	(edge_pool): New pool.
	(bb_pool): New pool.
	(first_deleted_edge): Remove.
	(first_deleted_block): Remove.
	(init_flow): Alloc/free the pools.
	(free_edge): Use pools.
	(alloc_block): Ditto.
	(expunge_block): Ditto.
	(cached_make_edge): Ditto.

	* Makefile.in (cfg.o): Add alloc-pool.h dependency.

2003-01-07  Daniel Berlin  <dberlin@dberlin.org>

	* et-forest.c: Include alloc-pool.h.
	(struct et_forest): Add node_pool and occur_pool.
	(et_forest_create): Create the new pools.
	(et_forest_delete): Delete them.
	(et_forest_add_node): Allocate and free using pools.
	(et_forest_add_edge): Ditto.
	(et_forest_remove_node): Ditto.
	(et_forest_remove_edge): Ditto.

	* Makefile.in (et-forest.o): Add alloc-pool.h dependency.

From-SVN: r61001
2003-01-07 17:05:16 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Kazu Hirata 09da15320b c-decl.c: Fix a comment typo.
* c-decl.c: Fix a comment typo.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* c-typeck.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* flow.c: Likewise.
	* function.c: Likewise.
	* gcc.c: Likewise.
	* genautomata.c: Likewise.
	* integrate.c: Likewise.
	* loop.c: Likewise.
	* loop.h: Likewise.
	* output.h: Likewise.
	* profile.c: Likewise.
	* ra.h: Likewise.
	* reload1.c: Likewise.
	* reload.c: Likewise.
	* sched-rgn.c: Likewise.
	* stmt.c: Likewise.
	* tree.h: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r60085
2002-12-13 00:17:22 +00:00
John David Anglin f6318a2baf cfg.c (dump_flow_info): Use max_reg_num () to determine the largest pseudo register number plus 1.
* cfg.c (dump_flow_info): Use max_reg_num () to determine the largest
	pseudo register number plus 1.

From-SVN: r59669
2002-12-01 03:52:04 +00:00
Jan Hubicka 77abb5d87d cfg.c (redirect_edge_succ_nodup): Avoid overflows due to roundoff errors.
* cfg.c (redirect_edge_succ_nodup): Avoid overflows due to roundoff
	errors.

From-SVN: r56184
2002-08-10 18:00:54 +00:00
Zdenek Dvorak 2ecfd709c2 basic-block.h (struct basic_block_def): New field loop_father.
* basic-block.h (struct basic_block_def): New field loop_father.
	(BB_VISITED): New flag.
	(struct loop): New field pred, removed field shared.
	(struct loops): New field parray.
	(LOOP_EXITS_DOMS): Removed.
	(flow_loop_tree_node_add, flow_loop_tree_node_remove,
	flow_loop_nested_p, flow_bb_inside_loop_p, get_loop_body,
	dfs_enumerate_from, loop_preheader_edge, loop_latch_edge,
	add_bb_to_loop, remove_bb_from_loops, find_common_loop,
	verify_loop_structure): Declare.
	* cfg.c (entry_exit_blocks): Initialize loop_father field.
	* cfganal.c (dfs_enumerate_from): New function.
	* cfgloop.c (HEAVY_EDGE_RATIO): New constant.
	(flow_loop_entry_edges_find, flow_loop_exit_edges_find,
	flow_loop_nodes_find, flow_loop_level_compute, flow_loop_nested_p,
	flow_loop_dump, flow_loops_dump, flow_loops_free,
	flow_loop_tree_node_add, flow_loop_level_compute,
	flow_loops_level_compute, flow_loop_scan, flow_loops_update,
	flow_loop_outside_edge_p): Modified for new infrastructure.
	(make_forwarder_block, canonicalize_loop_headers, glb_enum_p,
	redirect_edge_with_latch_update, flow_loop_free): New static functions.
	(flow_loop_tree_node_remove, flow_bb_inside_loop_p,
	get_loop_body, add_bb_to_loop, remove_bb_from_loops,
	find_common_loop, verify_loop_structure, loop_latch_edge,
	loop_preheader_edge): New functions.
	(flow_loops_cfg_dump): Do not show dominators, as this information
	does not remain up to date long.
	(flow_loops_find): Store results in new format.
	* predict.c (propagate_freq, estimate_probability,
	estimate_loops_at_level, estimate_bb_frequencies): Use new loop
	infrastructure.

From-SVN: r54142
2002-06-01 09:24:41 +00:00
Richard Henderson 04653686e7 * cfg.c (dump_flow_info): Print bb->index, not i, for block number.
From-SVN: r53961
2002-05-28 12:58:15 -07:00
Zdenek Dvorak bf77398cef basic-block.h (last_basic_block): Declare.
* basic-block.h (last_basic_block): Declare.
	(expunge_block_nocompact): Declaration removed.
	(compact_blocks): Declare.
	* cfg.c (last_basic_block): New variable.
	(expunge_block_nocompact): Removed.
	(expunge_block): Do not compact basic blocks.
	(compact_blocks): New.
	* cfganal.c (flow_call_edges_add): Use the fact that bb indices no
	longer change.
	* cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Set
	last_basic_block.
	* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Do not change
	real positions of blocks.
	(delete_unreachable_blocks): Simplified -- quadratic behavior now
	cannot occur.
	(cleanup_cfg): Compact blocks.
	* cfgrtl.c (create_basic_block): Insert basic blocks to the end of
	basic_block_info varray.
	(flow_delete_block): Comment update.
	(back_edge_of_syntactic_loop_p): Modify position check code.
	(verify_flow_info): Update checking.
	* flow.c (calculate_global_regs_live): Use FOR_EACH_BB.
	* ifcvt.c (SET_ORIG_INDEX, ORIG_INDEX): Removed.
	(find_if_case_1, find_if_case_2, if_convert): Use the fact that bb
	indices no longer change.
	* lcm.c (optimize_mode_switching): Replace n_basic_blocks with
	last_basic_block.
	* predict.c (estimate_bb_frequencies): Remove unneccessary code.
	* profile.c (branch_prob): Compact blocks.
	* sched-rgn.c (find_rgns): Replace n_basic_blocks with
	last_basic_block.

From-SVN: r53957
2002-05-28 12:53:47 +00:00
Andreas Jaeger 291cc0febc * cfg.c (dump_flow_info): Remove extra argument to fprintf.
From-SVN: r53901
2002-05-26 21:05:53 +02:00
Zdenek Dvorak e0082a7265 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 19:23:51 +00:00
Jan Hubicka 0f72964f10 cfg.c (dump_flow_info): Print results of maybe_hot/probably_never_executed predicates.
* cfg.c (dump_flow_info): Print results of
	maybe_hot/probably_never_executed predicates.
	* toplev.c (open_dump_file): Print function frequency.

From-SVN: r53796
2002-05-23 17:46:46 +00:00
Kazu Hirata f87c27b4ab cfgbuild.c: Fix formatting.
* cfgbuild.c: Fix formatting.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgrtl.c: Likewise.

From-SVN: r53717
2002-05-22 01:27:34 +00:00
Zdenek Dvorak 918ed612a1 basic_block.h (struct basic_block_def): Added prev_bb and next_bb fields.
* basic_block.h (struct basic_block_def): Added prev_bb and next_bb
	fields.
	(FOR_BB_BETWEEN, FOR_ALL_BB, FOR_ALL_BB_REVERSE): New macros for
	traversing basic block chain.
	(create_basic_block_structure, create_basic_block): Declaration changed.
	(link_block, unlink_block): Declare.
	* cfg.c (entry_exit_blocks): Initialize new fields.
	(link_block, unlink_block): New.
	(expunge_block_nocompact): Unlink basic block.
	(dump_flow_info): Print prev_bb/next_bb fields.
	* cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Modified.
	* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Modified.
	* cfglayout.c (fixup_reorder_chain, cfg_layout_duplicate_bb): Modified.
	* cfgrtl.c (create_basic_block_structure, create_basic_block,
	split_block, force_nonfallthru_and_redirect, split_edge): Modified.
	(verify_flow_info): Check that list agrees with numbering.

From-SVN: r53642
2002-05-19 22:25:49 +00:00
Richard Henderson 0b17ab2f5b Revert "Basic block renumbering removal", and two followup patches.
From-SVN: r53537
2002-05-16 19:31:56 -07:00
Zdenek Dvorak 355e4ec445 Basic block renumbering removal.
From-SVN: r53522
2002-05-16 10:34:53 -07:00
Jan Hubicka 6c81a49011 i386.md (testsi to testqi spliters): New.
* i386.md (testsi to testqi spliters): New.

	2002-01-14  Josef Zlomek  <zlomek@matfyz.cz>

	cfg.c (dump_edge_info): added dumping of EDGE_CAN_FALLTHRU.

	Wed Jan  9 2002  Josef Zlomek  <zlomj9am@artax.karlin.mff.cuni.cz>

	* basic-block.h: New flag EDGE_CAN_FALLTHRU
	* cfganal.c (set_edge_can_fallthru_flag): New function; marks the edges
	that can be made fallthru.

	Mon Nov 12 16:25:53 CET 2001  Jan Hubicka  <jh@suse.cz>

	* cfglayout.c (cleanup_unconditional_jumps): New static function.
	(cfg_layout_initialize): Use it.

Co-Authored-By: Pavel Nejedly <bim@atrey.karlin.mff.cuni.cz>

From-SVN: r53383
2002-05-11 17:16:28 +00:00
Richard Henderson 6a58eee93d basic-block.h (flow_delete_block_noexpunge): Declare.
* basic-block.h (flow_delete_block_noexpunge): Declare.
	(expunge_block_nocompact): Declare.
	* cfg.c (expunge_block_nocompact): Split out from ...
	(expunge_block): ... here.
	* cfgrtl.c (can_delete_label_p): Don't use exception_handler_labels.
	(flow_delete_block_noexpunge): Split out from ...
	(flow_delete_block): ... here.
	* cfgcleanup.c (delete_unreachable_blocks): Compact while
	removing dead blocks.
	* except.c (exception_handler_labels): Remove.
	(exception_handler_label_map): New.
	(struct eh_region): Add aka member.
	(mark_ehl_map_entry, mark_ehl_map, free_region): New.
	(ehl_hash, ehl_eq, ehl_free, add_ehl_entry): New.
	(for_each_eh_label, for_each_eh_label_1): New.
	(init_eh): Register exception_handler_label_map.
	(free_eh_status): Use free_region.
	(find_exception_handler_labels): Use the map, not the list.
	(remove_exception_handler_label): Likewise.
	(maybe_remove_eh_handler): Likewise.
	(remove_eh_handler): Use the region aka bitmap.
	* except.h (exception_handler_labels): Remove.
	(for_each_eh_label): Declare.
	* jump.c (rebuild_jump_labels): Don't check exception_handler_labels.
	* loop.c (invalidate_loops_containing_label): New.
	(find_and_verify_loops): Use it.  Use for_each_eh_label.
	* sched-rgn.c (is_cfg_nonregular): Use
	current_function_has_exception_handlers.

From-SVN: r52100
2002-04-09 17:15:58 -07:00
Hans-Peter Nilsson a106c875ba * cfg.c (dump_flow_info): Guard against NULL regno_reg_rtx[i].
From-SVN: r51589
2002-03-30 00:40:53 +00:00
Andreas Jaeger d25558bee8 * cfg.c (dump_flow_info): Remove unused variable.
From-SVN: r50568
2002-03-11 12:10:44 +01:00
Jan Hubicka 5a1a3e5e4d cfg.c (dump_flow_info): Warn about profile mismatches.
* cfg.c (dump_flow_info): Warn about profile mismatches.
	* cfgrtl.c (verify_flow_info): Few aditional sanity checks.
	(purge_dead_edges): Remove REG_BR_PROB notes on simplejumps.

From-SVN: r50320
2002-03-05 17:34:16 +00:00
Jan Hubicka 38c1593d57 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 10:11:01 +00:00
Richard Kenner 4891442b1f * cfg.c, cfganal.c, cfgbuild.c: Reformatting and minor cleanups.
From-SVN: r48270
2001-12-22 10:51:07 -05:00
Richard Sandiford 9d083c8c16 * cfg.c: Fix typos and formatting in the introductory comment.
From-SVN: r47243
2001-11-21 16:02:09 +00:00
Joseph Myers eaec9b3d7e ChangeLog.2, [...]: Fix spelling errors.
* ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog.5, ChangeLog,
	cfg.c, cfganal.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgrtl.c,
	collect2.c, combine.c, config.in, configure, configure.in,
	conflict.c, dwarf2out.c, dwarfout.c, except.c, final.c, flow.c,
	genattrtab.c, ggc-page.c, jump.c, lcm.c, predict.c, reg-stack.c,
	reload1.c, rtlanal.c, sched-rgn.c, toplev.c, unwind-dw2-fde.h: Fix
	spelling errors.

From-SVN: r46928
2001-11-11 11:25:28 +00:00
Joseph Myers f5143c46a9 ChangeLog.2, [...]: Fix spelling errors.
* ChangeLog.2, ChangeLog.4, ChangeLog.5, ChangeLog,
	FSFChangeLog.10, FSFChangeLog.11, alias.c, attribs.c,
	caller-save.c, calls.c, cfg.c, cfganal.c, cfgcleanup.c, cfgrtl.c,
	cppmacro.c, fold-const.c, ifcvt.c, local-alloc.c, profile.c,
	sched-int.h, toplev.c, config/alpha/alpha.c,
	config/alpha/alpha.md, config/c4x/c4x.h, config/cris/cris.h,
	config/cris/cris.md, config/i370/i370.md, config/i386/i386.c,
	config/i386/i386.h, config/i386/i386.md, config/i386/xm-djgpp.h,
	config/ia64/ia64.c, config/m68hc11/m68hc11.c, config/m68k/m68k.md,
	config/mcore/mcore.h, config/mmix/mmix.c, config/ns32k/ns32k.h,
	config/ns32k/ns32k.md, config/rs6000/rs6000.c,
	config/rs6000/sysv4.h, config/sh/sh.md: Fix spelling errors.

From-SVN: r46760
2001-11-04 02:51:28 +00:00
Joseph Myers ff7cc30768 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
	ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11,
	c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc,
	configure, configure.in, except.c, except.h, flow.c, function.c,
	gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def,
	predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c,
	sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c,
	unroll.c: Fix spelling errors.

From-SVN: r46595
2001-10-28 20:09:17 +00:00
Joseph Myers f63d1bf775 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
	ChangeLog.5, ChangeLog, ChangeLog.lib, FSFChangeLog.10, ONEWS,
	c-common.c, caller-save.c, cfg.c, cfgcleanup.c, cfgrtl.c,
	collect2.c, df.h, diagnostic.h, final.c, gcse.c, gthr.h,
	haifa-sched.c, jump.c, local-alloc.c, profile.c, protoize.c,
	regmove.c, reload1.c, rtlanal.c, sched-vis.c, ssa.c, stmt.c,
	system.h, toplev.c: Fix spelling errors.

From-SVN: r46580
2001-10-28 12:42:06 +00:00
Richard Henderson 108c1afce2 cfg.c (clear_aux_for_blocks): Split out of ...
* cfg.c (clear_aux_for_blocks): Split out of ...
        (free_aux_for_blocks): here.
        (clear_aux_for_edges): Split from ...
        (free_aux_for_edges): here.
        * basic-block.h: Declare them.
        * lcm.c (compute_antinout_edge): Use them.
        (compute_laterin, compute_available, compute_nearerout): Likewise.
        (optimize_mode_switching): Likewise.

From-SVN: r46534
2001-10-26 00:49:34 -07:00
Jan Hubicka d39ac0fdc0 cfg.c (free_edge): Break out from ....
* cfg.c (free_edge): Break out from ....
	(remove_edge): ... here.
	(clear_edges): Use free_edge.

	* att.h (ASM_QUAD): Add comment.
	* bsd.h, sco5.h, sun386.h (ASM_QUAD): Define.

From-SVN: r46297
2001-10-16 22:24:16 +00:00