Commit Graph

175 Commits

Author SHA1 Message Date
Jan Hubicka a00d11f077 predict.c (tree_predict_edge): Don't drop useless predictions; check that it is not called too late in the game.
* predict.c (tree_predict_edge): Don't drop useless predictions;
	check that it is not called too late in the game.
	(gate_estimate_probability): New gate.
	(pass_profile): Gate.
	* tree-mudflap.c (mf_build_check_statement_for): Do not drop
	predictions; update CFG instead.
	* cfgrtl.c (rtl_verify_flow_info): Check that predcitions are consumed.

From-SVN: r100662
2005-06-06 12:31:35 +00:00
Steven Bosscher 610d24786d lcm.c: Move all mode-switching related functions from here...
* lcm.c: Move all mode-switching related functions from here...
	* mode-switching.c: ...to this new file.
	* doc/passes.texi: Update accordingly.

	* basic-block.h (label_value_list): Remove extern decl.
	* cfgrtl.c (label_value_list): Remove.
	(can_delete_label_p): Don't look at it.
	* cfgcleanup.c (cleanup_cfg): Don't free it.

	* common.opt: Don't refer to non-existing flag_alias_check.

From-SVN: r100591
2005-06-04 17:07:57 +00:00
Kazu Hirata 0fa2e4df47 c-common.c, [...]: Fix comment typos.
* c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h,
	cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c,
	ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c,
	tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c,
	tree-ssa-operands.c, tree-vect-analyze.c,
	tree-vect-transform.c, tree-vectorizer.c, tree.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/frv/frv.md, config/i386/i386.c, config/i386/sse.md,
	config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md,
	config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md,
	config/sh/ushmedia.h, config/sparc/sparc.c,
	config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos.
	Follow spelling conventions.

From-SVN: r100218
2005-05-26 18:15:27 +00:00
Daniel Berlin 2afa8dceda cfgrtl.c (purge_dead_edges): Don't remove fake edges.
2005-05-18  Daniel Berlin  <dberlin@dberlin.org>

	* cfgrtl.c (purge_dead_edges): Don't remove fake edges.

From-SVN: r99897
2005-05-18 13:29:38 +00:00
J"orn Rennecke 4c33cb26d4 re PR rtl-optimization/20413 (VOIDmode LABEL_REFs are generated)
2005-04-25  J"orn Rennecke <joern.rennecke@st.com>
	    Stephen Clarke <stevec@superh.com>
	    Roger Sayle <roger@eyesopen.com>

	PR rtl-optimization/20413
	* cfgrtl.c (redirect_edge_and_branch): Use Pmode instead of
	VOIDmode for LABEL_REF.
	* final.c (shorten_branches): Likewise.
	* jump.c (mark_all_labels, redirect_exp_1): Likewise.
	* loop.c (reg_dead_after_loop): Likewise.
	* varasm.c (decode_addr_const): Likewise.
	* doc/rtl.texi: Document mode requirement for LABEL_REF.

Co-Authored-By: Roger Sayle <roger@eyesopen.com>
Co-Authored-By: Stephen Clarke <stevec@superh.com>

From-SVN: r98711
2005-04-25 13:46:12 +01:00
Nathan Sidwell 41806d92af 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 15:47:33 +00:00
Nathan Sidwell d4e6fecb8f vec.h: Update API to separate allocation mechanism from type.
* vec.h: Update API to separate allocation mechanism from type.
	(VEC_safe_grow): New.
	* vec.c (calculate_allocation): New.
	(vec_gc_o_reserve, vec_heap_o_reserve): Adjust.
	(vec_gc_free, vec_heap_free): Remove.
	* gengtype-lex.l (DEF_VEC_): Process mult-argument macros.  Adjust.
	(VEC): Likewise.
	(mangle_macro_name): New.
	(struct macro_def): New.
	(struct macro): Add multiple argument values.
	(macro_expans_end): New.
	(push_macro_expansion):  Chain on new macro. Process multiple
	args, create follow on expansion. Return follow on argument.
	(macro_input): Deal with multiple arguments.

	* tree.h: Define VEC(tree,heap) and VEC(tree,gc).
	(struct tree_binfo): Adjust.
	* basic-block.h: Define VEC(edge,gc).
	(struct edge_def): Adjust.
	(struct basic_block_def, struct edge_iterator): Likewise.
	(ei_container, ei_start_1, ei_last_1): Likewise.
	* cfg.c (connect_src, connect_dest): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect)
	* dbxout.c (dbxout_type)
	* dwarf2out.c (gen_member_die)
	* lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc).
	(gcc_tree_to_linear_expression): Adjust.
	(gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest,
	lbv_to_gcc_expression, lle_to_gcc_expression,
	lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest,
	perfect_nestify): Likewise.
	* lambda.h (gcc_loopnest_to_lambda_loopnest,
	lambda_loopnest_to_gcc_loopnest): Adjust prototypes.
	* profile.c (instrument_values): Adjust.
	* tree-cfg.c (modified_noreturn_calls): Adjust.
	(remove_fallthru_edge): Likewise.
	* tree-dump.c (dequeue_and_dump): Adjust.
	* tree-flow-inline.h (mark_stmt_modified): Adjust.
	* tree-flow.h (modified_noreturn_calls): Adjust.
	(tree_on_heap): Remove. (yay!)
	(register_new_def): Adjust.
	* tree-into-ssa.c: Define VEC(int,heap).
	(block_defs_stack): Adjust.
	(find_idf, insert_phi_nodes, register_new_def,
	rewrite_initialize_block, rewrite_finalize_block,
	register_new_update_single, rewrite_update_init_block,
	rewrite_update_fini_block, rewrite_blocks,
	ssa_rewrite_finalize_block, ssa_register_new_def,
	ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise.
	* tree-loop-linear.c (linear_transform_loops): Adjust.
	* tree-ssa-alias.c: Define VEC(fieldoff_t,heap).
	(push_fields_onto_fieldstack, create_overlap_variables_for): Adjust.
	* tree-ssa-dom.c (avail_exprs_stack, block_defs_stack,
	stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack,
	vrp_variables_stack): Adjust declarations.
	(tree_ssa_dominator_optimize): Adjust.
	(dom_opt_initialize_block, remove_local_expressions_from_table,
	restore_nonzero_vars_to_original_value,
	restore_vars_to_original_value,
	restore_currdefs_to_original_value, dom_opt_finalize_block,
	record_var_is_nonzero, record_cond, record_const_or_copy_1,
	optimize_stmt, update_rhs_and_lookup_avail_expr,
	lookup_avail_expr, record_range): Likewise.
	* tree-ssa-pre.c: Define VEC(basic_block,heap).
	(compute_antic_aux): Adjust.
	(inserted_exprs, create_expression_by_pieces,
	insert_into_preds_of_block, eliminate, mark_operand_necessary,
	remove_dead_inserted_code, fini_pre): Likewise.
	* tree-ssa-propagate.c (interesting_ssa_edges): Adjust.
	(varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist.
	ssa_prop_init): Likewise.
	* tree-ssa.c: Define VEC(bitmap,heap).
	(verify_name_tags): Adjust.
	* value-prof.c (rtl_divmod_values_to_profile): Adjust.
	(insn_prefetch_values_to_profile, rtl_find_values_to_profile,
	tree_divmod_values_to_profile, tree_find_values_to_profile,
	value_profile_transformations): Likewise.
	* value-prof.h: Define VEC(histogram_value,heap).
	* varasm.c: Remove alias_pair pointer typedef, define
	VEC(alias_pair,gc).
	(finish_aliases_1, finish_aliases_2, assemble_alias): Adjust.

	* config/pa/pa.c (typedef extern_symbol): Typedef the structure,
	not a pointer to it.  Create an object vector.
	(extern_symbols): Turn into an object vector.
	(pa_hpux_asm_output_external, pa_hpux_file_end): Adjust.

	* cp/cp-tree.h: Adjust for new VEC API.
	Define VEC(tree_pair_s,gc).
	(struct save_scope): Adjust.
	(struct lang_type_class): Adjust.
	(unemitted_tinfo_decls): Adjust.
	* cp/class.c (add_method, resort_type_method_vec,
	finish_struct_methods, struct find_final_overrider_data,
	dfs_find_final_overrider_pre, find_final_overrider,
	get_vcall_index, warn_hidden, walk_subobject_offsets,
	check_methods, fixup_inline_methods, end_of_class,
	warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
	add_vcall_offset): Adjust.
	* cp/decl.c (xref_basetypes, finish_method): Adjust.
	* cp/decl2.c (check_classfn): Adjust.
	* cp/init.c (sort_mem_initializers, push_base_cleanups): Adjust.
	* cp/method.c (do_build_copy_constructor): Adjust.
	* cp/name-lookup.c (new_class_binding, store_binding,
	store_bindings, store_class_bindings): Adjust.
	* cp/name-lookup.h: Define VEC(cxx_saved_binding,gc),
	VEC(cp_class_binding,gc).
	(struct cp_binding_level): Adjust.
	* cp/parser.c: Define VEC(cp_token_position,heap).
	(struct cp_lexer): Adjust.
	(cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
	cp_lexer_save_tokens): Adjust.
	* cp/pt.c (retrieve_specialization,
	check_explicit_specialization): Adjust.
	* cp/rtti.c (unemitted_tinfo_decls): Adjust.
	(init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
	get_pseudo_ti_desc): Adjust.
	* cp/search.c (dfs_access_in_type, lookup_conversion_operator,
	lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
	dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
	* cp/semantics.c: Define VEC(deferred_access,gc).
	(push_deferring_access_checks): Adjust.
	* cp/typeck2.c (abstract_virtuals_error): Adjust.

From-SVN: r98498
2005-04-21 09:18:28 +00:00
Kazu Hirata 25cd19de2f cfgrtl.c (purge_all_dead_edge): Remove an unused argument.
* cfgrtl.c (purge_all_dead_edge): Remove an unused argument.
	* basic-block.h: Update the prototype for
	purge_all_dead_edges.
	* cfgexpand.c (tree_expand_cfg): Update a call to
	purge_all_dead_edges.
	* combine.c (combine_instructions): Likewise.
	* passes.c (rest_of_handle_old_regalloc, rest_of_handle_cse,
	rest_of_handle_cse2, rest_of_handle_gcse,
	rest_of_handle_postreload): likewise.

From-SVN: r98168
2005-04-15 03:16:20 +00:00
Steven Bosscher 997de8ed6b Makefile.in: Add function.h to BASIC_BLOCK_H.
* Makefile.in: Add function.h to BASIC_BLOCK_H.  Remove all
	references to gt-tree-cfg.h.
	* basic-block.h (struct basic_block_def): Don't skip rbi
	for garbage collection.
	(struct reorder_block_def): Make GTY-able.
	(struct control_flow_graph): New structure.
	(n_edges, n_basic_blocks, last_basic_block, basic_block_info,
	BASIC_BLOCK, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR): No longer vars,
	but instead defines to the control_flow_graph for cfun.
	(label_to_block_map): New define, points to the label map of
	the control_flow_graph for cfun.
	(n_edges_for_function, n_basic_blocks_for_function,
	last_basic_block_for_function, basic_block_info_for_function,
	EXIT_BLOCK_PTR_FOR_FUNCTION, ENTRY_BLOCK_PTR_FOR_FUNCTION,
	basic_block_info_for_function, label_to_block_map_for_function):
	Counterparts for the above, taking a struct function as an extra
	argument.
	(alloc_rbi_pool, free_rbi_pool): Remove prototypes.
	* cfg.c: (n_edges, n_basic_blocks, last_basic_block,
	basic_block_info, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Remove.
	(alloc_rbi_pool, free_rbi_pool): Remove.
	(initialize_bb_rbi): Use ggc_alloc_cleared instead of pool_alloc.
	* cfglayout.c: (cfg_layout_initialize): Don't allocate the rbi pool
	here...
	(cfg_layout_finalize) ... and don't free it here.
	* cfgrtl.c (cfg_layout_delete_block): Zero out rbi so it gets
	garbage collected.
	* flow.c (free_basic_block_vars): Set label_to_block_map and
	n_edges to zero too.
	* function.h (struct function): Add cfg field.
	* function.c (allocate_struct_function): Allocate the cfg.
	* tree-cfg.c (label_to_block_map): Remove.
	(build_tree_cfg): Don't allocate the rbi pool here...
	(delete_tree_cfg_annotations): ...and don't free it here.
	Also don't nullify label_to_block_map for cfun.

Co-Authored-By: Jan Hubicka <jh@suse.cz>
Co-Authored-By: Stuart Hastings <stuart@apple.com>

From-SVN: r98048
2005-04-12 21:33:53 +00:00
Kazu Hirata 315682fb36 cfghooks.c, [...]: Fix comment typos.
* cfghooks.c, cfgrtl.c, modulo-sched.c, config/i386/winnt.c:
	Fix comment typos.

From-SVN: r97490
2005-04-03 14:09:57 +00:00
Mostafa Hagog 1cb7dfc3b3 cfghooks.c (lv_flush_pending_stmts, [...]): New.
2005-03-30 Mostafa Hagog <mustafa@il.ibm.com>

        * cfghooks.c (lv_flush_pending_stmts,
        cfg_hook_duplicate_loop_to_header_edge, extract_cond_bb_edges,
        lv_adjust_loop_header_phi, lv_add_condition_to_bb): New.
        * cfghooks.h (cfg_hook_duplicate_loop_to_header_edge,
        lv_add_condition_to_bb,
        lv_adjust_loop_header_phi, extract_cond_bb_edges,
        flush_pending_stmts): New in cfg_hooks structure.
        (cfg_hook_duplicate_loop_to_header_edge, lv_flush_pending_stmts,
        extract_cond_bb_edges, lv_adjust_loop_header_phi,
        lv_add_condition_to_bb): New declarations.
        * cfgloop.h (duplicate_loop_to_header_edge): Change return type to
        bool.
        (loop_version): Declare.
        * cfgloopmanip.c (cfghooks.h): Include.
        (duplicate_loop_to_header_edge): Change return type to bool.
        (loop_version, lv_adjust_loop_entry_edge): Move here.
        * cfgrtl.c (cfgloop.h): Include.
        (rtl_verify_flow_info_1): Fix.
        (rtl_lv_add_condition_to_bb, rtl_extract_cond_bb_edges): New.
        (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add hooks to
        initialization.
        * tree-cfg.c (tree_lv_adjust_loop_header_phi,
        tree_lv_add_condition_to_bb): New.
        (tree_cfg_hooks): Add new hooks to initialization.
        * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi,
        lv_adjust_loop_entry_edge, tree_ssa_loop_version): Remove.

From-SVN: r97481
2005-04-03 08:44:33 +00:00
Caroline Tice 87c8b4bed3 Fix problems with hot/cold partitioning optimization.
From-SVN: r97322
2005-03-31 06:59:59 -08:00
Zdenek Dvorak c5cbcccf90 basic-block.h (single_succ_p, [...]): New inline functions.
* basic-block.h (single_succ_p, single_pred_p, single_succ_edge,
	single_pred_edge, single_succ, single_pred): New inline functions.
	* bb-reorder.c (rotate_loop, find_traces_1_round,
	add_labels_and_missing_jumps, fix_up_fall_thru_edges,
	duplicate_computed_gotos): Use the single_succ/pred functions.
	* cfganal.c (forwarder_block_p): Ditto.
	* cfgbuild.c (compute_outgoing_frequencies): Ditto.
	* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
	outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg,
	merge_seq_blocks): Ditto.
	* cfghooks.c (split_edge, tidy_fallthru_edges): Ditto.
	* cfglayout.c (fixup_reorder_chain): Ditto.
	* cfgloop.c (mark_single_exit_loops, update_latch_info,
	canonicalize_loop_headers, verify_loop_structure): Ditto.
	* cfgloopmanip.c (remove_path, unloop, loop_delete_branch_edge,
	mfb_update_loops, create_preheader, force_single_succ_latches,
	create_loop_notes): Ditto.
	* cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump,
	force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge,
	commit_one_edge_insertion, purge_dead_edges,
	cfg_layout_can_merge_blocks_p): Ditto.
	* except.c (sjlj_emit_function_enter): Ditto.
	* flow.c (init_propagate_block_info): Ditto.
	* function.c (thread_prologue_and_epilogue_insns): Ditto.
	* gcse.c (find_implicit_sets, bypass_conditional_jumps,
	insert_insn_end_bb): Ditto.
	* ifcvt.c (merge_if_block, find_if_block, find_if_case_1,
	find_if_case_2): Ditto.
	* lambda-code.c (perfect_nestify): Ditto.
	* lcm.c (optimize_mode_switching): Ditto.
	* loop-doloop.c (doloop_modify): Ditto.
	* loop-init.c (loop_optimizer_init): Ditto.
	* loop-iv.c (simplify_using_initial_values): Ditto.
	* loop-unroll.c (unroll_loop_runtime_iterations): Ditto.
	* loop-unswitch.c (unswitch_loop): Ditto.
	* modulo-sched.c (generate_prolog_epilog): Ditto.
	* predict.c (combine_predictions_for_insn, estimate_probability,
	tree_estimate_probability, last_basic_block_p,
	estimate_bb_frequencies): Ditto.
	* profile.c (branch_prob): Ditto.
	* regrename.c (copyprop_hardreg_forward): Ditto.
	* sched-rgn.c (is_cfg_nonregular, find_rgns, update_live): Ditto.
	* tracer.c (layout_superblocks): Ditto.
	* tree-cfg.c (tree_can_merge_blocks_p, tree_merge_blocks,
	cfg_remove_useless_stmts_bb, cleanup_control_flow,
	cleanup_control_expr_graph, disband_implicit_edges,
	tree_find_edge_insert_loc, bsi_commit_edge_inserts,
	tree_verify_flow_info, tree_make_forwarder_block,
	tree_forwarder_block_p, remove_forwarder_block,
	remove_forwarder_block_with_phi, merge_phi_nodes): Ditto.
	* tree-if-conv.c (tree_if_conversion): Ditto.
	* tree-mudflap.c (mf_build_check_statement_for): Ditto.
	* tree-ssa-dce.c (remove_dead_stmt): Ditto.
	* tree-ssa-dom.c (dom_opt_finalize_block): Ditto.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
	copy_loop_headers): Ditto.
	* tree-ssa-loop-im.c (loop_commit_inserts): Ditto.
	* tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Ditto.
	* tree-ssa-loop-manip.c (split_loop_exit_edge, ip_normal_pos,
	lv_adjust_loop_entry_edge, tree_ssa_loop_version): Ditto.
	* tree-ssa-loop-niter.c (simplify_using_initial_conditions): Ditto.
	* tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Ditto.
	* tree-ssa-phiopt.c (tree_ssa_phiopt, value_replacement): Ditto.
	* tree-ssa-pre.c (compute_antic_aux, insert_aux, init_pre): Ditto.
	* tree-ssa-threadupdate.c (redirect_edges): Ditto.
	* tree-tailcall.c (independent_of_stmt_p, find_tail_calls,
	eliminate_tail_call, tree_optimize_tail_calls_1): Ditto.
	* tree-vect-analyze.c (vect_analyze_loop_form): Ditto.
	* tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto.
	* tree-vectorizer.c (slpeel_update_phi_nodes_for_guard,
	slpeel_add_loop_guard): Ditto.

From-SVN: r96292
2005-03-11 09:05:12 +00:00
Kazu Hirata a9b2ee8872 * cfgrtl.c (cfg_layout_merge_blocks): Remove new_e.
From-SVN: r96163
2005-03-09 07:05:34 +00:00
Kazu Hirata 94eb5ddb83 cfgrtl.c (rtl_verify_flow_info_1): Remove local variable last_bb_seen.
* cfgrtl.c (rtl_verify_flow_info_1): Remove local variable
	last_bb_seen.

From-SVN: r96025
2005-03-07 15:16:03 +00:00
Kazu Hirata 12eff7b7bf cfgbuild.c (find_sub_basic_blocks): Remove.
* cfgbuild.c (find_sub_basic_blocks): Remove.
	* basic-block.h: Remove the corresponding prototype.
	* cfgexpand.c, cfgrtl.c: Don't mention find_sub_basic_blocks
	in comments.
	* doc/cfg.texi: Don't mention find_sub_basic_blocks.

From-SVN: r96016
2005-03-07 13:56:00 +00:00
Kazu Hirata 321cf1f25e calls.c (emit_call_1): Don't use REG_ALWAYS_RETURN.
* calls.c (emit_call_1): Don't use  REG_ALWAYS_RETURN.
	(emit_library_call_value_1): Don't use LCT_ALWAYS_RETURN and
	REG_ALWAYS_RETURN.
	* cfgrtl.c (need_fake_edge_p): Likewise.
	* combine.c (distribute_notes): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* recog.c (peephole2_opimize): Likewise.
	* reg-notes.def (ALWAYS_RETURN): Remove.
	* rtl.h (LCT_ALWAYS_RETURN): Remove.
	* tree-cfg.c (need_fake_edge_p): Don't use ECF_ALWAYS_RETURN.
	* tree.h (ECF_ALWAYS_RETURN): Remove.

From-SVN: r95690
2005-02-28 18:18:26 +00:00
Zdenek Dvorak af9ecd0ca0 re PR rtl-optimization/17428 (internal compiler error: in spill_failure, at reload1.c:1880 (-fspeculative-prefetching))
PR target/17428
	* cfgrtl.c (safe_insert_insn_on_edge): Avoid extending life range of hard
	registers.
	* value-prof.c (insn_prefetch_values_to_profile): Only scan normal insns.

	* value-prof.c (rtl_find_values_to_profile): Do not look for values to
	profile in libcalls.

From-SVN: r95007
2005-02-14 11:37:52 +00:00
Roger Sayle 4ab8006314 cfgrtl.c (rtl_delete_block): A basic block may be followed by more than one barrier...
* cfgrtl.c (rtl_delete_block): A basic block may be followed by
	more than one barrier, in which case we should delete them all.

From-SVN: r92996
2005-01-06 18:05:27 +00:00
Kazu Hirata 2085a21fd6 cfgrtl.c (rtl_verify_flow_info_1): Use JUMP_P instead of INSN_P.
* cfgrtl.c (rtl_verify_flow_info_1): Use JUMP_P instead of
	INSN_P.

From-SVN: r91677
2004-12-03 07:43:39 +00:00
Steven Bosscher 6be85b25c2 cfgcleanup.c (outgoing_edges_match, [...]): Remove CASE_DROPS_THROUGH checks, it is never defined.
* cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge):
	Remove CASE_DROPS_THROUGH checks, it is never defined.
	* cfglyout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (rtl_verify_flow_info): Likewise.
	* stmt.c (expand_case): Likewise.
	* cfgbuild.c (make_edges): Likewise.  Also remove force_fallthru,
	it is now always 0.
	* system.h (CASE_DROPS_THROUGH): Poison.
	* doc/md.texi (casesi): Remove documentation of CASE_DROPS_THROUGH.
	* doc/tm.texi (casesi): Remove documentation of CASE_DROPS_THROUGH.

	* config/v850/v850.h: Remove commented out CASE_DROPS_THROUGH.

From-SVN: r91488
2004-11-29 20:46:14 +00:00
Kazu Hirata afb7cf1807 cfgrtl.c (rtl_tidy_fallthru_edge): Speed up by using EDGE_COUNT.
* cfgrtl.c (rtl_tidy_fallthru_edge): Speed up by using
	EDGE_COUNT.

From-SVN: r91475
2004-11-29 17:58:27 +00:00
Kazu Hirata 03101c6f2b cfgrtl.c (cfg_layout_redirect_edge_and_branch): Speed up by simplifying edge manipulation.
* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Speed up by
	simplifying edge manipulation.

From-SVN: r91474
2004-11-29 17:56:19 +00:00
Kazu Hirata 6a66a8a7a2 cfgrtl.c (try_redirect_by_replacing_jump): Speed up the check that tests if all edges go to the same destination.
* cfgrtl.c (try_redirect_by_replacing_jump): Speed up the
	check that tests if all edges go to the same destination.

From-SVN: r91334
2004-11-26 06:54:13 +00:00
Nathan Sidwell 04389919a6 basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ...
* basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ...
	(ALLOC_REG_SET): ... here.
	(FREE_REG_SET): Adjust.
	(XMALLOC_REG_SET, XFREE_REG_SET): Remove.
	* bb-reorder.c (fix_crossing_conditional_branches): Adjust.
	* cfglayout.c (cfg_layout_duplicate_bb): Adjust.
	* cfgrtl.c (rtl_split_block, rtl_split_edge,
	safe_insert_insn_on_edge, cfg_layout_split_edge): Adjust.
	* flow.c (update_life_info, calculate_global_regs_live,
	allocate_bb_life_data, init_propagate_block_info): Adjust.
	* global.c (build_insn_chain): Adjust.
	* ifcvt.c (dead_or_predicable): Adjust.
	* loop-iv.c (simplify_using_initial_values): Adjust.
	* recog.c (peephole2_optimize): Adjust.
	* sched-deps.c (init_deps_global): Adjust.

From-SVN: r91279
2004-11-25 09:30:04 +00:00
Steven Bosscher f39e46bac1 cfgrtl.c (rtl_delete_block): Fix comment.
* cfgrtl.c (rtl_delete_block): Fix comment.
	* emit-rtl.c (remove_unnecessary_notes): Die if we see BLOCK_BEG
	or BLOCK_END insn notes.
	* jump.c (squeeze_notes): Likewise.
	* haifa-sched.c (reemit_notes): Don't "re-emit" EH_REGION_BEG and
	EH_REGION_END notes, we never have them to begin with.
	* sched-deps.c (sched_analyze_insn): When updating loop notes,
	verify that we have indeed only recorded loop notes.
	(sched_analyze): Die if we see EH_REGION_BEG or EH_REGION_END notes.
	Only record loop notes.

	* cfgexpand.c (tree_expand_cfg): Fix comment.

	* passes.c (rest_of_compilation): Don't do a second call to
	convert_from_eh_region_ranges from here, it's already called
	from cfgexpand.c.
	* except.c (resolve_fixup_regions): Remove.
	(remove_fixup_regions): Remove.
	(convert_from_eh_region_ranges_1): Remove.
	(convert_from_eh_region_ranges): Remove the case where EH is
	not already lowered at the tree level.  We always lower there.

From-SVN: r91148
2004-11-24 11:32:24 +00:00
Kazu Hirata d9d4706fa5 cfg.c (unchecked_make_edge): Call execute_on_growing_pred after making an edge.
* cfg.c (unchecked_make_edge): Call execute_on_growing_pred
	after making an edge.
	(remove_edge): Call execute_on_shrinking_pred before removing
	an edge.
	(redirect_edge_succ): Call execute_on_growing_pred and
	execute_on_shrinking_pred.
	* cfghooks.c (execute_on_growing_pred): New.
	(execute_on_shrinking_pred): Likewise.
	* cfghooks.h (cfg_hooks): Add execute_on_growing_pred and
	execute_on_shrinking_pred.
	Add prototypes for execute_on_growing_pred and
	execute_on_shrinking_pred.
	* cfgrtl.c (rtl_cfg_hooks): Add NULL hooks to
	execute_on_growing_pred and execute_on_shrinking_pred.
	(cfg_layout_rtl_cfg_hook): Likewise.
	* tree-cfg.c (tree_cfg_hooks): Likewise.

From-SVN: r91035
2004-11-22 22:04:21 +00:00
Jeff Law 9ff3d2dea0 cfg.c (cached_make_edge): Use find_edge rather than an inlined variant.
* cfg.c (cached_make_edge): Use find_edge rather than an inlined
        variant.
        * cfgbuild.c (make_edges): Likewise.
        * cfghooks.c (can_duplicate_block_p): Likewise.
        * cfgloop.c (loop_latch_edge): Likewise.
        * cfgloopmanip.c (force_single_succ_latches): Likewise.
        * cfgrtl.c (rtl_flow_call_edges_add): Likewise.
        * predict.c (predict_loops, propagate_freq): Likewise.
        * tracer.c (tail_duplicate): Likewise.
        * tree-cfg.c (disband_implicit_edges): Likewise.
        (tree_forwarder_block_p, tree_flow_call_edges_add): Likewise.

From-SVN: r91019
2004-11-22 10:14:00 -07:00
Nathan Sidwell 7932a3db21 bitmap.h (struct bitmap_obstack): New obstack type.
* bitmap.h (struct bitmap_obstack): New obstack type.
	(struct bitmap_head_def): Replace using_obstack with obstack
	pointer.
	(bitmap_default_obstack): New.
	(bitmap_initialize): Make inline, does not do allocation.
	(bitmap_release_memory): Remove.
	(bitmap_obstack_initialize, bitmap_obstack_release): Declare.
	(bitmap_obstack_alloc, bitmap_malloc_alloc, bitmap_gc_alloc,
	bitmap_obstack_free, bitmap_malloc_free): Declare.
	(BITMAP_OBSTACK_ALLOC, BITMAP_GGC_ALLOC, BITMAP_XMALLOC): Adjust.
	(BITMAP_FREE): Replace with ...
	(BITMAP_OBSTACK_FREE): ... this.
	(BITMAP_XFREE): Adjust.
	(BITMAP_INIT_ONCE): Remove.
	* bitmap.c (bitmap_obstack, bitmap_obstack_init, bitmap_free: Remove.
	(bitmap_default_obstack): New.
	(bitmap_elem_to_freelist): Adjust.
	(bitmap_element_allocate): Adjust. Break initialization into ...
	(bitmap_obstack_initialize): ... here.
	(bitmap_release_memory): Replace with ...
	(bitmap_obstack_release): ... this.
	(bitmap_obstack_alloc, bitmap_malloc_alloc, bitmap_gc_alloc,
	bitmap_obstack_free, bitmap_malloc_free): New.
	(bitmap_ior_and_compl, bitmap_ior_and_compl_into): Use
	bitmap_initialize.
	(bitmap_initialize): Move to bitmap.h.
	* gengtype.c (open_base_files): Add obstack.h to ifiles.
	* Makefile.in (BASIC_BLOCK_H, REGS_H): Add obstack.h.
	* basic-block.h (INIT_REG_SET): Allocate from reg_obstack.
	(INITIALIZE_REG_SET): Remove.
	(FREE_REG_SET): Use BITMAP_OBSTACK_FREE.
	(INIT_ONCE_REG_SET, MAX_REGNO_REG_SET): Remove.
	(flow_obstack): Do not declare.
	(reg_obstack): Declare.
	* regs.h: Include obstack.h.
	* tree-optimize.c (tree_rest_of_compilation): Initialize and
	release bitmap obstack here.
	* bb-reorder.c: #include regs, not basic-block.
	(fix_crossing_conditional_branches): Allocate regsets from
	reg_obstack.
	* bt-load.c: Do not inlude bitmap.h, sbitmap.h, basic-block.h or
	obstack.h.
	* caller-save.c: Include regs.h earlier.
	* cfg.c: Do not include basic-block.h or obstack.h.
	(reg_obstack): Define.
	* cfganal.c: Include obstack.h
	* cfgcleanyp.c: Do not include basic-block.h. Include regs.h
	earlier.
	* cfglayout.c: Do not include obstack.h.
	(flow_obstack): Remove declaration.
	(cfg_layout_duplicate_bb): Use reg_obstack.
	* cfgloop.c, cfgloopanal.c, cfgloopmanip.c: Include obstack.h.
	* cfgrtl.c (rtl_split_block): Use reg_obstack.
	(force_nonfallthru_and_redirect, rtl_split_edge): Likewise.
	(safe_insert_insn_on_edge): Use OBSTACK_ALLOC_REG_SET, adjust.
	(cfg_layout_split_edge): Use reg_obstack.
	* cse.c: Include regs.h earlier.
	* ddg.c: Do not include basic-block.h.
	* dominance.c: Inlude obstack.h.
	* flow.c (update_life_info): Use OBSTACK_ALLOC_REG_SET, adjust.
	(calculate_global_regs_live): Likewise.
	(allocate_bb_life_data): Use reg_obstack.
	(init_propagate_block_info): Use OBSTACK_ALLOC_REGSET.
	* global.c: Do not include basic-block.h.
	(build_insn_chain): Use OBSTACK_ALLOC_REG_SET, adjust.
	* graph.c: Include obstack.h.
	* haifa-sched.c: Do not include basic-block.h.
	* ifcvt.c: Use OBSTACK_ALLOC_REG_SET, adjust.
	* local-alloc.c: Do not include basic-block.h.
	* loop-init.c, loop-invariant.c: Include obstack.h.
	* loop-iv.c: Likewise.
	(simplify_using_initial_values): Use OBSTACK_ALLOC_REG_SET,
	adjust.
	* loop-unroll.c, loop-unswitch.c: Inlude obstack.h.
	* modulo-sched.c: Do not include basic-block.h.
	* passes.c (rest_of_handle_final): Do not call
	regset_release_memory.
	* ra-debug.c: Include regs.h earlier. Do not include
	basic-block.h.
	* recog.c (peephole2_optimize): Use OBSTACK_ALLOC_REG_SET, adjust.
	* regclass.c (init_reg_sets): Do not call INIT_ONCE_REG_SET.
	(allocate_reg_info): Do not call MAX_REGNO_REG_SET.
	(regset_release_memory): Remove.
	* resource.c: Do not include basic-block.h.
	* rtlanal.c: Do not include basic-block.h.
	* sbitmap.c: Include obstack.h.
	* sched-deps.c: Do not include basic-block.h.
	(reg_pending_sets_head, reg_pending_clobbers_head,
	reg_pending_uses_head): Remove.
	(init_deps_global): Use OBSTACK_ALLOC_REG_SET.
	* sched-ebb.c: Do not include basic-block.h.
	* sched-rgn.c: Likewise.
	* tree-if-conv.c (get_loop_body_in_if_conv_order): Use
	BITMAP_XFREE.
	* tree-outof-ssa.c (perform_edge_inserts): Use BITMAP_XFREE.
	* tree-sra.c (decide_instantiations): Adjust bitmap
	initialization.
	* tree-ssa-dce.c: Include obstack.h.
	* tree-ssa-pre.c (grand_bitmap_obstack): Make a bitmap_obstack.
	(value_insert_into_set_bitmap): Remove useless bitmap_clear.
	(bitmap_set_new): Likewise.
	(init_pre): Initialize bitmap obstack.
	(fini_pre): Release bitmap obstack.
	* tree-ssanames.c (ssa_names_to_rewrite): Make static.
	(marked_for_rewrite_p): ssa_names_to_rewrite is never NULL.
	(mark_for_rewrite, unmark_for_rewrite): Likewise.
	(marked_ssa_names): Likewise.
	(init_ssanames): Use BITMAP_XMALLOC.
	(fini_ssanames): Use BITMAP_XFREE.
	* web.c: Include obstack.h

From-SVN: r91009
2004-11-22 12:23:59 +00:00
Kazu Hirata 26cae194f7 cfgrtl.c (rtl_verify_flow_info): Don't use INSN_P when checking if an unconditional return is followed by a barrier.
* cfgrtl.c (rtl_verify_flow_info): Don't use INSN_P when
	checking if an unconditional return is followed by a barrier.

From-SVN: r90819
2004-11-17 21:55:07 +00:00
Kazu Hirata 4924302529 * cfgrtl.c: Fix a comment typo.
From-SVN: r90632
2004-11-14 21:25:37 +00:00
Kazu Hirata 9167e1c07f * cfgrtl.c (force_nonfallthru_and_redirect): Make it static.
From-SVN: r90088
2004-11-04 23:20:22 +00:00
Nathan Sidwell 3cd8c58a83 bitmap.c (bitmap_print): Make bitno unsigned.
* bitmap.c (bitmap_print): Make bitno unsigned.
	* bt-load.c (clear_btr_from_live_range,
	btr_def_live_range): Likewise.
	* caller-save.c (save_call_clobbered_regs): Likewise.
	* cfganal.c (compute_dominance_frontiers_1): Likewise.
	* cfgcleanup.c (thread_jump): Likewise.
	* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
	* conflict.c (conflict_graph_compute): Likewise.
	* ddg.c (add_deps_for_use): Likewise.
	* df.c (df_refs_update): Likewise.
	* except.c (remove_eh_handler): Likewise.
	* flow.c (verify_local_live_at_start, update_life_info,
	initialize_uninitialized_subregs, propagate_one_insn,
	free_propagate_block_info, propagate_block, find_use_as_address,
	reg_set_to_hard_reg_set): Likewise.
	* gcse.c (clear_modify_mem_tables): Likewise.
	* global.c (global_conflicts, build_insn_chain): Likewise.
	* ifcvt.c (dead_or_predicable): Likewise.
	* local-alloc.c (update_equiv_regs): Likewise.
	* loop.c (load_mems): Likewise.
	* ra-build.c (livethrough_conflicts_bb, conflicts_between_webs):
	Likewise.
	* ra-rewrite.c (reloads_to_loads, rewrite_program2, actual_spill):
	Likewise.
	* reload1.c (order_regs_for_reload, finish_spills): Likewise.
	* sched-deps.c (sched_analyze_insn, free_deps): Likewise.
	* sched-rgn.c (propagate_deps
	* tree-cfg.c (tree_purge_all_dead_eh_edges): Likewise.
	* tree-dfa.c (dump_dfa_stats
	tree-into-ssa.c (compute_global_livein, insert_phi_nodes,
	insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags):
	Likewise.
	* tree-outof-ssa.c (coalesce_ssa_name, coalesce_vars,
	free_temp_expr_table, find_replaceable_exprs): Likewise.
	* tree-sra.c (scan_function, scalarize_parms): Likewise.
	* tree-ssa-alias.c (init_alias_info,
	compute_points_to_and_addr_escape,
	compute_flow_sensitive_aliasing, maybe_create_global_var): Likewise.
	* tree-ssa-dce.c (mark_control_dependent_edges_necessary): Likewise.
	* tree-ssa-live.c (new_tree_live_info, live_worklist,
	calculate_live_on_entry, calculate_live_on_exit, compare_pairs,
	sort_coalesce_list, build_tree_conflict_graph, dump_live_info
	tree-ssa-loop-manip.c (add_exit_phis_var): Likewise.
	tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops,
	add_call_read_ops): Likewise.
	* tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Likewise.
	* tree-ssa-live.h (num_var_partitions): Return unsigned.

From-SVN: r90053
2004-11-04 08:41:16 +00:00
Nathan Sidwell eb59b8de04 bitmap.h (bitmap_empty_p): New.
* bitmap.h (bitmap_empty_p): New.
	(bitmap_and, bitmap_and_into, bitmap_and_compl,
	bitmap_and_compl_into, bitmap_ior, bitmap_ior_into,
	bitmap_ior_compl, bitmap_xor, bitmap_xor_into): New bitmap
	operation macros.
	(bitmap_ior_and_compl): Rename to ...
	(bitmap_ior_and_compl_into): ... here.
	* bitmap.c (bitmap_equal_p): Use bitmap_xor.
	(bitmap_ior_and_compl): Rename to ...
	(bitmap_ior_and_compl_into): ... here. Adjust. Return changed
	flag.
	(bitmap_union_of_diff): Use renamed bitmap functions.
	* basic-block.h (AND_REG_SET, AND_COMPL_REG_SET, IOR_REG_SET,
	XOR_REG_SET, IOR_AND_COMPL_REG_SET): Likewise.
	* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
	* df.c (df_bb_rd_local_compute)
	* flow.c (calculate_global_regs_live,
	init_propagate_block_info): Likewise.
	* ifcvt.c (find_if_case_1, find_if_case_2,
	dead_or_predicable): Likewise.
	* ra-build.c (union_web_part_roots, livethrough_conflicts_bb,
	reset_conflicts, conflicts_between_webs): Likewise.
	* ra-rewrite.c (reloads_to_loads, rewrite_program2,
	detect_web_parts_to_rebuild): Likewise.
	* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
	* tree-int-ssa.c (insert_phi_nodes_for, rewrite_into_ssa): Likewise.
	* tree-sra.c (decide_instantiations): Likewise.
	* tree-ssa-alias.c (create_name_tags,
	merge_pointed_to_info): Likewise.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
	* tree-ssa-loop-im.c (move_computations): Likewise.
	* tree-ssa-operands.c (get_call_expr_operands): Likewise.
	* tree-ssa-pre.c (fini_pre): Likewise.
	* tree-ssa.c (verify_flow_sensitive_alias_info): Likewise.
	* tree-ssanames.c (any_marked_for_rewrite_p): Likewise.
	* tree-vectorizer.c (vectorize_loops): Likewise.

From-SVN: r89827
2004-10-29 08:41:10 +00:00
Kazu Hirata 218d153705 cfg.c (unchecked_make_edge, [...]): Use VEC_safe_push instead of VEC_safe_insert.
* cfg.c (unchecked_make_edge, redirect_edge_succ,
	redirect_edge_pred): Use VEC_safe_push instead of
	VEC_safe_insert.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.

From-SVN: r89558
2004-10-25 21:48:26 +00:00
Ben Elliston 865851d0dc cfg.c (remove_edge): Use VEC_unordered_remove.
* cfg.c (remove_edge): Use VEC_unordered_remove.
	(redirect_edge_succ): Likewise.
	(redirect_edge_pred): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.

From-SVN: r89480
2004-10-23 08:55:47 +10:00
Hans-Peter Nilsson 9524880c99 cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb, don't inspect BLOCK_FOR_INSN for barriers.
* cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb,
	don't inspect BLOCK_FOR_INSN for barriers.
	* emit-rtl.c (emit_barrier_before): Revert last change.
	(emit_barrier_after, emit_barrier): Ditto.

From-SVN: r89308
2004-10-20 00:23:16 +00:00
Kazu Hirata a204196782 basic-block.h (reg_set_iterator): New.
* basic-block.h (reg_set_iterator): New.
	(EXECUTE_IF_SET_IN_REG_SET): Make it iterator style.
	(EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise.
	(EXECUTE_IF_AND_IN_REG_SET): Likewise.
	* caller-save.c (save_call_clobbered_regs): Adjust to the new
	style.
	* cfgcleanup.c (thread_jump): Likewise.
	* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
	* conflict.c (conflict_graph_compute): Likewise.
	* flow.c (verify_local_live_at_start, update_life_info,
	initialize_uninitialized_subregs, propagate_one_insn,
	init_propagate_block_info, free_propagate_block_info,
	propagate_block, dump_regset): Likewise.
	* global.c (global_conflicts): Likewise.
	* graph.c (start_bb): Likewise.
	* local-alloc.c (update_equiv_regs): Likewise.
	* loop.c (load_mems): Likewise.
	* reload1.c (compute_use_by_pseudos, order_regs_for_reload,
	find_reg, finish_spills): Likewise.
	* resource.c (mark_target_live_regs): Likewise.
	* sched-deps.c (sched_analyze_insn): Likewise.
	* sched-rgn.c (sched-rgn.c): Likewise.
	* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.

From-SVN: r89226
2004-10-18 15:11:31 +00:00
Hans-Peter Nilsson 0ca541aab9 cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb...
* cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb,
	handle barriers in a bb by checking that it points to a NULL bb.
	* emit-rtl.c (emit_barrier_before): Set BLOCK_FOR_INSN to NULL.
	(emit_barrier_after, emit_barrier): Ditto.

From-SVN: r89193
2004-10-18 01:56:03 +00:00
Jan Hubicka a710247903 re PR debug/13974 (bad line marker in debug info)
PR debug/13974
	* cfgrtl.c (try_redirect_by_replacing_jump,
	force_nonfallthru_and_redirect, commit_one_edge_insertion,
	cfg_layout_merge_blocks):  Do not attach any line number information
	to newly inserted instructions.
	* emit-rtl.c (emit_insn*_before, emit_insn*_after): Rename to
	emit_insn_*_noloc.
	(emit_*insn_before, emit_insn*_after): New.
	(emit_*insn_before_setloc, emit_*insn_after_setloc): Do not overwrite
	existing locators.
	* rtl.h (emit_*insn_before_noloc, emit_*insn_after_noloc): Declare.
	(emit_*insn_before_sameloc, emit_*insn_after_sameloc): Kill.

From-SVN: r88358
2004-09-30 21:25:52 +00:00
Ben Elliston 628f6a4e7c 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 17:59:54 +10:00
Jan Hubicka e53de54da3 cfgexpand.c (add_reg_br_prob_note): New function.
* cfgexpand.c (add_reg_br_prob_note): New function.
	(expand_gimple_cond_expr): Use it.
	(tree_expand_cfg): No longer kill the profile.
	* cfgrt.c (rtl_verify_flow_info_1): Check profile consistency
	only if it is present.
	* passes.c (rest_of_handle_loop_optimize): Kill the profile.
	* predict.c (combine_predictions_for_insn): Set the probabilities
	based on REG_BR_PROB note if present.
	* predict.c (branch_prob): Profile is read only with
	flag_branch_probabilities.

From-SVN: r87910
2004-09-23 00:50:37 +00:00
Caroline Tice 9beb1c849e Fix hot/cold partitioning problem.
2004-09-07  Caroline Tice  <ctice@apple.com>

        * cfgrtl.c (rtl_verify_flow_info_1):  Add new edge flag,
        EDGE_CROSSING, to flags test case.

From-SVN: r87149
2004-09-07 10:54:16 -07:00
Nathan Sidwell 341c100fc5 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 15:46:53 +00:00
Caroline Tice 8e8d51622f Add more details to hot/cold partitioning comments and documentation.
2004-08-25  Caroline Tice  <ctice@apple.com>

        * bb-reorder.c (partition_hot_cold_basic_blocks):  Add more details
        to comments at start of function.
        * cfgbuild.c (make_edges):  Add more details to hot/cold partitioning
        comment.
        * cfgcleanup.c (try_simplify_condjump, try_forward_edges,
        merge_blocks_move_predecessor_nojumps,
        merge_blocks_move_successor_nojumps, merge_blocks_move,
        try_crossjump_to_edge, try_crossjump_bb): Likewise.
        * cfglayout.c (fixup_reorder_chain): Likewise.
        * cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump,
        cfg_layout_can_merge_blocks_p):  Likewise.
        * ifcvt.c (find_if_case_1, find_if_case_2): Likewise.
        * passes.c (rest_of_compilation): Update comments for calling
        optimization that partitions hot/cold basic blocks.
        * doc/invoke.texi:  Update documentation of
        freorder-blocks-and-partition flag.

From-SVN: r86570
2004-08-25 12:52:54 -07:00
Paolo Bonzini 8b63d0e5c8 cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT.
2004-04-25  Paolo Bonzini  <bonzini@gnu.org>

	* cfglayout.c (duplicate_insn_chain): Remove references to
	NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT.
	* cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator.
	* cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT.
	* final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove.
	* jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop,
	check_dbra_loop, loop_dump_aux): Remove references to removed notes
	and fields.
	* reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs.
	* unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove
	references to removed notes and fields.
	(subtract_reg_term, ujump_to_loop_cont): Remove.

From-SVN: r86542
2004-08-25 08:20:11 +00:00
Zack Weinberg 076c7ab896 basic-block.h (struct basic_block_def): Reorder fields to eliminate interior padding.
* basic-block.h (struct basic_block_def): Reorder fields to
	eliminate interior padding.  Remove 'partition' field.
	(BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION)
	(BB_UNPARTITIONED, BB_PARTITION, BB_SET_PARTITION)
	(BB_COPY_PARTITION): New macros.
	* bb-reorder.c, cfgcleanup.c, cfglayout.c, cfgrtl.c, ifcvt.c
	Replace all references to the 'partition' field of a basic
	block with new macros.

	* insn-notes.def: Delete NOTE_INSN_DISABLE_SCHED_OF_BLOCK.
	* final.c (final_scan_insn): Don't handle it.
	* modulo-sched.c: Set BB_DISABLE_SCHEDULE flag on g->bb
	instead of emitting a NOTE_INSN_DISABLE_SCHED_OF_BLOCK note.
	* sched-rgn.c (sched_is_disabled_for_current_region_p):
	Look for a BB_DISABLE_SCHEDULE flag on the block instead of a note.

From-SVN: r86495
2004-08-24 16:46:32 +00:00
Steven Bosscher bd454efdcf basic-block.h (struct edge_def): Remove crossing_edge.
* basic-block.h (struct edge_def): Remove crossing_edge.
	(EDGE_CROSSING): New define.
	(EDGE_ALL_FLAGS): Update.
	* bb-reorder.c (find_traces_1_round, better_edge_p,
	find_rarely_executed_basic_blocks_and_cr, fix_up_fall_thru_edges,
	find_jump_block, fix_crossing_conditional_branches,
	fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
	Replace all occurences of crossing_edge with an edge flag check
	or set/reset.
	* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
	try_crossjump_bb): Likewise.
	* cfglayout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect,
	commit_one_edge_insertion): Likewise.

	* Makefile.in (cfganal.o): Depend on TIMEVAR_H.
	* tree-flow.h (compute_dominance_frontiers): Move prototype...
	* basic-block.h:  ...here.
	* tree-cfg.c (compute_dominance_frontiers_1,
	compute_dominance_frontiers): Move from here...
	* cfganal.c: ...to here.  Include timevar.h.

From-SVN: r86228
2004-08-19 00:32:41 +00:00
Caroline Tice 9fb3243411 Hot/cold partitioning update patch.
Hot/cold partitioning update patch.  The problems that this patch
attemptd to address/fix are:

- Fix places where adding in_unlikely_executed_text to the enum data
  type "in_section"  threw off switch case statements.
- Make it work correctly (by turning it off) for functions where user
  specifies "__attribute__ section"
- Make it work correctly (by turning it off) for linkonce sections
- Make it work correctly with -ffunction-sections flag
- Make it output correct cold section labels
- Undo some changes to original assembly code generation
- Turn off hot/cold partitioning in the presence of DWARF debugging (for
  the moment)
- Turn off hot/cold partitioning for architectures that do not support
  named sections
- Use variables rather than constants for cold section labels and names (to
  work correctly with -ffunction-sections, among other things)


2004-08-18  Caroline Tice  <ctice@apple.com>

        * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add
        "-freorder-blocks-and-partition" to the flags used in second
        stage of profiledbootstrap.
        * bb-reorder.c (push_to_next_round_p): Add new variable,
        next_round_is_last; set and use variable to make sure, when
        partitioning, that the last trace construction round consists
        of all (and only) cold basic blocks.
        (rotate_loop): Don't copy blocks that end in a section
        crossing jump.
        (copy_bb): Correctly initialize "partition" of duplicated bb.
        (add_unlikely_executed_notes): Add a comment.
        (find_rarely_executed_basic_blocks_and_crossing_edges): Modify
        to make sure, if function contains hot blocks, that the
        successors of ENTRY_BLOCK_PTR are hot; also, only look for
        crossing edges if the architecture supports named sections.
        (mark_bb_for_unlikely_executed_section): Modify to always
        insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after
        the basic block note insn.
        (fix_crossing_unconditional_branches): Remove extra space.
        (fix_edges_for_rarely_executed_code): Modify to only do
        partitioning work if the architecture supports named sections.
        (reorder_basic_blocks): Modify to only add
        NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture
        supports named sections.
        * c-common.c (handle_section_attribute): Initialize new global
        variable, user_defined_section_attribute, to true if user has
        specified one.
        * cfgcleanup.c (try_forward_edges): Modify to not attempt to
        forward edges that cross section boundaries.
        * cfglayout.c (fixup_reorder_chain): Modify to only fix up
        partitioning information if the architecture supports named
        sections.
        * cfgrtl.c (target.h): Add statement to include this.
        (rtl_split_block): Make sure newly created bb gets correct
        partition.
        (try_redirect_by_replacing_jump): Make sure redirection isn't
        attempting to cross section boundaries.
        (force_nonfallthru_and_redirect): Only do partition fix up if
        architecture supports named sections.
        (rtl_split_edge): Make sure newly created bb ends up in
        correct partition.
        (commit_one_edge_insertion): Remove code that incorrectly
        updated basic block partition; Make sure partition fix up only
        happens if architecture supports named sections and it's not
        already done.
        (rtl_verify_flow_info_1): Fix if-condition on test/error
        condition that fallthru edges are not allowed to cross section
        boundaries.
        * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this.
        * final.c (final_scan_insn): Remove redundant test from if-statement;
        change calls to text_section into calls to function_section; add code
        to only to partitioning fix up if architecture supports named
        sections.
        * ifcvt.c (find_if_case_1): Make sure newly created bb has correct
        partition.
        (if_convert): Add targetm.have_named_sections to test.
        * output.h (unlikely_section_label): Extern declaration for new global
        variable.
        (unlikely_text_section_name): Likewise.
        * opts.c (decode_options): If both partitioning and DWARF debugging
        are turned on, issue a warning that this doesn't work, and change
        partitiong to basic block reordering (without hot/cold partitions).
        * passes.c (rest_of_handle_final): Re-set new global variable,
        user_defined_section_attribute, to false.
        (rest_of_compilation): Change options for calling partitioning
        function: Don't call if the user defined the section attribute, and
        don't call if DECL_ONE_ONLY is true for the current function.
        * predict.c (choose_function_section): Return immediately if we
        are doing hot/cold partitioning (i.e. let the basic block partitioning
        determine where the function belongs).
        * reg-stack.c (emit_swap_insn): Add condition to step over
        NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
        * toplev.c (user_defined_section_attribute): New global variable.
        * toplev.h (user_defined_section_attribute): Extern declaration for new
        global variable.
        * varasm.c (unlikely_section_label): New global variable.
        (unlikely_text_section_name): New global variable.
        (unlikely_text_section): Add code to initialize unlikely_text_section_name
        if necessary; modify to use unlikely_text_section_name and
        unlikely_section_label; also to use named_section properly.
        (in_unlikely_text_section):  Modify to work correctly with named_section
        and to use unlikely_text_section_name.
        (named_section):  Add code to work properly with cold section.
        (function_section): Clean up if-statement.
        * config/darwin.c (darwin_asm_named_section): Return to original code,
        removing use of SECTION_FORMAT_STRING.
        * config/arm/pe.h (switch_to_section):  Add case for
        in_unlikely_executed_text to switch statement.
        * config/i386/cygming.h (switch_to_section): Likewise.
        * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.
        (SECTION_FORMAT_STRING): Likewise.
        * config/mcore/mcore.h (switch_to_section): Likewise.
        * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.

From-SVN: r86189
2004-08-18 09:22:08 -07:00
James E Wilson af87423702 Fix -fprofile-use ICE.
PR rtl-optimization/16490
* cfgrtl.c (cfg_layout_split_edge): Set global_live_at_start and
global_live_at_end for new basic block if already set for other blocks.

From-SVN: r85813
2004-08-11 13:08:00 -07:00