Commit Graph

57 Commits

Author SHA1 Message Date
Alexandre Oliva b5b8b0ac64 invoke.texi (-fvar-tracking-assignments): New.
gcc/ChangeLog:
* doc/invoke.texi (-fvar-tracking-assignments): New.
(-fvar-tracking-assignments-toggle): New.
(-fdump-final-insns=file): Mark filename as optional.
(--param min-nondebug-insn-uid): New.
(-gdwarf-@{version}): Mention version 4.
* opts.c (common_handle_option): Accept it.
* tree-vrp.c (find_assert_locations_1): Skip debug stmts.
* regrename.c (regrename_optimize): Drop last.  Don't count debug
insns as uses.  Don't reject change because of debug insn.
(do_replace): Reject DEBUG_INSN as chain starter.  Take base_regno
from the chain starter, and check for inexact matches in
DEBUG_INSNS.
(scan_rtx_reg): Accept inexact matches in DEBUG_INSNs.
(build_def_use): Simplify and fix the marking of DEBUG_INSNs.
* sched-ebb.c (schedule_ebbs): Skip boundary debug insns.
* fwprop.c (forward_propagate_and_simplify): ...into debug insns.
* doc/gimple.texi (is_gimple_debug): New.
(gimple_debug_bind_p): New.
(is_gimple_call, gimple_assign_cast_p): End sentence with period.
* doc/install.texi (bootstrap-debug): More details.
(bootstrap-debug-big, bootstrap-debug-lean): Document.
(bootstrap-debug-lib): More details.
(bootstrap-debug-ckovw): Update.
(bootstrap-time): New.
* tree-into-ssa.c (mark_def_sites): Skip debug stmts.
(insert_phi_nodes_for): Insert debug stmts.
(rewrite_stmt): Take iterator.  Insert debug stmts.
(rewrite_enter_block): Adjust.
(maybe_replace_use_in_debug_stmt): New.
(rewrite_update_stmt): Use it.
(mark_use_interesting): Return early for debug stmts.
* tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug
stmts before replacing stmt.
(move_computations_stmt): Likewise.
* ira-conflicts.c (add_copies): Skip debug insns.
* regstat.c (regstat_init_n_sets_and_refs): Discount debug insns.
(regstat_bb_compute_ri): Skip debug insns.
* tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_stmt): Skip debug stmts.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
* tree.h (MAY_HAVE_DEBUG_STMTS): New.
(build_var_debug_value_stat): Declare.
(build_var_debug_value): Define.
(target_for_debug_bind): Declare.
* reload.c (find_equiv_reg): Skip debug insns.
* rtlanal.c (reg_used_between_p): Skip debug insns.
(side_effects_p): Likewise.
(canonicalize_condition): Likewise.
* ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug
insns never depend on debug insns.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Use ANTI_DEP for debug insns.
Don't add inter-loop dependencies for debug insns.
(build_intra_loop_deps): Likewise.
(create_ddg): Count debug insns.
* ddg.h (struct ddg::num_debug): New.
(num_backargs): Pair up with previous int field.
* diagnostic.c (diagnostic_report_diagnostic): Skip notes on
-fcompare-debug-second.
* final.c (get_attr_length_1): Skip debug insns.
(rest_of_clean-state): Don't dump CFA_RESTORE_STATE.
* gcc.c (invoke_as): Call compare-debug-dump-opt.
(driver_self_specs): Map -fdump-final-insns to
-fdump-final-insns=..
(get_local_tick): New.
(compare_debug_dump_opt_spec_function): Test for . argument and
compute output name.  Compute temp output spec without flag name.
Compute -frandom-seed.
(OPT): Undef after use.
* cfgloopanal.c (num_loop_insns): Skip debug insns.
(average_num_loop_insns): Likewise.
* params.h (MIN_NONDEBUG_INSN_UID): New.
* gimple.def (GIMPLE_DEBUG): New.
* ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts.
* auto-inc-dec.c (merge_in_block): Skip debug insns.
(merge_in_block): Fix whitespace.
* toplev.c (flag_var_tracking): Update comment.
(flag_var_tracking_assignments): New.
(flag_var_tracking_assignments_toggle): New.
(process_options): Don't open final insns dump file if we're not
going to write to it.  Compute defaults for var_tracking.
* df-scan.c (df_insn_rescan_debug_internal): New.
(df_uses_record): Handle debug insns.
* haifa-sched.c (ready): Initialize n_debug.
(contributes_to_priority): Skip debug insns.
(dep_list_size): New.
(priority): Use it.
(rank_for_schedule): Likewise.  Schedule debug insns as soon as
they're ready.  Disregard previous debug insns to make decisions.
(queue_insn): Never queue debug insns.
(ready_add, ready_remove_first, ready_remove): Count debug insns.
(schedule_insn): Don't reject debug insns because of issue rate.
(get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns.
(queue_to_ready): Skip and discount debug insns.
(choose_ready): Let debug insns through.
(schedule_block): Check boundary debug insns.  Discount debug
insns, schedule them early.  Adjust whitespace.
(set_priorities): Check for boundary debug insns.
(add_jump_dependencies): Use dep_list_size.
(prev_non_location_insn): New.
(check_cfg): Use it.
* tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug
stmts.
(remove_unused_ivs): Reset debug stmts.
* modulo-sched.c (const_iteration_count): Skip debug insns.
(res_MII): Discount debug insns.
(loop_single_full_bb_p): Skip debug insns.
(sms_schedule): Likewise.
(sms_schedule_by_order): Likewise.
(ps_has_conflicts): Likewise.
* caller-save.c (refmarker_fn): New.
(save_call_clobbered_regs): Replace regs with saved mem in
debug insns.
(mark_referenced_regs): Take pointer, mark and arg.  Adjust.
Call refmarker_fn mark for hardregnos.
(mark_reg_as_referenced): New.
(replace_reg_with_saved_mem): New.
* ipa-pure-const.c (check_stmt): Skip debug stmts.
* cse.c (cse_insn): Canonicalize debug insns.  Skip them when
searching back.
(cse_extended_basic_block): Skip debug insns.
(count_reg_usage): Likewise.
(is_dead_reg): New, split out of...
(set_live_p): ... here.
(insn_live_p): Use it for debug insns.
* tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts.
(execute_optimize_stdarg): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Don't regard
changes in debug stmts as changes.
* sel-sched.c (moving_insn_creates_bookkeeping_block_p): New.
(moveup_expr): Don't move across debug insns.  Don't move
debug insn if it would create a bookkeeping block.
(moveup_expr_cached): Don't use cache for debug insns that
are heads of blocks.
(compute_av_set_inside_bb): Skip debug insns.
(sel_rank_for_schedule): Schedule debug insns first.  Remove
dead code.
(block_valid_for_bookkeeping_p); Support lax searches.
(create_block_for_bookkeeping): Adjust block numbers when
encountering debug-only blocks.
(find_place_for_bookkeeping): Deal with debug-only blocks.
(generate_bookkeeping_insn): Accept no place to insert.
(remove_temp_moveop_nops): New argument full_tidying.
(prepare_place_to_insert): Deal with debug insns.
(advance_state_on_fence): Debug insns don't start cycles.
(update_boundaries): Take fence as argument.  Deal with
debug insns.
(schedule_expr_on_boundary): No full_tidying on debug insns.
(fill_insns): Deal with debug insns.
(track_scheduled_insns_and_blocks): Don't count debug insns.
(need_nop_to_preserve_insn_bb): New, split out of...
(remove_insn_from_stream): ... this.
(fur_orig_expr_not_found): Skip debug insns.
* rtl.def (VALUE): Move up.
(DEBUG_INSN): New.
* tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug
stmts.
(nearest_common_dominator_of_uses): Take debug_stmts argument.
Set it if debug stmts are found.
(statement_sink_location): Skip debug stmts.  Propagate
moving defs into debug stmts.
* ifcvt.c (first_active_insn): Skip debug insns.
(last_active_insns): Likewise.
(cond_exec_process_insns): Likewise.
(noce_process_if_block): Likewise.
(check_cond_move_block): Likewise.
(cond_move_convert_if_block): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(dead_or_predicable): Likewise.
* dwarf2out.c (debug_str_hash_forced): New.
(find_AT_string): Add comment.
(gen_label_for_indirect_string): New.
(get_debug_string_label): New.
(AT_string_form): Use it.
(mem_loc_descriptor): Handle non-TLS symbols.  Handle MINUS , DIV,
MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING.  Accept but
discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and
several operations that cannot be represented with DWARF opcodes.
(loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND.  Require
dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value.
(dwarf2out_var_location): Take during-call mark into account.
(output_indirect_string): Update comment.  Output if there are
label and references.
(prune_indirect_string): New.
(prune_unused_types): Call it if debug_str_hash_forced.
More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>:
(dw_long_long_const): Remove.
(struct dw_val_struct): Change val_long_long type to rtx.
(print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for
val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair.
(output_die): Likewise.  Use HOST_BITS_PER_WIDE_INT size of each
component instead of HOST_BITS_PER_LONG.
(output_loc_operands): Likewise.   For const8* assert
HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64.
(output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT
rather than HOST_BITS_PER_LONG is >= 64.
(add_AT_long_long): Remove val_hi and val_lo arguments, add
val_const_double.
(size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of
HOST_BITS_PER_LONG for dw_val_class_long_long.
(add_const_value_attribute): Adjust add_AT_long_long caller.  Don't
handle TLS SYMBOL_REFs.  If CONST wraps a constant, tail recurse.
(dwarf_stack_op_name): Handle DW_OP_implicit_value and
DW_OP_stack_value.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_implicit_value.
(extract_int): Move prototype earlier.
(mem_loc_descriptor): For SUBREG punt if inner
mode size is wider than DWARF2_ADDR_SIZE.  Handle SIGN_EXTEND
and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}.  Handle
EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN,
UMAX, SIGN_EXTRACT, ZERO_EXTRACT.
(loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE
instead of Pmode size.
(loc_descriptor): Add MODE argument.  Handle CONST_INT, CONST_DOUBLE,
CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode,
attempt to handle other expressions.  Don't handle TLS SYMBOL_REFs.
(concat_loc_descriptor, concatn_loc_descriptor,
loc_descriptor_from_tree_1): Adjust loc_descriptor callers.
(add_location_or_const_value_attribute): Likewise.  For single
location loc_lists attempt to use add_const_value_attribute
for constant decls.  Add DW_AT_const_value even if
NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING
in its expression.
* cfgbuild.c (inside_basic_block_p): Handle debug insns.
(control_flow_insn_p): Likewise.
* tree-parloops.c (eliminate_local_variables_stmt): Handle debug
stmt.
(separate_decls_in_region_debug_bind): New.
(separate_decls_in_region): Process debug bind stmts afterwards.
* recog.c (verify_changes): Handle debug insns.
(extract_insn): Likewise.
(peephole2_optimize): Skip debug insns.
* dse.c (scan_insn): Skip debug insns.
* sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument.
Pass it on.
(setup_id_for_insn): Handle debug insns.
(maybe_tidy_empty_bb): Adjust whitespace.
(tidy_control_flow): Skip debug insns.
(sel_remove_insn): Adjust for debug insns.
(sel_estimate_number_of_insns): Skip debug insns.
(create_insn_rtx_from_pattern): Handle debug insns.
(create_copy_of_insn_rtx): Likewise.
* sel-sched-.h (sel_bb_end): Declare.
(sel_bb_empty_or_nop_p): New.
(get_all_loop_exits): Use it.
(_eligible_successor_edge_p): Likewise.
(return_nop_to_pool): Adjust.
* tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts.
* ira-lives.c (process_bb_node_lives): Skip debug insns.
* gimple-pretty-print.c (dump_gimple_debug): New.
(dump_gimple_stmt): Use it.
(dump_bb_header): Skip gimple debug stmts.
* regmove.c (optimize_reg_copy_1): Discount debug insns.
(fixup_match_2): Likewise.
(regmove_backward_pass): Likewise.  Simplify combined
replacement.  Handle debug insns.
* function.c (instantiate_virtual_regs): Handle debug insns.
* function.h (struct emit_status): Add x_cur_debug_insn_uid.
* print-rtl.h: Include cselib.h.
(print_rtx): Print VALUEs.  Split out and recurse for
VAR_LOCATIONs.
* df.h (df_inns_rescan_debug_internal): Declare.
* gcse.c (alloc_hash_table): Estimate n_insns.
(cprop_insn): Don't regard debug insns as changes.
(bypass_conditional_jumps): Skip debug insns.
(one_pre_gcse_pass): Adjust.
(one_code_hoisting_pass): Likewise.
(compute_ld_motion_mems): Skip debug insns.
(one_cprop_pass): Adjust.
* tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts.
(if_convertible_stmt_p): Handle debug stmts.
* init-regs.c (initialize_uninitialized_regs): Skip debug insns.
* tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts.
* ira-build.c (create_bb_allocnos): Skip debug insns.
* tree-flow-inline.h (has_zero_uses): Discount debug stmts.
(has_single_use): Likewise.
(single_imm_use): Likewise.
(num_imm_uses): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Skip debug stmts.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts.
(create_outofssa_var_map): Likewise.
* lower-subreg.c (adjust_decomposed_uses): New.
(resolve_debug): New.
(decompose_multiword_subregs): Use it.
* tree-dfa.c (find_referenced_vars): Skip debug stmts.
* emit-rtl.c: Include params.h.
(cur_debug_insn_uid): Define.
(set_new_first_and_last_insn): Set cur_debug_insn_uid too.
(copy_rtx_if_shared_1): Handle debug insns.
(reset_used_flags): Likewise.
(set_used_flags): LIkewise.
(get_max_insn_count): New.
(next_nondebug_insn): New.
(prev_nondebug_insn): New.
(make_debug_insn_raw): New.
(emit_insn_before_noloc): Handle debug insns.
(emit_jump_insn_before_noloc): Likewise.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): New.
(emit_insn_after_noloc): Handle debug insns.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_insn_after): Take loc from earlier non-debug insn.
(emit_jump_insn_after): Likewise.
(emit_call_insn_after): Likewise.
(emit_debug_insn_after_setloc): New.
(emit_debug_insn_after): New.
(emit_insn_before): Take loc from later non-debug insn.
(emit_jump_insn_before): Likewise.
(emit_call_insn_before): Likewise.
(emit_debug_insn_before_setloc): New.
(emit_debug_insn_before): New.
(emit_insn): Handle debug insns.
(emit_debug_insn): New.
(emit_jump_insn): Handle debug insns.
(emit_call_insn): Likewise.
(emit): Likewise.
(init_emit): Take min-nondebug-insn-uid into account.
Initialize cur_debug_insn_uid.
(emit_copy_of_insn_after): Handle debug insns.
* cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite
location of single rhs in place.
(maybe_dump_rtl_for_gimple_stmt): Dump lineno.
(floor_sdiv_adjust): New.
(cell_sdiv_adjust): New.
(cell_udiv_adjust): New.
(round_sdiv_adjust): New.
(round_udiv_adjust): New.
(wrap_constant): Moved from cselib.
(unwrap_constant): New.
(expand_debug_expr): New.
(expand_debug_locations): New.
(expand_gimple_basic_block): Drop hiding redeclaration.  Expand
debug bind stmts.
(gimple_expand_cfg): Expand debug locations.
* cselib.c: Include tree-pass.h.
(struct expand_value_data): New.
(cselib_record_sets_hook): New.
(PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New.
(cselib_clear_table): Move, and implemnet in terms of...
(cselib_reset_table_with_next_value): ... this.
(cselib_get_next_unknown_value): New.
(discard_useless_locs): Don't discard preserved values.
(cselib_preserve_value): New.
(cselib_preserved_value_p): New.
(cselib_preserve_definitely): New.
(cselib_clear_preserve): New.
(cselib_preserve_only_values): New.
(new_cselib_val): Take rtx argument.  Dump it in details.
(cselib_lookup_mem): Adjust.
(expand_loc): Take regs_active in struct.  Adjust.  Silence
dumps unless details are requested.
(cselib_expand_value_rtx_cb): New.
(cselib_expand_value_rtx): Rename and reimplment in terms of...
(cselib_expand_value_rtx_1): ... this.  Adjust.  Silence dumps
without details.  Copy more subregs.  Try to resolve values
using a callback.  Wrap constants.
(cselib_subst_to_values): Adjust.
(cselib_log_lookup): New.
(cselib_lookup): Call it.
(cselib_invalidate_regno): Don't count preserved values as
useless.
(cselib_invalidate_mem): Likewise.
(cselib_record_set): Likewise.
(struct set): Renamed to cselib_set, moved to cselib.h.
(cselib_record_sets): Adjust.  Call hook.
(cselib_process_insn): Reset table when it would be cleared.
(dump_cselib_val): New.
(dump_cselib_table): New.
* tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts.
(remove_forwarder_block): Support moving debug stmts.
* cselib.h (cselib_record_sets_hook): Declare.
(cselib_expand_callback): New type.
(cselib_expand_value_rtx_cb): Declare.
(cselib_reset_table_with_next_value): Declare.
(cselib_get_next_unknown_value): Declare.
(cselib_preserve_value): Declare.
(cselib_preserved_value_p): Declare.
(cselib_preserve_only_values): Declare.
(dump_cselib_table): Declare.
* cfgcleanup.c (flow_find_cross_jump): Skip debug insns.
(try_crossjump_to_edge): Likewise.
(delete_unreachable_blocks): Remove dominant GIMPLE blocks after
dominated blocks when debug stmts are present.
* simplify-rtx.c (delegitimize_mem_from_attrs): New.
* tree-ssa-live.c (remove_unused_locals): Skip debug stmts.
(set_var_live_on_entry): Likewise.
* loop-invariant.c (find_invariants_bb): Skip debug insns.
* cfglayout.c (curr_location, last_location): Make static.
(set_curr_insn_source_location): Don't avoid bouncing.
(get_curr_insn_source_location): New.
(get_curr_insn_block): New.
(duplicate_insn_chain): Handle debug insns.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate
into debug stmts.
* common.opt (fcompare-debug): Move to sort order.
(fdump-unnumbered-links): Likewise.
(fvar-tracking-assignments): New.
(fvar-tracking-assignments-toggle): New.
* tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks
because of debug stmts.
(mark_stmt_if_obviously_necessary): Mark debug stmts.
(eliminate_unnecessary_stmts): Walk dominated blocks before
dominators.
* tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts.
* ira.c (memref_used_between_p): Skip debug insns.
(update_equiv_regs): Likewise.
* sched-deps.c (sd_lists_size): Accept empty list.
(sd_init_insn): Mark debug insns.
(sd_finish_insn): Unmark them.
(sd_add_dep): Reject non-debug deps on debug insns.
(fixup_sched_groups): Give debug insns group treatment.
Skip debug insns.
(sched_analyze_reg): Don't mark debug insns for sched before call.
(sched_analyze_2): Handle debug insns.
(sched_analyze_insn): Compute next non-debug insn.  Handle debug
insns.
(deps_analyze_insn): Handle debug insns.
(deps_start_bb): Skip debug insns.
(init_deps): Initialize last_debug_insn.
* tree-ssa.c (target_for_debug_bind): New.
(find_released_ssa_name): New.
(propagate_var_def_into_debug_stmts): New.
(propagate_defs_into_debug_stmts): New.
(verify_ssa): Skip debug bind stmts without values.
(warn_uninialized_vars): Skip debug stmts.
* target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default.
* rtl.c (rtx_equal_p_cb): Handle VALUEs.
(rtx_equal_p): Likewise.
* ira-costs.c (scan_one_insn): Skip debug insns.
(process_bb_node_for_hard_reg_moves): Likewise.
* rtl.h (DEBUG_INSN_P): New.
(NONDEBUG_INSN_P): New.
(MAY_HAVE_DEBUG_INSNS): New.
(INSN_P): Accept debug insns.
(RTX_FRAME_RELATED_P): Likewise.
(INSN_DELETED_P): Likewise
(PAT_VAR_LOCATION_DECL): New.
(PAT_VAR_LOCATION_LOC): New.
(PAT_VAR_OCATION_STATUS): New.
(NOTE_VAR_LOCATION_DECL): Reimplement.
(NOTE_VAR_LOCATION_LOC): Likewise.
(NOTE_VAR_LOCATION_STATUS): Likewise.
(INSN_VAR_LOCATION): New.
(INSN_VAR_LOCATION_DECL): New.
(INSN_VAR_LOCATION_LOC): New.
(INSN_VAR_LOCATION_STATUS): New.
(gen_rtx_UNKNOWN_VAR_LOC): New.
(VAR_LOC_UNKNOWN_P): New.
(NOTE_DURING_CALL_P): New.
(SCHED_GROUP_P): Accept debug insns.
(emit_debug_insn_before): Declare.
(emit_debug_insn_before_noloc): Declare.
(emit_debug_insn_beore_setloc): Declare.
(emit_debug_insn_after): Declare.
(emit_debug_insn_after_noloc): Declare.
(emit_debug_insn_after_setloc): Declare.
(emit_debug_insn): Declare.
(make_debug_insn_raw): Declare.
(prev_nondebug_insn): Declare.
(next_nondebug_insn): Declare.
(delegitimize_mem_from_attrs): Declare.
(get_max_insn_count): Declare.
(wrap_constant): Declare.
(unwrap_constant): Declare.
(get_curr_insn_source_location): Declare.
(get_curr_insn_block): Declare.
* tree-inline.c (insert_debug_decl_map): New.
(processing_debug_stmt): New.
(remap_decl): Don't create new mappings in debug stmts.
(remap_gimple_op_r): Don't add references in debug stmts.
(copy_tree_body_r): Likewise.
(remap_gimple_stmt): Handle debug bind stmts.
(copy_bb): Skip debug stmts.
(copy_edges_for_bb): Likewise.
(copy_debug_stmt): New.
(copy_debug_stmts): New.
(copy_body): Copy debug stmts at the end.
(insert_init_debug_bind): New.
(insert_init_stmt): Take id.  Skip and emit debug stmts.
(setup_one_parameter): Remap variable earlier, register debug
mapping.
(estimate_num_insns): Skip debug stmts.
(expand_call_inline): Preserve debug_map.
(optimize_inline_calls): Check for no debug_stmts left-overs.
(unsave_expr_now): Preserve debug_map.
(copy_gimple_seq_and_replace_locals): Likewise.
(tree_function_versioning): Check for no debug_stmts left-overs.
Init and destroy debug_map as needed.  Split edges unconditionally.
(build_duplicate_type): Init and destroy debug_map as needed.
* tree-inline.h: Include gimple.h instead of pointer-set.h.
(struct copy_body_data): Add debug_stmts and debug_map.
* sched-int.h (struct ready_list): Add n_debug.
(struct deps): Add last_debug_insn.
(DEBUG_INSN_SCHED_P): New.
(BOUNDARY_DEBUG_INSN_P): New.
(SCHEDULE_DEBUG_INSN_P): New.
(sd_iterator_cond): Accept empty list.
* combine.c (create_log_links): Skip debug insns.
(combine_instructions): Likewise.
(cleanup_auto_inc_dec): New.  From Jakub Jelinek: Make sure the
return value is always unshared.
(struct rtx_subst_pair): New.
(auto_adjust_pair): New.
(propagate_for_debug_subst): New.
(propagate_for_debug): New.
(try_combine): Skip debug insns.  Propagate removed defs into
debug insns.
(next_nonnote_nondebug_insn): New.
(distribute_notes): Use it.  Skip debug insns.
(distribute_links): Skip debug insns.
* tree-outof-ssa.c (set_location_for_edge): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* var-tracking.c: Include cselib.h and target.h.
(enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and
MO_VAL_SET.
(micro_operation_type_name): New.
(enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN.
(struct micro_operation_def): Update comments.
(decl_or_value): New type.  Use instead of decls.
(struct emit_note_data_def): Add vars.
(struct attrs_def): Use decl_or_value.
(struct variable_tracking_info_def): Add permp, flooded.
(struct location_chain_def): Update comment.
(struct variable_part_def): Use decl_or_value.
(struct variable_def): Make var_part a variable length array.
(valvar_pool): New.
(scratch_regs): New.
(cselib_hook_called): New.
(dv_is_decl_p): New.
(dv_is_value_p): New.
(dv_as_decl): New.
(dv_as_value): New.
(dv_as_opaque): New.
(dv_onepart_p): New.
(dv_pool): New.
(IS_DECL_CODE): New.
(check_value_is_not_decl): New.
(dv_from_decl): New.
(dv_from_value): New.
(dv_htab_hash): New.
(variable_htab_hash): Use it.
(variable_htab_eq): Support values.
(variable_htab_free): Free from the right pool.
(attrs_list_member, attrs_list_insert): Use decl_or_value.
(attrs_list_union): Adjust.
(attrs_list_mpdv_union): New.
(tie_break_pointers): New.
(canon_value_cmp): New.
(unshare_variable): Return possibly-modified slot.
(vars_copy_1): Adjust.
(var_reg_decl_set): Adjust.  Split out of...
(var_reg_set): ... this.
(get_init_value): Adjust.
(var_reg_delete_and_set): Adjust.
(var_reg_delete): Adjust.
(var_regno_delete): Adjust.
(var_mem_decl_set): Split out of...
(var_mem_set): ... this.
(var_mem_delete_and_set): Adjust.
(var_mem_delete): Adjust.
(val_store): New.
(val_reset): New.
(val_resolve): New.
(variable_union): Adjust.  Speed up merge of 1-part vars.
(variable_canonicalize): Use unshared slot.
(VALUED_RECURSED_INTO): New.
(find_loc_in_1pdv): New.
(struct dfset_merge): New.
(insert_into_intersection): New.
(intersect_loc_chains): New.
(loc_cmp): New.
(canonicalize_loc_order_check): New.
(canonicalize_values_mark): New.
(canonicalize_values_star): New.
(variable_merge_over_cur): New.
(variable_merge_over_src): New.
(dataflow_set_merge): New.
(dataflow_set_equiv_regs): New.
(remove_duplicate_values): New.
(struct dfset_post_merge): New.
(variable_post_merge_new_vals): New.
(variable_post_merge_perm_vals): New.
(dataflow_post_merge_adjust): New.
(find_mem_expr_in_1pdv): New.
(dataflow_set_preserve_mem_locs): New.
(dataflow_set_remove_mem_locs): New.
(dataflow_set_clear_at_call): New.
(onepart_variable_different_p): New.
(variable_different_p): Use it.
(dataflow_set_different_1): Adjust.  Make detailed dump
more verbose.
(track_expr_p): Add need_rtl parameter.  Don't generate rtl
if not needed.
(track_loc_p): Pass it true.
(struct count_use_info): New.
(find_use_val): New.
(replace_expr_with_values): New.
(log_op_type): New.
(use_type): New, partially split out of...
(count_uses): ... this.  Count new micro-ops.
(count_uses_1): Adjust.
(count_stores): Adjust.
(count_with_sets): New.
(VAL_NEEDS_RESOLUTION): New.
(VAL_HOLDS_TRACK_EXPR): New.
(VAL_EXPR_IS_COPIED): New.
(VAL_EXPR_IS_CLOBBERED): New.
(add_uses): Adjust.  Generate new micro-ops.
(add_uses_1): Adjust.
(add_stores): Generate new micro-ops.
(add_with_sets): New.
(find_src_status): Adjust.
(find_src_set_src): Adjust.
(compute_bb_dataflow): Use dataflow_set_clear_at_call.
Handle new micro-ops.  Canonicalize value equivalances.
(vt_find_locations): Compute total size of hash tables for
dumping.  Perform merge for var-tracking-assignments.  Don't
disregard single-block loops.
(dump_attrs_list): Handle decl_or_value.
(dump_variable): Take variable.  Deal with decl_or_value.
(dump_variable_slot): New.
(dump_vars): Use it.
(dump_dataflow_sets): Adjust.
(set_slot_part): New, extended to support one-part variables
after splitting out of...
(set_variable_part): ... this.
(clobber_slot_part): New, split out of...
(clobber_variable_part): ... this.
(delete_slot_part): New, split out of...
(delete_variable_part): .... this.
(check_wrap_constant): New.
(vt_expand_loc_callback): New.
(vt_expand_loc): New.
(emit_note_insn_var_location): Adjust.  Handle values.  Handle
EMIT_NOTE_AFTER_CALL_INSN.
(emit_notes_for_differences_1): Adjust.  Handle values.
(emit_notes_for_differences_2): Likewise.
(emit_notes_for_differences): Adjust.
(emit_notes_in_bb): Take pointer to set.  Emit AFTER_CALL_INSN
notes.  Adjust.  Handle new micro-ops.
(vt_add_function_parameters): Adjust.  Create and bind values.
(vt_initialize): Adjust.  Initialize scratch_regs and
valvar_pool, flooded and perm..  Initialize and use cselib.  Log
operations.  Move some code to count_with_sets and add_with_sets.
(delete_debug_insns): New.
(vt_debug_insns_local): New.
(vt_finalize): Release permp, valvar_pool, scratch_regs.  Finish
cselib.
(var_tracking_main): If var-tracking-assignments is enabled
but var-tracking isn't, delete debug insns and leave.  Likewise
if we exceed limits or fail the stack adjustments tests, and
after all var-tracking processing.
More in var-tracking, from Jakub Jelinek <jakub@redhat.com>:
(dataflow_set): Add traversed_vars.
(value_chain, const_value_chain): New typedefs.
(value_chain_pool, value_chains): New variables.
(value_chain_htab_hash, value_chain_htab_eq, add_value_chain,
add_value_chains, add_cselib_value_chains, remove_value_chain,
remove_value_chains, remove_cselib_value_chains): New functions.
(shared_hash_find_slot_unshare_1, shared_hash_find_slot_1,
shared_hash_find_slot_noinsert_1, shared_hash_find_1): New
static inlines.
(shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): Update.
(dst_can_be_shared): New variable.
(unshare_variable): Unshare set->vars if shared, use shared_hash_*.
Clear dst_can_be_shared.  If set->traversed_vars is non-NULL and
different from set->vars, look up slot again instead of using the
passed in slot.
(dataflow_set_init): Initialize traversed_vars.
(variable_union): Use shared_hash_*.  Use initially NO_INSERT
lookup if set->vars is shared.  Don't keep slot cleared before
calling unshare_variable.  Unshare set->vars if needed.  Adjust
unshare_variable callers.  Clear dst_can_be_shared if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(dataflow_set_union): Set traversed_vars during canonicalization.
(VALUE_CHANGED, DECL_CHANGED): Define.
(set_dv_changed, dv_changed_p): New static inlines.
(track_expr_p): Clear DECL_CHANGED.
(dump_dataflow_sets): Set it.
(variable_was_changed): Call set_dv_changed.
(emit_note_insn_var_location): Likewise.
(changed_variables_stack): New variable.
(check_changed_vars_1, check_changed_vars_2): New functions.
(emit_notes_for_changes): Do nothing if changed_variables is
empty.  Traverse changed_variables with check_changed_vars_1,
call check_changed_vars_2 on each changed_variables_stack entry.
(emit_notes_in_bb): Add SET argument.  Just clear it at the
beginning, use it instead of local &set, don't destroy it at the
end.
(vt_emit_notes): Call dataflow_set_clear early on all
VTI(bb)->out sets, never use them, instead use emit_notes_in_bb
computed set, dataflow_set_clear also VTI(bb)->in when we are
done with the basic block.  Initialize changed_variables_stack,
free it afterwards.  If ENABLE_CHECKING verify that after noting
differences to an empty set value_chains hash table is empty.
(vt_initialize): Initialize value_chains and value_chain_pool.
(vt_finalize): Delete value_chains htab, free value_chain_pool.
(variable_tracking_main): Call dump_dataflow_sets before calling
vt_emit_notes, not after it.
* tree-flow.h (propagate_defs_into_debug_stmts): Declare.
(propagate_var_def_into_debug_stmts): Declare.
* df-problems.c (df_lr_bb_local_compute): Skip debug insns.
(df_set_note): Reject debug insns.
(df_whole_mw_reg_dead_p): Take added_notes_p argument.  Don't
add notes to debug insns.
(df_note_bb_compute): Adjust.  Likewise.
(df_simulate_uses): Skip debug insns.
(df_simulate_initialize_backwards): Likewise.
* reg-stack.c (subst_stack_regs_in_debug_insn): New.
(subst_stack_regs_pat): Reject debug insns.
(convert_regs_1): Handle debug insns.
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
(print-rtl.o): Depend on cselib.h.
(cselib.o): Depend on TREE_PASS_H.
(var-tracking.o): Depend on cselib.h and TARGET_H.
* sched-rgn.c (rgn_estimate_number_of_insns): Discount
debug insns.
(init_ready_list): Skip boundary debug insns.
(add_branch_dependences): Skip debug insns.
(free_block_dependencies): Check for blocks with only debug
insns.
(compute_priorities): Likewise.
* gimple.c (gss_for_code): Handle GIMPLE_DEBUG.
(gimple_build_with_ops_stat): Take subcode as unsigned.  Adjust
all callers.
(gimple_build_debug_bind_stat): New.
(empty_body_p): Skip debug stmts.
(gimple_has_side_effects): Likewise.
(gimple_rhs_has_side_effects): Likewise.
* gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New.
(gimple_build_debug_bind_stat): Declare.
(gimple_build_debug_bind): Define.
(is_gimple_debug): New.
(gimple_debug_bind_p): New.
(gimple_debug_bind_get_var): New.
(gimple_debug_bind_get_value): New.
(gimple_debug_bind_get_value_ptr): New.
(gimple_debug_bind_set_var): New.
(gimple_debug_bind_set_value): New.
(GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro.
(gimple_debug_bind_reset_value): New.
(gimple_debug_bind_has_value_p): New.
(gsi_next_nondebug): New.
(gsi_prev_nondebug): New.
(gsi_start_nondebug_bb): New.
(gsi_last_nondebug_bb): New.
* sched-vis.c (print_pattern): Handle VAR_LOCATION.
(print_insn): Handle DEBUG_INSN.
* tree-cfg.c (remove_bb): Walk stmts backwards.  Let loc
of first insn prevail.
(first_stmt): Skip debug stmts.
(first_non_label_stmt): Likewise.
(last_stmt): Likewise.
(has_zero_uses_1): New.
(single_imm_use_1): New.
(verify_gimple_debug): New.
(verify_types_in_gimple_stmt): Handle debug stmts.
(verify_stmt): Likewise.
(debug_loop_num): Skip debug stmts.
(remove_edge_and_dominated_blocks): Remove dominators last.
* tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into
debug stmts.
(linearize_expr): Likewise.
* config/i386/i386.c (ix86_delegitimize_address): Call
default implementation.
* config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug
insns.
(group_barrier_needed): Skip debug insns.
(emit_insn_group_barriers): Likewise.
(emit_all_insn_group_barriers): Likewise.
(ia64_variable_issue): Handle debug insns.
(ia64_dfa_new_cycle): Likewise.
(final_emit_insn_group_barriers): Skip debug insns.
(ia64_dwarf2out_def_steady_cfa): Take frame argument.  Don't
def cfa without frame.
(process_set): Likewise.
(process_for_unwind_directive): Pass frame on.
* config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(rs6000_delegitimize_address): New.
(rs6000_debug_adjust_cost): Handle debug insns.
(is_microcoded_insn): Likewise.
(is_cracked_insn): Likewise.
(is_nonpipeline_insn): Likewise.
(insn_must_be_first_in_group): Likewise.
(insn_must_be_last_in_group): Likewise.
(force_new_group): Likewise.
* cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block
contains only debug insns.
(rtl_merge_blocks): Skip debug insns.
(purge_dead_edges): Likewise.
(rtl_block_ends_with_call_p): Skip debug insns.
* dce.c (deletable_insn_p): Handle VAR_LOCATION.
(mark_reg_dependencies): Skip debug insns.
* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
* tree-ssanames.c (release_ssa_name): Propagate def into
debug stmts.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Skip debug stmts.
* regcprop.c (replace_oldest_value_addr): Skip debug insns.
(replace_oldest_value_mem): Use ALL_REGS for debug insns.
(copyprop_hardreg_forward_1): Handle debug insns.
* reload1.c (reload): Skip debug insns.  Replace unassigned
pseudos in debug insns with their equivalences.
(eliminate_regs_in_insn): Skip debug insns.
(emit_input_reload_insns): Skip debug insns at first, adjust
them later.
* tree-ssa-operands.c (add_virtual_operand): Reject debug stmts.
(get_indirect_ref_operands): Pass opf_no_vops on.
(get_expr_operands): Likewise.  Skip debug stmts.
(parse_ssa_operands): Scan debug insns with opf_no_vops.
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.c: New.
* gcc.dg/guality/guality.h: New.
* gcc.dg/guality/guality.exp: New.
* gcc.dg/guality/example.c: New.
* lib/gcc-dg.exp (cleanup-dump): Remove .gk files.
(cleanup-saved-temps): Likewise, .gkd files too.
gcc/cp/ChangeLog:
* cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
* cp-lang.c (cxx_dwarf_name): Pass it.
* error.c (count_non_default_template_args): Take flags as
argument.  Adjust all callers.  Skip counting of default
arguments if the new flag is given.
ChangeLog:
* Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* compare-debug: Look for .gkd files and compare them.
config/ChangeLog:
* bootstrap-debug.mk: Add comments.
* bootstrap-debug-big.mk: New.
* bootstrap-debug-lean.mk: New.
* bootstrap-debug-ckovw.mk: Add comments.
* bootstrap-debug-lib.mk: Drop CFLAGS for stages.  Use -g0
for TFLAGS in stage1.  Drop -fvar-tracking-assignments-toggle.

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Jan Hubicka 2de58650f9 cfgloopanal.c (check_irred): Move into ...
* cfgloopanal.c (check_irred): Move into ...
	(mark_irreducible_loops): ... here; return true if ireducible
	loops was found.
	* ipa-pure-const.c: Include cfgloop.h and tree-scalar-evolution.h
	(analyze_function): Try to prove loop finiteness.
	* cfgloop.h (mark_irreducible_loops): Update prototype.
	* Makefile.in (ipa-pure-const.o): Add dependency on SCEV and CFGLOOP.

From-SVN: r149101
2009-06-30 14:56:37 +00:00
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Vladimir Makarov 2af2dbdc68 tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
2008-01-29  Vladimir Makarov  <vmakarov@redhat.com>

	* doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
	* doc/passes.texi: Remove entries about regclass, local-alloc, and
	global.  Modify entries about regmove and IRA.

	* ra-conflict.c: Remove the file.

	* reload.c (push_reload, find_dummy_reload): Remove flag_ira.

	* tree-pass.h (pass_local_alloc, pass_global_alloc): Remove.
	(pass_regclass_init): Rename to pass_reginfo_init.

	* cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira.

	* toplev.h (flag_ira): Remove.

	* caller-save.c (setup_save_areas): Remove flag_ira.

	* ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot):
	Ditto.

	* global.c: Remove the file.

	* opts.c: (decode_options): Remove flag_ira.

	* hard-reg-set.h (losing_caller_save_reg_set): Remove.

	* regmove.c: Modify file description.
	(find_use_as_address, try_auto_increment): Define them only if
	AUTO_INC_DEC is defined.
	(replacement_quality, replace_in_call_usage, fixup_match_1,
	stable_and_no_regs_but_for_p): Remove.
	(reg_set_in_bb): Make it static.
	(regmove_optimize): Remove flag_ira and code which worked for
	!flag_ira.

	* local-alloc.c: Remove the file.

	* common.opt (fira): Remove.

	* ira.c: Include except.h.
	(eliminable_regset): Move from global.c.
	(mark_elimination): Ditto.  Remove flag_ira.
	(reg_renumber, struct equivalence, reg_equiv, equiv_mem,
	equiv_mem_modified, validate_equiv_mem_from_store,
	validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p,
	contains_replace_regs, memref_referenced_p, memref_used_between_p,
	no_equiv, recorded_label_ref): Move from local-alloc.c.
	(update_equiv_regs): Ditto.  Make it static.
	(print_insn_chain, print_insn_chains): Move it from global.c.
	pseudo_for_reload_consideration_p): Ditto.  Remove flag_ira.
	(build_insn_chain): Ditto.  Make it static.
	(ra_init_live_subregs): Move from ra-conflict.c.  Make it static.
	Rename to init_live_subregs.
	(gate_ira): Remove flag_ira.

	* regclass.c: Rename reginfo.c.  Change file description.
	(FORBIDDEN_INC_DEC_CLASSES): Remove.
	(reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec):
	Remove.
	(init_reg_sets_1): Remove code for evaluation of
	reg_class_superclasses and losing_caller_save_reg_set.
	(init_regs): Remove init_reg_autoinc.
	(struct costs, costs, init_cost, ok_for_index_p_nonstrict,
	ok_for_base_p_nonstrict): Remove.
	(regclass_init): Rename to reginfo_init.  Don't initialize
	init_cost.
	(pass_regclass_init): Rename to pass_reginfo_init.  Modify
	corresponding entries.
	(dump_regclass, record_operand_costs, scan_one_insn,
	init_reg_autoinc, regclass, record_reg_classes, copy_cost,
	record_address_regs, auto_inc_dec_reg_p): Remove.
	(gt-regclass.h): Rename to gt-reginfo.h.

	* rtl.h (dump_global_regs, retry_global_alloc,
	build_insn_chain, dump_local_alloc, update_equiv_regs):
	Remove.

	* Makefile.in (RA_H): Remove.
	(OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o.
	Rename regclass.o to reginfo.o.
	(regclass.o): Rename to reginfo.o.  Rename gt-regclass.h to
	gt-reginfo.h.
	(global.o, local-alloc.o, ra-conflict.o): Remove entries.
	(GTFILES): Rename regclass.c to	reginfo.c.

	* passes.c (init_optimization_passes): Remove pass_local_alloc and
	pass_global_alloc.  Rename pass_regclass_init to
	pass_reginfo_init.

	* reload1.c (compute_use_by_pseudos, reload, count_pseudo,
	count_spilled_pseudo, find_reg, alter_reg, delete_output_reload):
	Remove flag_ira.
	(finish_spills): Ditto.  Remove code for !flga_ira.

From-SVN: r143757
2009-01-29 14:51:46 +00:00
Vladimir Makarov 7db7ed3cbd tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
2008-12-09  Vladimir Makarov  <vmakarov@redhat.com>

	* doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.

	* doc/invoke.texi (-fira-region): Describe new option.
	(-fira-algorithm): Change the values.

	* ira-conflicts.c (build_conflict_bit_table,
	build_allocno_conflicts): Use ira_reg_classes_intersect_p.
	(ira_build_conflicts): Use flag flag_ira_region instead of
	flag_ira_algorithm.  Prohibit usage of callee-saved likely spilled
	base registers for allocnos crossing calls.

	* flags.h (enum ira_algorithm): Redefine.
	(enum ira_region): New.
	(flag_ira_region): New.

	* cfgloopanal.c (estimate_reg_pressure_cost): Use flag_ira_region
	instead of flag_ira_algorithm.

	* toplev.c (flag_ira_algorithm): Change the initial value.
	(flag_ira_region): New.

	* ira-int.h (ira_reg_classes_intersect_p,
	ira_reg_class_super_classes): New.

	* ira-color.c (update_copy_costs): Use
	ira_reg_classes_intersect_p.  Use right class to find hard reg
	index.
	(update_conflict_hard_regno_costs): Ditto.  Add a new parameter.
	(assign_hard_reg): Ditto.  Pass additional argument to
	update_conflict_hard_regno_costs.  Do not uncoalesce for priority
	coloring.
	(allocno_priorities, setup_allocno_priorities,
	allocno_priority_compare_func): Move before color_allocnos.
	(color_allocnos): Add priority coloring.  Use flag flag_ira_region
	instead of flag_ira_algorithm.
	(move_spill_restore): Check classes of the same reg allocno from
	different regions.
	(update_curr_costs): Use ira_reg_classes_intersect_p.
	(ira_reassign_conflict_allocnos): Ditto.

	* opts.c (decode_options): Always set up flag_ira.  Set up
	flag_ira_algorithm.  Warn CB can not be used for architecture.
	(common_handle_option): Modify code for -fira-algorithm.  Add code
	to process -fira-region.

	* ira-lives.c (update_allocno_pressure_excess_length): Process
	superclasses too.
	(set_allocno_live, clear_allocno_live, mark_reg_live,
	mark_reg_dead, process_bb_node_lives): Ditto.

	* ira-emit.c (ira_emit): Fix insn codes.
	
	* ira-build.c (propagate_allocno_info): Use flag flag_ira_region
	instead of flag_ira_algorithm.
	(allocno_range_compare_func): Ignore classes for priority
	coloring.
	(setup_min_max_conflict_allocno_ids): Ditto.
	(ira_flattening): Use ira_reg_classes_intersect_p.

	* genpreds.c (write_enum_constraint_num): Output
	CONSTRAINT__LIMIT.
	
	* common.opt (fira-algorithm): Modify.
	(fira-region): New.

	* ira.c (setup_class_hard_regs): Initialize.
	(setup_cover_and_important_classes): Modify code setting class
	related info for priority coloring.
	(setup_class_translate): Ditto.
	(ira_reg_classes_intersect_p, ira_reg_class_super_classes): New.
	(setup_reg_class_intersect_union): Rename to
	setup_reg_class_relations.  Add code for setting up new variables.
	(find_reg_class_closure): Do not check targetm.ira_cover_classes.
	(ira): Use flag flag_ira_region instead of flag_ira_algorithm.

	* ira-costs.c (common_classes): New.
	(print_costs): Use flag flag_ira_region instead of
	flag_ira_algorithm.
	(find_allocno_class_costs): Ditto.  Use common_classes.  Translate
	alt_class.
	(ira_costs): Allocate/deallocate common_classes.
	
	* config/m32c/m32.h (REG_ALLOC_ORDER): Add reg 19.
	(REG_CLASS_CONTENTS, reg_class, REG_CLASS_NAMES): New entries for
	R02A_REGS.

	* reload1.c (choose_reload_regs): Use MODE_INT for partial ints in
	smallest_mode_for_size.

From-SVN: r142610
2008-12-09 21:25:11 +00:00
Jan Hubicka f40751dd34 fwprop.c (should_replace_address): Add speed attribute.
* fwprop.c (should_replace_address): Add speed attribute.
	(PR_OPTIMIZE_FOR_SPEED): New flag.
	(propagate_rtx_1): Use it.
	(propagate_rtx): Set it.
	(try_fwprop_subst): Update call of rtx_costs.
	(forward_propagate_and_simplify): LIkewise.
	* hooks.c (hook_int_rtx_bool_0): New
	(hook_bool_rtx_int_int_intp_false): Replace by ...
	(hook_bool_rtx_int_int_intp_bool_false): .. thisone.
	* hooks.h (hook_int_rtx_bool_0): New
	(hook_bool_rtx_int_int_intp_false): Replace by ...
	(hook_bool_rtx_int_int_intp_bool_false): .. thisone.
	* optabs.c (avoid_expensive_constant): UPdate call of rtx_cost.
	(prepare_cmp_insn): UPdate call of rtx_cost.
	* postreload.c (reload_cse_simplify_set): Update call of rtx_cost.
	(reload_cse_simplify_operands): Update call of rtx_cost.
	(reload_cse_move2add): call of rtx_cost.
	* target.h (struct gcc_target): Update rtx_costs and address_costs.
	* rtlanal.c (rtx_cost): Add speed argument.
	(address_cost): Add speed argument
	(default_address_cost): Likewise.
	(insn_rtx_cost): Likewise.
	* cfgloopanal.c (seq_cost): Add speed argument.
	(target_reg_cost, target_spill_cost): Turn to array.
	(init_set_costs): Update for speed.
	(estimate_reg_pressure_cost): Add speed argument.
	* auto-inc-dec.c (attempt_change): Update call of rtx_cost.
	* dojump.c (prefer_and_bit_test): UPdate call of rtx_cost.
	* tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed.
	(seq_cost): Add speed argument.
	(computation_cost): Add speed arugment.
	(add_cost, multiply_by_const, get_address_cost): add speed argument.
	(force_expr_to_var_cost): Update for profile info.
	(force_var_cost): Likewise.
	(split_address_cost): Likewise.
	(ptr_difference_cost): Likewise.
	(difference_cost): Likewise.
	(get_computation_cost_at): Likewise.
	(determine_iv_cost): Likewise.
	(ivopts_global_cost_for_size): Likewise.
	(rewrite_use_address): Likewise.
	(tree_ssa_iv_optimize_loop): Initialize speed field.
	* cse.c (optimize_this_for_speed_p): New static var.
	(notreg_cost): Update call of rtx_cost.
	(cse_extended_basic_block): set optimize_this_for_speed_p.
	* ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost.
	(noce_try_cmove_arith): Likewise.
	(noce_try_sign_mask): LIkewise.
	* expr.c (compress_float_constant): Update rtx_cost calls.
	* tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument.
	(addr_to_parts): Likewise.
	(create_mem_ref): Likewise.
	* dse.c (find_shift_sequence): Add speed argument.
	(replace_read): Update call.
	* calls.c (precompute_register_parameters): Update call of rtx_cost.
	* expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost,
	* neg_cost, shift_cost, shiftadd_cost,
	shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost,
	mul_highpart_cost): Increase dimension.
	(init_expmed): Initialize for both size and speed.
	(expand_shift): Use profile.
	(synth_mult): Use profile.
	(choose_mult_variant): Use profile.
	(expand_mult): Use profile.
	(expand_mult_highpart_optab): Use profile.
	(expand_mult_highpart): Use profile.
	(expand_smod_pow2): Use profile.
	(expand_divmod): Use profile.
	* simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost.
	* loop-invariant.c (create_new_invariant): Use profile.
	(gain_for_invariant): Add speed parameter.
	(best_gain_for_invariant): Likewise.
	(find_invariants_to_move): Likewise.
	(move_single_loop_invariants): Set it.
	* target-def.h (TARGET_RTX_COSTS): Use hook.
	* rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe.
	(optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
	* output.h (default_address_cost): Update prototype.
	* combine.c (optimize_this_for_speed_p): New static var.
	(combine_validate_cost): Update call of rtx_cost.
	(combine_instructions): Set optimize_this_for_speed_p.
	(expand_compound_operation): Update call of rtx_cost.
	(make_extraction):Update call of rtx_cost.
	(force_to_mode):Update call of rtx_cost.
	(distribute_and_simplify_rtx):Update call of rtx_cost.
	* cfgloop.h (target_reg_cost, target_spill_cost): Turn to array.
	(estimate_reg_pressure_cost): Update prototype.
	* tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype.
	* basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p):
	Remove.
	* config/alpha/alpha.c (alpha_rtx_costs): Update.
	(alpha_rtx_costs): Update.
	* config/frv/frv.c (frv_rtx_costs): Update.
	* config/s390/s390.c (s390_rtx_costs): Update.
	* config/m32c/m32c.c (m32c_memory_move_cost): Update.
	(m32c_rtx_costs): Update.
	* config/spu/spu.c (TARGET_ADDRESS_COST): Upate.
	(spu_rtx_costs): Update.
	* config/sparc/sparc.c (sparc_rtx_costs): Update.
	* config/m32r/m32r.c (m32r_rtx_costs): Update.
	* config/i386/i386.c (:ix86_address_cost): Update.
	(ix86_rtx_costs): Update.
	* config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update.
	* config/pdp11/pdp11.c (pdp11_rtx_costs): Update.
	* config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update.
	* config/crx/crx.c (crx_address_cost): Update.
	* config/xtensa/xtensa.c (xtensa_rtx_costs): Update.
	* config/stormy16/stormy16.c
	(xstormy16_address_cost, xstormy16_rtx_costs): Update.
	* config/m68hc11/m68hc11.c
	(m68hc11_address_cost, m68hc11_rtx_costs): Update.
	* config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update.
	* config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost): Update.
	* config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs): Update
	* config/ia64/ia64.c (ia64_rtx_costs): Update.
	* config/m68k/m68k.c (m68k_rtx_costs): Update.
	* config/rs6000/rs6000.c (rs6000_rtx_costs): Update.
	* config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update.
	* config/mcore/mcore.c (TARGET_ADDRESS_COST): Update.
	(mcore_rtx_costs): update.
	* config/score/score3.c (score3_rtx_costs): Update.
	* config/score/score7.c (score7_rtx_costs): Update.
	* config/score/score3.h (score3_rtx_costs):Update.
	* config/score/score7.h (score7_rtx_costs): Update.
	* config/score/score.c (score_rtx_costs): Update.
	* config/arm/arm.c (arm_address_cost): Update.
	(arm_rtx_costs_1): Update.
	(arm_rtx_costs_1): Update.
	(arm_size_rtx_costs): Update.
	(arm_size_rtx_costs): Update.
	(arm_size_rtx_costs): Update.
	(arm_xscale_rtx_costs): Update.
	(arm_thumb_address_cost): Update.
	* config/pa/pa.c (hppa_address_cost): Update.
	* config/mips/mips.c (mips_rtx_costs): Update.
	* config/vax/vax.c (vax_address_cost): Update.
	* config/h8300/h8300.c (h8300_shift_costs): Update.
	(h8300_rtx_costs): Update.
	* config/v850/v850.c (TARGET_ADDRESS_COST): Update.
	(v850_rtx_costs): Update.
	* config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update.
	* config/bfin/bfin.c
	(bfin_address_cost): Update.
	(bfin_rtx_costs): Update.
	* stmt.c (lshift_cheap_p): Update.

From-SVN: r139821
2008-08-31 09:44:25 +00:00
Vladimir Makarov 058e97ecf3 [multiple changes]
2008-08-26  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c,
	ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files.

	* doc/passes.texi: Describe IRA.

	* doc/tm.texi (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros.

	* doc/invoke.texi (ira-max-loops-num): Describe the new parameter.
	(-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills,
	-fira-propagate-cost, -fno-ira-share-save-slots,
	-fno-ira-share-spill-slots, -fira-verbose): Describe new options.

	* flags.h (ira_algorithm): New enumeration.
	(flag_ira_algorithm, flag_ira_verbose): New external variable
	declarations.

	* postreload.c (gate_handle_postreload): Don't do post reload
	optimizations unless the reload is completed.

	* reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for
	IRA.

	* tree-pass.h (pass_ira): New external variable declaration.

	* reload.h: Add 2008 to the Copyright.
    
	* cfgloopanal.c: Include params.h.
	(estimate_reg_pressure_cost): Decrease cost for IRA optimization
	mode.
    
	* params.h (IRA_MAX_LOOPS_NUM): New macro.

	* toplev.c (ira.h): New include.
	(flag_ira_algorithm, flag_ira_verbose): New external variables.
	(backend_init_target): Call ira_init.
	(backend_init): Call ira_init_once.
	(finalize): Call finish_ira_once.

	* toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills,
	flag_ira_share_save_slots, flag_ira_share_spill_slots): New
	external variables.

	* regs.h (contains_reg_of_mode, move_cost, may_move_in_cost,
	may_move_out_cost): New external variable declarations.
	(move_table): New typedef.
    
	* caller-save.c: Include headers output.h and ira.h.
	(no_caller_save_reg_set): New global variable.
	(save_slots_num, save_slots): New variables.
	(reg_save_code, reg_restore_code, add_stored_regs): Add
	prototypes.
	(init_caller_save): Set up no_caller_save_reg_set.
	(init_save_areas): Reset save_slots_num.
	(saved_hard_reg): New structure.
	(hard_reg_map, saved_regs_num, all_saved_regs): New variables.
	(initiate_saved_hard_regs, new_saved_hard_reg,
	finish_saved_hard_regs, saved_hard_reg_compare_func): New
	functions.
	(setup_save_areas): Add code for sharing stack slots.
	(all_blocks): New variable.
	(save_call_clobbered_regs): Process pseudo-register too.
	(mark_set_regs): Process pseudo-register too.
	(insert_one_insn): Put the insn after bb note in a empty basic
	block.  Add insn check.
    
	* global.c (eliminable_regset): Make it external.
	(mark_elimination): Use DF_LR_IN for IRA.
	(pseudo_for_reload_consideration_p): New.
	(build_insn_chain): Make it external.  Don't ignore spilled
	pseudos for IRA.  Use pseudo_for_reload_consideration_p.
	(gate_handle_global_alloc): New function.
	(pass_global_alloc): Add the gate function.

	* opts.c (decode_options): Set up flag_ira.  Print the warning for
	-fira.
	(common_handle_option): Process -fira-algorithm and -fira-verbose.

	* timevar.def (TV_IRA, TV_RELOAD): New passes.

	* regmove.c (regmove_optimize): Don't do replacement of output for
	IRA.

	* hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses):
	New external variable declarations.

	* local-alloc.c (update_equiv_regs): Make it external.  Return
	true if jump label rebuilding should be done.  Rescan new_insn for
	notes.
	(gate_handle_local_alloc): New function.
	(pass_local_alloc): Add the gate function.

	* alias.c (value_addr_p, stack_addr_p): New functions.
	(nonoverlapping_memrefs_p): Use them for IRA.

	* common.opt (fira, fira-algorithm, fira-coalesce,
	fira-move-spills, fira-share-save-slots, fira-share-spill-slots,
	fira-verbose): New options.

	* regclass.c (reg_class_subclasses, contains_reg_of_mode,
	move_cost, may_move_in_cost, may_move_out_cost): Make the
	variables external.
	(move_table): Remove typedef.
	(init_move_cost): Make it external.
	(allocate_reg_info, resize_reg_info, setup_reg_classes): New
	functions.

	* rtl.h (init_move_cost, allocate_reg_info, resize_reg_info,
	setup_reg_classes): New function prototypes.
	(eliminable_regset): New external variable declaration.
	(build_insn_chain, update_equiv_regs): New function prototypes.
    
	* Makefile.in (IRA_INT_H): New definition.
	(OBJS-common): Add ira.o, ira-build.o, ira-costs.o,
	ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o.
	(reload1.o, toplev.o): Add dependence on ira.h.
	(cfgloopanal.o): Add PARAMS_H.
	(caller-save.o): Add dependence on output.h and ira.h.
	(ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o,
	ira-emit.o, ira-lives.o): New entries.

	* passes.c (pass_ira): New pass.

	* params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter.

	* reload1.c (ira.h): Include the header.
	(changed_allocation_pseudos): New bitmap.
	(init_reload): Initiate the bitmap.
	(compute_use_by_pseudos): Permits spilled registers in FROM.
	(temp_pseudo_reg_arr): New variable.
	(reload): Allocate and free temp_pseudo_reg_arr.  Sort pseudos for
	IRA.  Call alter_reg with the additional parameter.  Don't clear
	spilled_pseudos for IRA.  Restore original insn chain for IRA.
	Clear changed_allocation_pseudos at the end of reload.
	(calculate_needs_all_insns): Call IRA's mark_memory_move_deletion.
	(hard_regno_to_pseudo_regno): New variable.
	(count_pseudo): Check spilled pseudos.  Set up
	hard_regno_to_pseudo_regno.
	(count_spilled_pseudo): Check spilled pseudos. Update
	hard_regno_to_pseudo_regno.
	(find_reg): Use better_spill_reload_regno_p.  Check
	hard_regno_to_pseudo_regno.
	(alter_reg): Set up spilled_pseudos.  Add a new parameter.  Add
	code for IRA.
	(eliminate_regs_1): Use additional parameter for alter_reg.
	(finish_spills): Set up pseudo_previous_regs only for spilled
	pseudos.  Call reassign_pseudos once for all spilled pseudos, pass
	more arguments.  Don't clear live_throughout and dead_or_set for
	spilled pseudos.  Use additional parameter for alter_reg.  Call
	mark_allocation_change.  Set up changed_allocation_pseudos.
	Remove sanity check.
	(emit_input_reload_insns, delete_output_reload): Use additional
	parameter for alter_reg.  Call mark_allocation_change.
	(substitute, gen_reload_chain_without_interm_reg_p): New
	functions.
	(reloads_conflict): Use gen_reload_chain_without_interm_reg_p.
    
	* testsuite/gcc.dg/20080410-1.c: New file.
	
	* config/s390/s390.h (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define.

	* config/sparc/sparc.h (IRA_COVER_CLASSES): New macro.

	* config/i386/i386.h (IRA_COVER_CLASSES): Ditto.

	* config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto.

	* config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto.

	* config/arm/arm.h (IRA_COVER_CLASSES): Ditto.
    
	* config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto.
    
	2008-08-24  Jeff Law  <law@redhat.com>
	* ira.c (setup_reg_class_intersect_union): Prefer smallest class
	when ignoring unavailable registers.

	2008-08-24  Jeff Law  <law@redhat.com>
	* ira-color.c (coalesced_pseudo_reg_slot_compare): Check
	FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD.
	* ira.c (setup_eliminable_regset): Check stack_realign_needed.
	* config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro.

	2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com>
	* ira-build.c (allocno_range_compare_func): Stabilize sort.

	2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com>
	* config/avr/avr.h (IRA_COVER_CLASSES): New macro.
	* reload1.c (find_reg): Process registers in register allocation order.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* toplev.c (backend_init_target): Move ira_init call from
	here...
	(lang_dependent_init_target): ...to here.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* ira.c (setup_class_subset_and_memory_move_costs): Don't
	calculate memory move costs for NO_REGS.

	2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org>
	* ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if
	STACK_REGS is defined.

	2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
	* config/spu/spu.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com>
	* config/bfin/bfin.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org>
	* config/sh/sh.h (IRA_COVER_CLASSES): Define.
	* config/sh/sh.md (movsicc_true+3): Check if emit returns a
	barrier.

From-SVN: r139590
2008-08-26 12:39:58 +00:00
Sandra Loosemore b5deb7b691 Separate target-specific initialization from general back-end initialization.
2007-08-27  Sandra Loosemore  <sandra@codesourcery.com>
	    David Ung  <davidu@mips.com>
            Nigel Stephens <nigel@mips.com>

	gcc/
	Separate target-specific initialization from general
	back-end initialization.

	* toplev.c (init_alignments): New, split out from...
	(process_options): ...here.
	(backend_init_target):  New, split out from...
	(backend_init): ...here.
	(lang_dependent_init_target):  New, split out from...
	(lang_dependent_init): ...here.
	(target_reinit): New.
	* toplev.h (target_reinit): Declare.
	* expr.c (init_expr_target): Renamed from init_expr_once, since it
	now can be called more than once.  Update comments.
	* expr.h (init_expr_target): Likewise.
	* alias.c (init_alias_target): Renamed from init_alias_once, since it
	now can be called more than once.  Explicitly zero
	static_reg_base_value.
	* emit-rtl.c (init_emit_regs): New, split out from...
	(init_emit_once): Here.
	* regclass.c (initial_fixed_regs, initial_call_used_regs): Make
	non-const, so that changes from command-line arguments can overwrite
	values provided by the static initializers.
	(initial_call_really_used_regs): New, used similarly to the above.
	(initial_reg_names): Likewise.
	(last_mode_for_init_move_cost): Promoted function-local static to
	file-scope static to make it accessible outside init_move_cost.
	(init_reg_sets): Do not initialize fixed_regs and call_used_regs yet.
	Do not initialize inv_reg_alloc_order yet, either.  Do initialize
	reg_names since it is needed for parsing command-line options.
	(init_move_cost): Use last_mode_for_init_move_cost instead of
	function-local static.
	(init_reg_sets_1): Initialize fixed_regs, call_used_regs, and
	call_really_used_regs now.  Reinitialize reg_names.  Also
	initialize inv_reg_alloc_order.  Zero reg_class_subunion and
	reg_class_superunion.  Clear losing_caller_save_reg_set.
	Preserve global registers if called more than once.  Reset
	move cost, may_move_in_cost, may_move_out_cost, and
	last_mode_for_init_move_cost.
	(init_reg_modes_target): Renamed from init_reg_modes_once, since it
	can now be invoked more than once.  Update comments.
	(init_regs): Update comments.
	(fix_register): Update initial_fixed_regs, initial_call_used_regs,
	and initial_call_really_used_regs, instead of the non-initial 
        variables.  This allows us to save the command-line register settings
	after target reinitialization.
	(init_reg_autoinc): Zero forbidden_inc_dec_classes.
	* rtl.h (init_emit_regs): Declare.
	(init_reg_modes_target, init_alias_target): Renamed as described
	above.
	* reload1.c (init_reload): Update comments.
	* optabs.c (init_optabs): Likewise.
	* cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs.
	


Co-Authored-By: David Ung <davidu@mips.com>
Co-Authored-By: Nigel Stephens <nigel@mips.com>

From-SVN: r127832
2007-08-27 09:34:14 -04:00
Kaveh R. Ghazi ed7a4b4b30 alias.c (rtx_equal_for_memref_p): Constify.
* alias.c (rtx_equal_for_memref_p): Constify.
	* basic-block.h (const_edge, const_basic_block): New.
	(reg_set_to_hard_reg_set, dfs_enumerate_from, single_succ_p,
	single_pred_p, single_succ_edge, single_pred_edge, single_succ,
	single_pred, maybe_hot_bb_p, probably_cold_bb_p,
	probably_never_executed_bb_p, edge_probability_reliable_p,
	br_prob_note_reliable_p, forwarder_block_p, flow_nodes_print,
	inside_basic_block_p, control_flow_insn_p, dominated_by_p):
	Likewise.
	* bb-reorder.c (better_edge_p, push_to_next_round_p): Likewise.
	* bt-load.c (basic_block_freq, insn_sets_btr_p, can_move_up):
	Likewise.
	* cfganal.c (flow_active_insn_p, forwarder_block_p,
	flow_nodes_print, dfs_enumerate_from): Likewise.
	* cfgbuild.c (count_basic_blocks, inside_basic_block_p,
	control_flow_insn_p, count_basic_blocks): Likewise.
	* cfgloop.c (flow_bb_inside_loop_p, glb_enum_p,
	get_loop_body_with_size, loop_exit_edge_p): Likewise.
	* cfgloop.h (flow_bb_inside_loop_p, num_loop_insns,
	average_num_loop_insns, loop_exit_edge_p,
	just_once_each_iteration_p, can_duplicate_loop_p): Likewise.
	* cfgloopanal.c (just_once_each_iteration_p, num_loop_insns,
	average_num_loop_insns, seq_cost): Likewise.
	* cfgloopmanip.c (rpe_enum_p, can_duplicate_loop_p): Likewise.
	* dominance.c (dominated_by_p): Likewise.
	* emit-rtl.c (validate_subreg): Likewise.
	* except.c (can_throw_internal, can_throw_external): Likewise.
	* except.h (can_throw_internal, can_throw_external): Likewise.
	* gcse.c (gcse_constant_p, oprs_unchanged_p, oprs_anticipatable_p,
	oprs_available_p, hash_expr, expr_equiv_p, oprs_not_set_p,
	compute_transp, load_killed_in_block_p, reg_killed_on_edge,
	simple_mem, store_ops_ok, load_kills_store, find_loads,
	store_killed_in_insn, store_killed_after, store_killed_before,
	gcse_mem_operand, implicit_set_cond_p, store_killed_in_pat):
	Likewise.
	* ifcvt.c (count_bb_insns, cheap_bb_rtx_cost_p, noce_operand_ok,
	noce_mem_write_may_trap_or_fault_p): Likewise.
	* pointer-set.c (pointer_set_contains, pointer_map_contains):
	Likewise.
	* pointer-set.h (pointer_set_contains, pointer_map_contains):
	Likewise.
	* predict.c (can_predict_insn_p, maybe_hot_bb_p,
	probably_cold_bb_p, probably_never_executed_bb_p,
	edge_probability_reliable_p, br_prob_note_reliable_p,
	can_predict_insn_p): Likewise.
	* regclass.c (reg_set_to_hard_reg_set): Likewise.
	* resource.c (return_insn_p): Likewise.
	* rtl.h (reg_set_between_p, reg_set_p, validate_subreg):
	Likewise.
	* rtlanal.c (reg_set_between_p, reg_set_p): Likewise.
	* tracer.c (count_insns, ignore_bb_p, better_p): Likewise.
	* tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr,
	verify_gimple_modify_stmt): Likewise.
	* tree-chrec.c (is_not_constant_evolution,
	is_multivariate_chrec_rec, is_multivariate_chrec,
	chrec_contains_symbols, chrec_contains_undetermined,
	tree_contains_chrecs, evolution_function_is_affine_multivariate_p,
	evolution_function_is_univariate_p, avoid_arithmetics_in_type_p,
	eq_evolutions_p, scev_direction): Likewise.
	* tree-chrec.h (automatically_generated_chrec_p, tree_is_chrec,
	eq_evolutions_p, is_multivariate_chrec, chrec_contains_symbols,
	chrec_contains_symbols_defined_in_loop,
	chrec_contains_undetermined, tree_contains_chrecs,
	evolution_function_is_affine_multivariate_p,
	evolution_function_is_univariate_p, chrec_zerop,
	evolution_function_is_constant_p, evolution_function_is_affine_p,
	evolution_function_is_affine_or_constant_p,
	tree_does_not_contain_chrecs, chrec_type): Likewise.
	* tree-data-ref.c (tree_fold_divides_p,
	object_address_invariant_in_loop_p, dr_may_alias_p,
	ziv_subscript_p, siv_subscript_p, gcd_of_steps_may_divide_p,
	same_access_functions, constant_access_functions,
	access_functions_are_affine_or_constant_p, find_vertex_for_stmt):
	Likewise.
	* tree-flow.h (scev_direction): Likewise.
	* tree-gimple.c (is_gimple_stmt): Likewise.
	* tree-outof-ssa.c (identical_copies_p, identical_stmt_lists_p):
	Likewise.
	* tree-pretty-print.c (op_prio): Likewise.
	* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop,
	analyzable_condition, backedge_phi_arg_p): Likewise.
	* tree-scalar-evolution.h (get_chrec_loop): Likewise.
	* tree-ssa-operands.c (get_name_decl, operand_build_cmp): Likewise.
	* tree-ssa-threadupdate.c (dbds_continue_enumeration_p):
	Likewise.

From-SVN: r127404
2007-08-14 04:44:35 +00:00
Zdenek Dvorak f87000d0c4 tree-ssa-threadupdate.c (thread_through_all_blocks): Use loops' state accessor functions.
* tree-ssa-threadupdate.c (thread_through_all_blocks): Use loops' state
	accessor functions.
	* cfgloopmanip.c (remove_path, create_preheaders,
	force_single_succ_latches, fix_loop_structure): Ditto.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
	tree_duplicate_loop_to_header_edge): Ditto.
	* cfgloopanal.c (mark_irreducible_loops): Ditto.
	* loop-init.c (loop_optimizer_init, loop_optimizer_finalize):
	Ditto.
	* tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures,
	cleanup_tree_cfg): Ditto.
	* tree-cfg.c (tree_merge_blocks): Ditto.
	* cfgloop.c (rescan_loop_exit, record_loop_exits,
	release_recorded_exits, get_loop_exit_edges, verify_loop_structure,
	loop_preheader_edge, single_exit): Ditto.
	(flow_loops_find): Do not clear loops->state.
	* cfgloop.h (loops_state_satisfies_p, loops_state_set,
	loops_state_clear): New functions.

From-SVN: r127197
2007-08-04 01:09:12 +00:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Thomas Neumann ae50c0cbc8 cfg.c (init_flow): Use type safe memory macros.
* cfg.c (init_flow): Use type safe memory macros.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	(dump_flow_info): Avoid using C++ keywords as variable names.
	(copy_original_table_clear): Cast according to the coding conventions.
	(copy_original_table_set): Likewise.
	* cfgexpand (label_rtx_for_bb): Likewise.
	(expand_gimüle_basic_block): Likewise.
	* cfghooks.c (dump_bb): Likewise.
	(lv_adjust_loop_header_phi): Avoid using C++ keywords as variable names.
	(lv_add_condition_to_bb): Likewise.
	* cfglayout (relink_block_chain): Cast according to the coding
	conventions.
	(fixup_reorder_chain): Likewise.
	(fixup_fallthru_exit_predecessor): Likewise.
	* cfgloop.c (glb_enum_p): Likewise.
	(get_exit_description): Likewise.
	(dump_recorded_exit): Likewise.
	* cfgloop.h (enum loop_estimation): Move out of struct scope...
	(struct loop): ... from here.
	* cfgloopmanip (rpe_enum_p): Cast according to the coding conventions.
	* cfgrtl.c (rtl_create_basic_block): Likewise.
	(rtl_split_block): Likewise.
	(rtl_dump_bb): Likewise.
	(cfg_layout_split_block): Likewise.
	(init_rtl_bb_info): Use typesafe memory macros.

	* graphds.h (struct graph_edge): Renamed edge to graph_edge.
	* graphds.h: Updated all usages of edge to graph_edge.
	* graphds.c: Likewise.
	* cfgloopanal.c: Likewise.

From-SVN: r125336
2007-06-05 15:41:04 +00:00
Zdenek Dvorak 66f97d31f2 cfgloopmanip.c (remove_path, [...]): Change dom_bbs to vector.
* cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge):
	Change dom_bbs to vector.  Add argument to iterate_fix_dominators call.
	* loop-unroll.c (unroll_loop_runtime_iterations): Ditto.
	* tree-cfg.c (tree_duplicate_sese_region): Change doms to vector.
	Add argument to iterate_fix_dominators call.
	(remove_edge_and_dominated_blocks): Pass vector to bbs_to_fix_dom.
	* gcse.c (hoist_code): Change domby to vector.
	* cfghooks.c (make_forwarder_block): Change doms_to_fix to vector.
	Add argument to iterate_fix_dominators call.
	* loop-doloop.c (doloop_modify): Changed recount_dominator to
	recompute_dominator.
	* lambda-code.c (perfect_nestify): Ditto.
	* cfgloopanal.c: Include graphds.h.
	(struct edge, struct vertex, struct graph, dump_graph, new_graph,
	add_edge, dfs, for_each_edge, free_graph): Moved to graphds.c.
	(mark_irreducible_loops): Use graphds_scc.  Remove argument from
	add_edge call.
	* graphds.c: New file.
	* graphds.h: New file.
	* dominance.c: Include vecprim.h, pointer-set.h and graphds.h.
	(get_dominated_by, get_dominated_by_region): Change return type to
	vector.
	(verify_dominators): Recompute all dominators and compare the results.
	(recount_dominator): Renamed to ...
	(recompute_dominator): ... this.  Do not check that the block is
	dominated by entry.
	(iterate_fix_dominators): Reimplemented.
	(prune_bbs_to_update_dominators, root_of_dom_tree,
	determine_dominators_for_sons): New functions.
	* et-forest.c (et_root): New function.
	* et-forest.h (et_root): Declare.
	* Makefile.in (graphds.o): Add.
	(cfgloopanal.o): Add graphds.h dependency.
	(dominance.o): Add graphds.h, vecprim.h and pointer-set.h dependency.
	* basic-block.h (get_dominated_by, get_dominated_by_region,
	iterate_fix_dominators): Declaration changed.
	(recount_dominator): Renamed to ...
	(recompute_dominator): ... this.
	* tree-ssa-threadupdate.c (thread_block): Free dominance info.
	(thread_through_all_blocks): Do not free dominance info.

From-SVN: r125297
2007-06-03 19:10:44 +00:00
Zdenek Dvorak d51157deee tree-vrp.c (execute_vrp): Do not check whether current_loops == NULL.
* tree-vrp.c (execute_vrp): Do not check whether current_loops == NULL.
	* tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto.
	* ifcvt.c (if_convert): Ditto.
	* tree-ssa-threadupdate.c (thread_block): Ditto.
	(thread_through_all_blocks): Ditto.  Assert that loops were analysed.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
	verify_loop_closed_ssa): Check number_of_loops instead of current_loops.
	* predict.c (tree_estimate_probability): Ditto.
	* tree-if-conv.c (main_tree_if_conversion): Ditto.
	* tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
	* modulo-sched.c (sms_schedule): Ditto.
	* tree-scalar-evolution.c (scev_const_prop): Ditto.
	(scev_finalize): Do not do anything if scev analysis was not
	initialized.
	* cfgloopanal.c (mark_irreducible_loops): Do not check whether
	current_loops == NULL.
	(mark_loop_exit_edges): Check number_of_loops instead of current_loops.
	* loop-init.c (loop_optimizer_init): Do not free current_loops when
	there are no loops.
	(loop_optimizer_finalize): Assert that loops were analyzed.
	(rtl_move_loop_invariants, rtl_unswitch, rtl_unroll_and_peel_loops,
	rtl_doloop): Check number_of_loops instead of current_loops.
	* tree-ssa-loop.c (tree_loop_optimizer_init): Do not check whether
	current_loops == NULL.
	(tree_ssa_loop_init, tree_ssa_loop_im, tree_ssa_loop_unswitch,
	gate_tree_vectorize tree_linear_transform, check_data_deps,
	tree_ssa_loop_ivcanon, tree_ssa_empty_loop, tree_ssa_loop_bounds,
	tree_complete_unroll, tree_ssa_loop_prefetch, tree_ssa_loop_ivopts):
	Check number_of_loops instead of current_loops.
	(tree_ssa_loop_done): Do not check whether current_loops == NULL.
	* tree-ssa-pre.c (fini_pre): Do not take do_fre argument.  Always
	free loops if available.
	(execute_pre): Do not pass do_fre to fini_pre.

From-SVN: r125114
2007-05-27 17:23:11 +00:00
Zdenek Dvorak 9ba025a2c1 tree-loop-linear.c (gather_interchange_stats, [...]): Use loop_depth and loop_outer accessor functions.
* tree-loop-linear.c (gather_interchange_stats, try_interchange_loops):
	Use loop_depth and loop_outer accessor functions.
	* tree-ssa-loop-im.c (outermost_invariant_loop, set_level,
	determine_invariantness_stmt, move_computations_stmt): Ditto.
	* cfgloopmanip.c (fix_bb_placement, fix_loop_placement, remove_path,
	add_loop, loopify, unloop, fix_loop_structure): Ditto.
	* tree-ssa-loop-manip.c (find_uses_to_rename_use): Ditto.
	* tree-scalar-evolution.c (interpret_loop_phi,
	compute_scalar_evolution_in_loop, analyze_scalar_evolution_in_loop,
	instantiate_parameters_1, scev_const_prop): Ditto.
	* cfghooks.c (make_forwarder_block): Ditto.
	* cfgloopanal.c (mark_irreducible_loops, mark_loop_exit_edges): Ditto.
	* modulo-sched.c (loop_canon_p): Ditto.
	* tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg,
	slpeel_can_duplicate_loop_p): Ditto.
	* lambda-code.c (invariant_in_loop_and_outer_loops): Ditto.
	* tree-cfg.c (tree_duplicate_sese_region): Ditto.
	* cfgloop.c (flow_loop_dump, flow_loop_nodes_find, rescan_loop_exit,
	cancel_loop, verify_loop_structure): Ditto.
	(flow_loop_nested_p, superloop_at_depth, flow_loop_free,
	add_bb_to_loop, remove_bb_from_loops, find_common_loop): Use the
	superloops vector instead of "pred" array.
	(establish_preds): Take father loop as an argument.  Initialize the
	superloops vector.
	(flow_loop_tree_node_add): Pass father loop to establish_preds.  Do not
	initialize loop->outer.
	(flow_loop_tree_node_remove): Truncate the superloops vector.
	* cfgloop.h (struct loop): Removed field "outer", fields "depth" and
	"pred" merged to "superloops" vector.
	(loop_depth, loop_outer): New.
	(fel_init): Use loop_outer.

From-SVN: r124619
2007-05-11 15:52:01 +00:00
Zdenek Dvorak a154b43a81 re PR rtl-optimization/31360 (RTL loop invariant is not aggressive enough)
PR rtl-optimization/31360
	* cfgloopanal.c (target_small_cost, target_pres_cost): Removed.
	(target_reg_cost): New.
	(init_set_costs): Initialize target_reg_cost.  Add comments
	regarding the rationale of the costs.
	(global_cost_for_size): Renamed to...
	(estimate_reg_pressure_cost): ... and simplify.  Decrease importance
	of register pressure.
	* tree-ssa-loop-ivopts.c (ivopts_global_cost_for_size): Use
	estimate_reg_pressure_cost.  Add number of ivs.
	(determine_set_costs): Dump target_reg_cost.
	* loop-invariant.c (gain_for_invariant):  Use
	estimate_reg_pressure_cost.  Removed n_inv_uses argument.
	(best_gain_for_invariant, find_invariants_to_move): Remove
	n_inv_uses.
	* cfgloop.h (target_small_cost, target_pres_cost): Removed.
	(target_reg_cost): Declare.
	(global_cost_for_size): Declaration removed.
	(estimate_reg_pressure_cost): Declare.

	* gcc.dg/loop-7.c: New test.

From-SVN: r123919
2007-04-17 16:42:29 +00:00
Zdenek Dvorak ac84e05eb6 tree-ssa-loop-niter.c (idx_infer_loop_bounds): Add and use argument "reliable".
* tree-ssa-loop-niter.c (idx_infer_loop_bounds): Add and use
	argument "reliable".
	(infer_loop_bounds_from_ref, infer_loop_bounds_from_array):
	Add argument "reliable".  Propagate it through calls.
	(infer_loop_bounds_from_undefined):  Derive number of iterations
	estimates from references in blocks that do not dominate loop latch.
	(gcov_type_to_double_int): New function.
	(estimate_numbers_of_iterations_loop): Use gcov_type_to_double_int
	and expected_loop_iterations_unbounded.
	* cfgloopanal.c (expected_loop_iterations_unbounded): New function.
	(expected_loop_iterations): Use expected_loop_iterations_unbounded.
	* tree-data-ref.c (estimated_loop_iterations): Export.
	(get_references_in_stmt): Fix -- do not return addresses of local
	objects.
	* cfgloop.h (expected_loop_iterations_unbounded,
	estimated_loop_iterations): Declare.

From-SVN: r123630
2007-04-06 23:11:15 +00:00
Zdenek Dvorak 42fd6772c6 tree-vrp.c (adjust_range_with_scev): Use get_chrec_loop.
* tree-vrp.c (adjust_range_with_scev): Use get_chrec_loop.
	* loop-unswitch.c (unswitch_loops): Use FOR_EACH_LOOP.
	* tree-loop-linear.c (linear_transform_loops): Ditto.
	* tree-ssa-loop-im.c (determine_lsm): Ditto.
	* tree-ssa-loop-niter.c (estimate_numbers_of_iterations,
	free_numbers_of_iterations_estimates): Ditto.
	* tree_ssa_unswitch_loops (tree_ssa_unswitch_loops): Ditto.
	* tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize): Ditto.
	* modulo-sched.c (sms_schedule): Ditto.
	* tree-ssa-loop-ivcanon.c (canonicalize_induction_variables,
	tree_unroll_loops_completely): Ditto.
	* predict.c (predict_loops): Ditto.
	* tree-if-conv.c (main_tree_if_conversion): Ditto.
	* loop-unroll.c (unroll_and_peel_loops, peel_loops_completely,
	decide_unrolling_and_peeling): Ditto.
	* cfgloopmanip.c (unloop): Use delete_loop.
	(place_new_loop): Access larray vector instead of parray.
	(create_preheaders, force_single_succ_latches,
	fix_loop_structure): Use FOR_EACH_LOOP and delete_loop..
	* loop-doloop.c (doloop_optimize_loops): Ditto.
	* loop-invariant.c (move_loop_invariants): Ditto.
	* tree-cfg.c (replace_uses_by): Ditto.
	* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Ditto.
	* tree-chrec.h (CHREC_VAR, CHREC_LEFT, CHREC_RIGHT, CHREC_VARIABLE):
	Moved to ...
	* tree.h (CHREC_VAR, CHREC_LEFT, CHREC_RIGHT, CHREC_VARIABLE):
	... here.
	* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop,
	compute_overall_effect_of_inner_loop, chrec_is_positive): Use
	get_loop and get_chrec_loop.
	(number_of_iterations_for_all_loops): Use number_of_loops.
	(scev_initialize, scev_reset, scev_const_prop): Use FOR_EACH_LOOP.
	* tree-scalar-evolution.h (get_chrec_loop): New inline function.
	* cfgloopanal.c (mark_irreducible_loops): Use number_of_loops,
	and FOR_EACH_LOOP.
	* tree-chrec.c (evolution_function_is_invariant_rec_p,
	chrec_convert_1): Use get_loop and get_chrec_loop.
	* loop-init.c (loop_optimizer_init): Use number_of_loops.
	(loop_optimizer_init): Use FOR_EACH_LOOP.
	* tree-vectorizer.c (vect_loops_num): Removed.
	(vectorize_loops): Store number of loops locally.  Use
	FOR_EACH_LOOP and get_loop.
	* tree-vectorizer.h (vect_loops_num): Removed.
	* tree-data-ref.c (get_number_of_iters_for_loop): Use get_loop.
	(find_data_references_in_loop): Do not set parallel_p.
	* tree-data-ref.h: Do not declare VEC(loop_p).
	* cfgloop.c (flow_loops_dump, mark_single_exit_loops,
	verify_loop_structure): Use FOR_EACH_LOOP.
	(flow_loops_free): Use FOR_EACH_LOOP, free larray vector.
	(initialize_loops_parallel_p): Removed.
	(flow_loops_find): Push the loops into a vector.
	(delete_loop): New function.
	(cancel_loop): Use delete_loop.
	* cfgloop.h: Declare VEC(loop_p).
	(struct loop): Remove parallel_p field.
	(struct loops): Replace num and parray field by larray vector.
	Remove shared_headers field.
	(delete_loop): Declare.
	(get_loop, get_loops, number_of_loops, fel_next, fel_init,
	FOR_EACH_LOOP): New.
	* doc/loop.tex: Document new accessor functions.

From-SVN: r119713
2006-12-10 22:17:15 +00:00
Zdenek Dvorak d73be2683d tree-vrp.c (execute_vrp): Do not pass loops structure through arguments.
* tree-vrp.c (execute_vrp): Do not pass loops structure through
	arguments.
	* loop-unswitch.c (unswitch_loops, unswitch_single_loop,
	unswitch_loop): Ditto.
	* tree-loop-linear.c (linear_transform_loops): Ditto.
	* tree-ssa-loop-im.c (determine_lsm, tree_ssa_lim_initialize,
	tree_ssa_lim): Ditto.
	* tree-ssa-loop-niter.c (estimate_numbers_of_iterations,
	free_numbers_of_iterations_estimates): Ditto.
	* tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops,
	tree_unswitch_single_loop, tree_unswitch_loop): Ditto.
	* cfgloopmanip.c (fix_bb_placement, fix_bb_placements,
	remove_path, add_loop, loopify, unloop, fix_loop_placements,
	place_new_loop, duplicate_loop, duplicate_subloops,
	update_single_exit_for_duplicated_loops, copy_loops_to,
	duplicate_loop_to_header_edge, create_preheaders,
	force_single_succ_latches, loop_version, fix_loop_structure):
	Ditto.
	* tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge,
	tree_unroll_loop): Ditto.
	* tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
	* tree-scalar-evolution.c (select_loops_exit_conditions,
	scev_initialize, scev_analysis): Ditto.
	* tree-scalar-evolution.h (scev_initialize): Ditto.
	* cfghooks.c (cfg_hook_duplicate_loop_to_header_edge): Ditto.
	* cfgloopanal.c (mark_irreducible_loops, mark_loop_exit_edges): Ditto.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize): Ditto.
	* modulo-sched.c (sms_schedule): Ditto.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto.
	* loop-init.c (loop_optimizer_init, rtl_move_loop_invariants,
	rtl_unswitch, rtl_unroll_and_peel_loops, rtl_doloop): Ditto.
	* ifcvt.c (if_convert): Ditto.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely,
	canonicalize_loop_induction_variables,
	canonicalize_induction_variables,
	tree_unroll_loops_completely, remove_empty_loops): Ditto.
	* tree-ssa-loop.c (tree_ssa_loop_init, tree_ssa_loop_im,
	tree_ssa_loop_unswitch, tree_vectorize, tree_linear_transform,
	tree_ssa_loop_ivcanon, tree_ssa_empty_loop, tree_ssa_loop_bounds,
	tree_complete_unroll, tree_ssa_loop_prefetch, tree_ssa_loop_ivopts,
	tree_ssa_loop_done): Ditto.
	* predict.c (predict_loops, tree_estimate_probability, estimate_loops,
	estimate_bb_frequencies): Ditto.
	* tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg,
	slpeel_tree_peel_loop_to_edge, vectorize_loops): Ditto.
	* loop-unroll.c (unroll_and_peel_loops, peel_loops_completely,
	decide_unrolling_and_peeling, peel_loop_completely,
	unroll_loop_constant_iterations, unroll_loop_runtime_iterations,
	peel_loop_simple, unroll_loop_stupid): Ditto.
	* loop-doloop.c (doloop_optimize_loops): Ditto.
	* tree-cfgcleanup.c (cleanup_tree_cfg_loop): Ditto.
	* loop-invariant.c (move_loop_invariants): Ditto.
	* tree-ssa-dce.c (tree_ssa_dce_loop): Ditto.
	* tree-ssa-loop-prefetch.c (loop_prefetch_arrays,
	tree_ssa_prefetch_arrays): Ditto.
	* lambda-code.c (gcc_loopnest_to_lambda_loopnest, perfect_nestify):
	Ditto.
	* tree-vect-transform.c (vect_do_peeling_for_loop_bound,
	vect_do_peeling_for_alignment, vect_transform_loop): Ditto.
	* cfgloop.c (flow_loops_cfg_dump, flow_loops_dump,
	mark_single_exit_loops, cancel_loop, cancel_loop_tree,
	verify_loop_structure): Ditto.
	* tree-flow.h (vectorize_loops, tree_ssa_lim, tree_ssa_unswitch_loops,
	canonicalize_induction_variables, tree_unroll_loops_completely,
	tree_ssa_prefetch_arrays, remove_empty_loops, tree_ssa_iv_optimize,
	estimate_numbers_of_iterations, free_numbers_of_iterations_estimates,
	tree_duplicate_loop_to_header_edge, tree_ssa_loop_version,
	tree_unroll_loop, linear_transform_loops): Declaration changed.
	* basic-block.h: Remove declaration of struct loops.
	* cfghooks.h (struct cfg_hooks): Change type of
	cfg_hook_duplicate_loop_to_header_edge.
	(cfg_hook_duplicate_loop_to_header_edge): Declaration changed.
	* tree-vectorizer.h (slpeel_tree_peel_loop_to_edge,
	vect_transform_loop): Declaration changed.
	* lambda.h (gcc_loopnest_to_lambda_loopnest): Declaration changed.
	* cfgloop.h (flow_loops_dump, fix_loop_structure,
	mark_irreducible_loops, mark_single_exit_loops, mark_loop_exit_edges,
	cancel_loop_tree, create_preheaders, force_single_succ_latches,
	verify_loop_structure, duplicate_loop, duplicate_loop_to_header_edge,
	loopify, loop_version, remove_path, unswitch_loops,
	unroll_and_peel_loops, doloop_optimize_loops, move_loop_invariants):
	Declaration changed.

From-SVN: r119189
2006-11-25 10:34:13 +00:00
Zdenek Dvorak 598ec7bdbe tree-vrp.c (execute_vrp): Do not update current_loops.
* tree-vrp.c (execute_vrp): Do not update current_loops.
	* loop-unswitch.c (unswitch_loop): Do not use loop_split_edge_with.
	* doc/loop.texi: Remove documentation for cancelled functions.
	* tree-ssa-loop-im.c (loop_commit_inserts): Removed.
	(move_computations, determine_lsm): Use bsi_commit_edge_inserts
	instead.
	* cfgloopmanip.c (remove_bbs): Do not update loops explicitly.
	(remove_path): Ensure that in delete_basic_blocks, the loops
	are still allocated.
	(add_loop): Work on valid loop structures.
	(loopify): Modify call of add_loop.
	(mfb_update_loops): Removed.
	(create_preheader): Do not update loops explicitly.
	(force_single_succ_latches, loop_version): Do not use
	loop_split_edge_with.
	(loop_split_edge_with): Removed.
	* tree-ssa-loop-manip.c (create_iv, determine_exit_conditions):
	Do not use bsi_insert_on_edge_immediate_loop.
	(split_loop_exit_edge, tree_unroll_loop): Do not use
	loop_split_edge_with.
	(bsi_insert_on_edge_immediate_loop): Removed.
	* tree-ssa-loop-ch.c (copy_loop_headers): Use current_loops.  Do not
	use loop_split_edge_with.
	* cfghooks.c: Include cfgloop.h.
	(verify_flow_info): Verify that loop_father is filled iff current_loops
	are available.
	(redirect_edge_and_branch_force, split_block, delete_basic_block,
	split_edge, merge_blocks, make_forwarder_block, duplicate_block):
	Update cfg.
	* cfgloopanal.c (mark_irreducible_loops): Work if the function contains
	no loops.
	* modulo-sched.c (generate_prolog_epilog, canon_loop): Do not use
	loop_split_edge_with.
	(sms_schedule): Use current_loops.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Use current_loops.
	* loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Set
	current_loops.
	(rtl_loop_init, rtl_loop_done): Do not set current_loops.
	* tree-ssa-sink.c (execute_sink_code): Use current_loops.
	* ifcvt.c (if_convert): Ditto.
	* predict.c (predict_loops): Do not clear current_loops.
	(tree_estimate_probability): Use current_loops.
	(propagate_freq): Receive head of the region to propagate instead of
	loop.
	(estimate_loops_at_level): Do not use shared to_visit bitmap.
	(estimate_loops): New function.  Handle case current_loops == NULL.
	(estimate_bb_frequencies): Do not allocate tovisit.  Use
	estimate_loops.
	* tree-ssa-loop.c (current_loops): Removed.
	(tree_loop_optimizer_init): Do not return loops.
	(tree_ssa_loop_init, tree_ssa_loop_done): Do not set current_loops.
	* tree-vectorizer.c (slpeel_update_phi_nodes_for_guard1,
	slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge):
	Do not update loops explicitly.
	* function.h (struct function): Add x_current_loops field.
	(current_loops): New macro.
	* tree-if-conv.c (combine_blocks): Do not update loops explicitly.
	* loop-unroll.c (split_edge_and_insert): New function.
	(unroll_loop_runtime_iterations, analyze_insns_in_loop): Do not
	use loop_split_edge_with.
	* loop-doloop.c (add_test, doloop_modify): Ditto.
	* tree-ssa-pre.c (init_pre, fini_pre): Do not set current_loops.
	* cfglayout.c (copy_bbs): Do not update loops explicitly.
	* lambda-code.c (perfect_nestify): Do not use loop_split_edge_with.
	* tree-vect-transform.c (vect_transform_loop): Do not update loops
	explicitly.
	* cfgloop.c (flow_loops_cfg_dump): Do not dump dfs_order and rc_order.
	(flow_loops_free): Do not free dfs_order and rc_order.
	(flow_loops_find): Do not set dfs_order and rc_order in loops
	structure.  Do not call loops and flow info verification.
	(add_bb_to_loop, remove_bb_from_loops): Check whether the block
	already belongs to some loop.
	* cfgloop.h (struct loops): Remove struct cfg.
	(current_loops, loop_split_edge_with): Declaration removed.
	(loop_optimizer_init, loop_optimizer_finalize): Declaration changed.
	* tree-flow.h (loop_commit_inserts, bsi_insert_on_edge_immediate_loop):
	Declaration removed.
	* Makefile.in (cfghooks.o): Add CFGLOOP_H dependency.
	* basic-block.h (split_edge_and_insert): Declare.
	* tree-cfg.c (remove_bb): Do not update loops explicitly.

From-SVN: r118931
2006-11-17 11:29:17 +00:00
Roger Sayle 83f676b352 pointer-set.c (pointer_set_destroy): Correct whitespace.
* pointer-set.c (pointer_set_destroy): Correct whitespace.
	* cfgloopanal.c (dump_graph): Likewise.
	* dojump.c (discard_pending_stack_adjust): Likewise.
	* fix-header.c (TARGET_EXTRA_INCLUDE, TARGET_EXTRA_PRE_INCLUDES):
	Likewise.
	* alloc-pool.c (dump_alloc_pool_statistics): Likewise.
	* function.c (finalize_block_changes): Likewise.
	* gcc-common.c (ggc_free_overhead, dump_gcc_loc_statistics): Likewise.
	* tree-ssa-dce.c (clear_control_dependence_bitmap): Likewise.
	* rtl.c (dump_rtx_statistics): Likewise.
	* tree-ssa-structalias.c (sort_fieldstack, init_alias_heapvars): 
	Likewise.
	* varray.c (dump_varray_statistics): Likewise.
	* dfp.c (encode_decimal32, decode_decimal32, encode_decimal64,
	decode_decimal64, encode_decimal128, decode_decimal128,
	decimal_real_to_decimal): Likewise.

From-SVN: r115258
2006-07-07 14:23:57 +00:00
Mike Stump c22cacf346 Whitespace fixups
From-SVN: r113893
2006-05-18 22:16:23 +00:00
Marcin Dalecki 5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

	* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
	* regrename.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-dump.c: Ditto.
	* tree-complex.c: Ditto.
	* genrecog.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tracer.c: Ditto.
	* java/class.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.
	* java/except.c: Ditto.
	* java/jvspec.c: Ditto.
	* java/jcf-write.c: Ditto.
	* java/jcf-path.c: Ditto.
	* java/gjavah.c: Ditto.
	* java/zextract.c: Ditto.
	* java/jcf-io.c: Ditto.
	* java/jcf.h: Ditto.
	* java/buffer.c: Ditto.
	* java/lang.c: Ditto.
	* java/parse-scan.y: Ditto.
	* java/lex.c: Ditto.
	* java/lex.h: Ditto.
	* cfgloopmanip.c: Ditto.
	* postreload-gcse.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* postreload.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* loop.c: Ditto.
	* ipa-cp.c: Ditto.
	* cppspec.c: Ditto.
	* diagnostic.c: Ditto.
	* final.c: Ditto.
	* genoutput.c: Ditto.
	* gcc.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloopanal.c: Ditto.
	* objc/objc-act.c: Ditto.
	* gcov.c: Ditto.
	* genextract.c: Ditto.
	* genautomata.c: Ditto.
	* pretty-print.c: Ditto.
	* genemit.c: Ditto.
	* cgraphunit.c: Ditto.
	* flow.c: Ditto.
	* df-scan.c: Ditto.
	* haifa-sched.c: Ditto.
	* dominance.c: Ditto.
	* dbxout.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* df-core.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* graph.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* cse.c: Ditto.
	* fix-header.c: Ditto.
	* web.c: Ditto.
	* tree-stdarg.c: Ditto.
	* ipa-utils.c: Ditto.
	* loop-init.c: Ditto.
	* ipa-inline.c: Ditto.
	* cfganal.c: Ditto.
	* global.c: Ditto.
	* alloc-pool.c: Ditto.
	* dwarf2out.c: Ditto.
	* opts.c: Ditto.
	* genattrtab.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* predict.c: Ditto.
	* timevar.c: Ditto.
	* lcm.c: Ditto.
	* fortran/gfortranspec.c: Ditto.
	* regmove.c: Ditto.
	* local-alloc.c: Ditto.
	* langhooks.c: Ditto.
	* function.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* gcse.c: Ditto.
	* ipa-type-escape.c: Ditto.
	* alias.c: Ditto.
	* tree-if-conv.c: Ditto.
	* profile.c: Ditto.
	* ipa.c: Ditto.
	* tree-data-ref.c: Ditto.
	* loop-unroll.c: Ditto.
	* treelang/treetree.c: Ditto.
	* calls.c: Ditto.
	* bt-load.c: Ditto.
	* ggc-common.c: Ditto.
	* except.c: Ditto.
	* coverage.c: Ditto.
	* cselib.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* cfgcleanup.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* ipa-prop.c: Ditto.
	* print-tree.c: Ditto.
	* conflict.c: Ditto.
	* ggc-page.c: Ditto.
	* sched-deps.c: Ditto.
	* regclass.c: Ditto.
	* tree-object-size.c: Ditto.
	* combine.c: Ditto.
	* bb-reorder.c: Ditto.
	* resource.c: Ditto.
	* var-tracking.c: Ditto.
	* cfgloop.c: Ditto.
	* df-problems.c: Ditto.
	* reg-stack.c: Ditto.
	* tlink.c: Ditto.
	* gccspec.c: Ditto.
	* sched-rgn.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/arm/arm.c: Ditto.
	* cfgrtl.c: Ditto.
	* collect2.c: Ditto.
	* reload1.c: Ditto.

From-SVN: r110446
2006-01-31 20:56:55 +01:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Zdenek Dvorak 6c878b231d cfgloop.h (just_once_each_iteration_p): Declaration changed.
* cfgloop.h (just_once_each_iteration_p): Declaration changed.
	* cfgloopanal.c (just_once_each_iteration_p): Make the loop argument
	const.

From-SVN: r99849
2005-05-17 19:48:50 +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
Zdenek Dvorak 2ff3e3255a cfgloopanal.c (mark_loop_exit_edges): Clean EDGE_LOOP_EXIT flag for edges outside any loops.
* cfgloopanal.c (mark_loop_exit_edges): Clean EDGE_LOOP_EXIT
	flag for edges outside any loops.

From-SVN: r97348
2005-03-31 20:34:24 +00:00
Kazu Hirata 613c5cd0c6 cfgloop.h, [...]: Update copyright.
* cfgloop.h, cfgloopanal.c, cfgloopmanip.c, conflict.c,
	loop-init.c, loop-unroll.c, print-tree.c, reg-notes.def,
	config/m68k/m68k.c, config/mips/mips.h,
	config/rs6000/rs6000-protos.h, doc/contrib.texi,
	doc/include/gcc-common.texi: Update copyright.

From-SVN: r95781
2005-03-02 14:03:44 +00:00
Zdenek Dvorak 70388d9433 cfgloop.c (flow_loop_entry_edges_find, [...]): Removed.
* cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find,
	flow_loop_pre_header_scan, flow_loop_pre_header_find,
	flow_loop_scan): Removed.
	(flow_loop_dump): Do not dump removed fields.
	(flow_loop_free): Do not free removed fields.
	(flow_loops_find): Flags argument removed.  Do not call flow_loop_scan.
	(loop_exit_edge_p): New function.
	* cfgloop.h (struct loop): Removed fields pre_header, pre_header_edges,
	num_pre_header_edges, entry_edges, num_entries, exit_edges,
	num_exits, exits_doms.
	(LOOP_TREE, LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES,
	LOOP_EDGES, LOOP_ALL): Removed.
	(flow_loop_scan): Declaration removed.
	(loop_exit_edge_p, mark_loop_exit_edges): Declare.
	* cfgloopmanip.c (create_loop_notes): Do not pass flags to
	flow_loops_find.
	* ifcvt.c (mark_loop_exit_edges): Moved to cfgloopanal.c.
	(if_convert): Call flow_loops_find and flow_loops_free
	when calling mark_loop_exit_edges.
	* cfgloopanal.c (mark_loop_exit_edges): Moved from
	ifcvt.c.  Removed the flow_loops_find, flow_loops_free and
	free_dominance_info calls.
	* loop-init.c (flow_loops_find): Ditto.
	* passes.c (rest_of_handle_branch_prob): Ditto.
	* lambda-code.c (perfect_nestify): Do not call flow_loops_find.
	* loop-unroll.c (analyze_insns_in_loop): Do not use
	EDGE_LOOP_EXIT.
	* predict.c (predict_loops): Do not call flow_loop_scan.
	Use get_loop_exit_edges.
	(tree_estimate_probability): Do not pass flags to flow_loops_find.
	* tree-if-conv.c (bb_with_exit_edge_p): Take loop as argument.
	Do not use EDGE_LOOP_EXIT.
	(tree_if_convert_cond_expr, if_convertible_modify_expr_p): Pass loop
	to bb_with_exit_edge_p.
	(if_convertible_loop_p): Do not call flow_loop_scan.  Use
	loop->single_exit.  Do not use EDGE_LOOP_EXIT.  Pass loop
	to bb_with_exit_edge_p.
	(combine_blocks): Pass loop to bb_with_exit_edge_p.  Do not use
	EDGE_LOOP_EXIT.
	* tree-loop-linear.c (linear_transform_loops): Do not call
	flow_loop_scan.  Use loop->single_exit.
	* tree-vect-analyze.c (vect_analyze_operations): Use loop->single_exit.
	(vect_analyze_loop_form): Do not call flow_loop_scan.
	* tree-vect-transform.c (vect_update_ivs_after_vectorizer): Use
	loop->single_exit.
	(vect_do_peeling_for_loop_bound): Use loop_preheader_edge and
	loop->single_exit.
	* tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop,
	slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p,
	slpeel_tree_duplicate_loop_to_edge_cfg,
	slpeel_verify_cfg_after_peeling, slpeel_tree_peel_loop_to_edge):
	Use loop_preheader_edge and loop->single_exit.  Do not call
	flow_loop_scan.

From-SVN: r95738
2005-03-01 13:44:46 +00: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
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
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
Zdenek Dvorak 8b11a64cd9 tree-ssa-loop-ivopts.c: New file.
* tree-ssa-loop-ivopts.c: New file.
	* Makefile.in (tree-ssa-loop-ivopts.c): Add.
	* cfgloop.h (target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): Declare.
	* cfgloopanal.c (avail_regs, res_regs, small_cost, pres_cost,
	spill_cost): Renamed to ...
	(target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): ... and exported.
	(init_set_costs, global_cost_for_size): Work with renamed variables.
	* common.opt (flag_ivopts): New flag.
	* expr.c (expand_expr_real_1): Handle SSA_NAME case.  Handle
	REF_ORIGINAL.
	* gimplify.c (struct gimplify_ctx): Add into_ssa field.
	(internal_get_tmp_var, gimplify_modify_expr, gimplify_expr): Support
	generating SSA form.
	(force_gimple_operand): New function.
	* timevar.def (TV_TREE_LOOP_IVOPTS): New timevar.
	* tree-cfg.c (stmt_bsi): New function.
	* params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): New.
	* tree-flow.h (stmt_bsi, tree_ssa_iv_optimize, split_loop_exit_edge,
	bsi_insert_on_edge_immediate_loop. standard_iv_increment_position,
	ip_end_pos, ip_normal_pos, force_gimple_operand): Declare.
	* tree-gimple.c (is_gimple_formal_tmp_var): Accept ssa names.
	* tree-nested.c (build_addr): Export.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_iv_optimize.
	* tree-pass.h (pass_iv_optimize): Declare.
	* tree-ssa-loop-im.c (for_each_index): Handle REALPART_EXPR and
	IMAGPART_EXPR.
	* tree-ssa-loop-manip.c (create_iv): Force the base to be acceptable
	as a phi node argument.
	(split_loop_exit_edge, bsi_insert_on_edge_immediate_loop,
	ip_end_pos, ip_normal_pos, standard_iv_increment_position): New
	functions.
	* tree-ssa-loop-niter.c (zero_p, unsigned_type_for): Export.
	* tree-ssa-loop.c (tree_ssa_loop_ivopts, gate_tree_ssa_loop_ivopts,
	pass_iv_optimize): New pass.
	* tree-ssa-operands.c (get_indirect_ref_operands): Handle REF_ORIGINAL.
	* tree-ssanames.c (release_ssa_name): Allow calling with var = NULL.
	* tree.c (build_int_cst_type, cst_and_fits_in_hwi): New functions.
	* tree.h (REF_ORIGINAL): New macro.
	(build_int_cst_type, unsigned_type_for, zero_p,
	cst_and_fits_in_hwi, build_addr): Declare.
	* doc/invoke.texi (-fivopts): Document.
	(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): Document.
	* doc/passes.texi: Document induction variable optimizations pass.

	* gcc.dg/tree-ssa/loop-2.c: New test.
	* gcc.dg/tree-ssa/loop-3.c: New test.
	* gcc.dg/tree-ssa/loop-4.c: New test.
	* gcc.dg/tree-ssa/loop-5.c: New test.

From-SVN: r87100
2004-09-05 09:25:37 +00:00
Zdenek Dvorak 5e96277660 loop-invariant.c: New file.
* loop-invariant.c: New file.
	* Makefile.in (loop-invariant.o): New.
	* cfgloop.h (global_cost_for_size, init_set_costs,
	move_loop_invariants): Declare.
	* cfgloopanal.c (seq_cost, init_set_costs, global_cost_for_size): New
	functions.
	(avail_regs, res_regs, small_cost, pres_cost, spill_cost): New
	variables.
	* common.opt (floop-optimize2, fmove-loop-invariants): New options.
	* loop-init.c (loop_optimizer_init): Call init_set_costs.
	* passes.c (rest_of_handle_loop2): Call move_loop_invariants.
	(rest_of_compilation): Check flag_loop_optimize2.
	* toplev.c (process_options): Handle flag_loop_optimize2.
	* doc/invoke.texi (-floop-optimize2, -fmove-loop-invariants): Document.
	* doc/passes.texi (loop-invariant.c): Document.

From-SVN: r83419
2004-06-20 21:31:32 +00:00
Jan Hubicka bade3a0018 cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro
* cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro
      * cfgloopanal.c (expected_loop_iterations): Change the return value

From-SVN: r81058
2004-04-22 21:46:48 +00:00
Zdenek Dvorak 689ba89dd8 doloop.c: Removed.
* doloop.c: Removed.
	* loop-doloop.c: New file.
	* Makefile.in (doloop.o): Remove.
	(loop-doloop.o): New.
	* cfgloop.h (get_loop_level, doloop_optimize_loops): Declare.
	* cfgloopanal.c (get_loop_level): New function.
	* loop-iv.c (iv_number_of_iterations): Handle case when loop
	is leaved immediatelly.
	* loop.c (strength_reduce): Do not call doloop optimization.
	* loop.h (LOOP_BCT): Removed.
	* passes.c (rest_of_handle_loop_optimize): Do not use LOOP_BCT.
	(rest_of_handle_loop2): Call doloop_optimize_loops.
	(rest_of_compilation): Test for optimizations moved to
	rest_of_handle_loop2.

From-SVN: r79625
2004-03-18 16:42:34 +00:00
Zdenek Dvorak f2dca5108e cfgloop.h (struct loop_desc): Removed.
* cfgloop.h (struct loop_desc): Removed.
	(struct loop): Fields simple, desc and has_desc removed.
	(simple_loop_p, count_loop_iterations): Declaration removed.
	* cfgloopanal.c (struct unmark_altered_insn_data): Removed.
	(unmark_altered, blocks_invariant_registers, unmark_altered_insn
	blocks_single_set_registers, invariant_rtx_wrto_regs_p_helper,
	invariant_rtx_wrto_regs_p, test_for_iteration, constant_iterations,
	simple_loop_exit_p, variable_initial_value, variable_initial_values,
	simple_condition_p, simple_increment, count_strange_loop_iterations,
	inverse, fits_in_mode_p, simple_loop_p, count_loop_iterations):
	Removed.
	* loop-iv.c (check_simple_exit, find_simple_exit): Update comments.

From-SVN: r78777
2004-03-02 20:21:14 +00:00
Richard Henderson c263766cf3 toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
        * bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
        cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
        config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
        config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
        loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
        ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
        toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
        s/rtl_dump_file/dump_file/g.

From-SVN: r78399
2004-02-24 15:40:03 -08:00
Kazu Hirata aa335b7641 cfgloop.h, [...]: Update copyright.
gcc/
	* cfgloop.h, cfgloopanal.c, cpplex.c, except.h, loop-init.c,
	loop-unroll.c, scan-decls.c, scan.h, stor-layout.c,
	xcoffout.c, xcoffout.h, config/arm/mmintrin.h,
	config/mips/linux64.h, config/pa/pa-64.h,
	config/rs6000/aix51.h, config/rs6000/aix52.h,
	config/rs6000/spe.md, config/sparc/linux.h,
	config/sparc/linux64.h: Update copyright.

gcc/cp/
	* cp-tree.def, cvt.c: Update copyright.

From-SVN: r78032
2004-02-18 15:05:17 +00:00
Zdenek Dvorak cfbe3efe45 cfgloopanal.c (mark_irreducible_loops): Rewriten.
* cfgloopanal.c (mark_irreducible_loops): Rewriten.
	(struct edge, struct vertex, struct graph): New.
	(dump_graph, new_graph, add_edge, dfs, check_irred, for_each_edge,
	free_graph): New functions.

From-SVN: r77755
2004-02-13 11:19:09 +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
Zdenek Dvorak bf86d71e8a re PR rtl-optimization/13159 (FAIL: gcc.c-torture/compile/930621-1.c)
PR opt/13159
	* cfgloopanal.c (mark_irreducible_loops): Fix the strongly connected
	components detection.
	* loop-unswitch.c (unswitch_loop): Preserve simple preheaders.

	* gcc.c-torture/compile/20031227-1.c: New test.

From-SVN: r75174
2003-12-27 19:51:17 +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
Zdenek Dvorak 142d1f57d6 cfgloopanal.c (variable_initial_value, [...]): Record the fact that initial value is extended from inner mode.
* cfgloopanal.c (variable_initial_value, variable_initial_values,
	simple_loop_exit_p): Record the fact that initial value is extended
	from inner mode.
	(count_strange_loop_iterations, count_loop_iterations): Handle
	ivs that iterate in a narrower mode. Fix handling of overflows.
	Improve handling of NE conditions.
	(inverse, fits_in_mode_p): New static functions.
	(simple_increment): Detect variables that iterate in a narrower mode.
	* cfgloop.h (struct loop_desc): Fields inner_mode and extend added.

From-SVN: r73275
2003-11-05 18:10:44 +00:00
Kazu Hirata 0ee55ad88a c-pretty-print.c: Fix comment formatting.
* c-pretty-print.c: Fix comment formatting.
	* cfglayout.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cppcharset.c: Likewise.
	* dbxout.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc.h: Likewise.
	* target.h: Likewise.

From-SVN: r72110
2003-10-05 13:09:48 +00:00
Roger Sayle 0c6d17eca1 re PR bootstrap/12269 (Mainline failed to bootstrap on Linux/ia64)
PR bootstrap/12269
	* simplify-rtx.c (simplify_gen_relational): Allow the cmp_mode
	argument to be VOIDmode, taking the mode of the comparison from
	the operands.  Only call simplify_relational_operation if we
	know the mode of the comparison.  Honor FLOAT_STORE_FLAG_VALUE
	if comparison has a floating point result.  Ensure that the
	result is always of the specified mode.
	(simplify_replace_rtx): Simplify call to simplify_gen_relational.
	(simplify_unary_operation): Ensure the correct mode and cmp_mode
	are always passed to simplify_gen_relational.  Simplify NOT of
	comparison operator in any mode, not just BImode.
	(simplify_ternary_operation): Correct tests on the return value
	of simplify_relational_operation to use const_true_rtx, not
	const1_rtx.  Abort if it ever returns a non-constant result.

	* cfgloopanal.c (count_strange_loop_iterations): Use the function
	simplify_relational_operation, not simplify_gen_relational, if
	we're only interested in constant comparisons and will ignore
	non-constant results.

From-SVN: r71439
2003-09-16 17:16:25 +00:00
Zdenek Dvorak ec6ec6aaab re PR rtl-optimization/10914 (unswitch loops does not work on powerpc)
2003-09-12  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

        PR optimization/10914
        * expr.h (get_condition, canonicalize_condition): Declaration changed.
        * cfgloopanal.c (simple_loop_exit_p): Add parameter to a get_condition
        and canonicalize_condition calls.
        * gcse.c (fis_get_condition, delete_null_pointer_checks_1,
        delete_null_pointer_checks): Ditto.
        * ifcvt.c (noce_get_alt_condition, noce_get_condition): Ditto.
        * predict.c (estimate_probability, expected_value_to_br_prob): Ditto.
        * loop.c (check_dbra_loop, get_condition_for_loop): Ditto.
        (canonicalize_condition, get_condition): Allow to return comparisons
        of cc mode registers.
        * loop-unswitch.c (may_unswitch_on_p, unswitch_single_loop): Allow
        cc mode registers comparison in condition.

From-SVN: r71398
2003-09-14 18:55:53 -07:00
Kazu Hirata a98ebe2e37 builtins.c: Fix comment typos.
* builtins.c: Fix comment typos.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-pretty-print.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cgraphunit.c: Likewise.
	* cppfiles.c: Likewise.
	* dwarfout.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* haifa-sched.c: Likewise.
	* pretty-print.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.

From-SVN: r70583
2003-08-19 23:22:00 +00:00
Andreas Jaeger f55ade6e34 basic-block.h: Convert prototypes to ISO C90.
* basic-block.h: Convert prototypes to ISO C90.
	* c-parse.in: Likewise.
	* c-pragma.h: Likewise.
	* c-typeck.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloopanal.c: Likewise.
	* dbxout.h: Likewise.
	* debug.h: Likewise.
	* dwarf2asm.h: Likewise.
	* gcov.c: Likewise.
	* gengtype-lex.l: Likewise.
	* sched-int.h: Likewise.
	* timevar.c: Likewise.

From-SVN: r69010
2003-07-06 20:59:38 +02:00
Zdenek Dvorak 72d4a2ad78 cfgloopanal.c (count_strange_loop_iterations): New static function.
* cfgloopanal.c (count_strange_loop_iterations): New static function.
	(constant_iterations, count_loop_iterations, simple_loop_exit_p):
	Handle strange loops.

From-SVN: r68930
2003-07-04 18:53:41 +00:00