* tree-vrp.c (execute_vrp): Do not pass dump argument to.
loop_optimizer_init and loop_optimizer_finalize
* tree-ssa-sink.c (execute_sink_code): Ditto.
* tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
* tree-ssa-loop.c (tree_loop_optimizer_init, tree_ssa_loop_init,
tree_ssa_loop_done): Ditto.
* tree-ssa-pre.c (init_pre, fini_pre): Ditto.
* sched-ebb.c: Include output.h.
(schedule_ebbs): Do not use dump argument.
* value-prof.h (struct profile_hooks): Remove profile_dump_file.
* loop.c (loop_dump_stream): Removed.
(loop_optimize, rest_of_handle_loop_optimize): Do not use dump
argument.
(scan_loop, move_movables, find_and_verify_loops, mark_loop_jump,
emit_prefetch_instructions, loop_bivs_find, loop_bivs_check,
final_biv_value, loop_biv_eliminable_p, loop_givs_rescan,
loop_iterations, strength_reduce, record_biv, record_giv,
final_giv_value, check_final_value, check_ext_dependent_givs,
combine_givs, check_dbra_loop, maybe_eliminate_biv, load_mems,
try_copy_prop, loop_delete_insns, try_swap_copy_prop): Use
dump_file instead of loop_dump_stream.
* ddg.c (print_ddg_edge, print_ddg, vcg_print_ddg): Do not call
argument dump_file.
* reorg.c (dbr_schedule, rest_of_handle_delay_slots): Do not use
dump argument.
* flow.c (life_analysis, rest_of_handle_life): Ditto.
* haifa-sched.c: Include output.h
(schedule_insns, sched_init): Do not use dump argument.
* mode-switching.c (optimize_mode_switching): Ditto.
* modulo-sched.c (stats_file): Removed.
(print_node_sched_params): Do not call argument dump_file.
(sms_schedule_by_order, loop_canon_p, sms_schedule,
rest_of_handle_sms): Do not use dump argument. Use dump_file instead
of stats_file.
* cse.c (cse_main, rest_of_handle_cse, rest_of_handle_cse2): Do not
use dump argument.
* loop-init.c (loop_optimizer_init, loop_optimizer_finalize,
rtl_loop_init, rtl_loop_done): Ditto.
* global.c (global_alloc, rest_of_handle_global_alloc): Ditto.
* predict.c (combine_predictions_for_bb, tree_estimate_probability):
Ditto.
* recog.c (peephole2_optimize, rest_of_handle_peephole2): Ditto.
* lcm.c (pre_edge_lcm, pre_edge_rev_lcm): Ditto.
* regmove.c (fixup_match_1, fixup_match_2, regmove_optimize,
rest_of_handle_regmove, rest_of_handle_stack_adjustments): Ditto.
* emit-rtl.c (renumber_insns): Ditto.
* cfgexpand.c (add_reg_br_prob_note, expand_gimple_cond_expr,
expand_gimple_basic_block, tree_expand_cfg): Ditto.
* regclass.c (regclass): Ditto.
* tree-outof-ssa.c (analyze_edges_for_bb, perform_edge_inserts,
remove_ssa_form, rewrite_out_of_ssa): Ditto.
* reg-stack.c (compensate_edge, compensate_edges, convert_regs_1,
convert_regs_2, convert_regs, reg_to_stack, rest_of_handle_stack_regs):
Ditto.
* sched-rgn.c (schedule_insns, rest_of_handle_sched): Ditto.
* local-alloc.c (rest_of_handle_local_alloc): Do not pass dump_file
to regclass.
* gcse.c (gcse_file, debug_stderr): Removed.
(gcse_main, bypass_jumps, rest_of_handle_jump_bypass,
rest_of_handle_gcse): Do not use dump argument.
(cprop_jump, cprop_insn, do_local_cprop, cprop, find_implicit_sets,
one_cprop_pass, bypass_block, compute_pre_data, insert_insn_end_bb,
pre_edge_insert, pre_insert_copy_insn, pre_delete, one_pre_gcse_pass,
compute_code_hoist_vbeinout, compute_code_hoist_data,
one_code_hoisting_pass, trim_ld_motion_mems, update_ld_motion_stores,
compute_store_table, build_store_vectors, insert_insn_start_bb,
insert_store, remove_reachable_equiv_notes, replace_store_insn,
store_motion): Use dump_file instead of gcse_file.
* ipa-type-escape.c (type_escape_execute): Remove debugging comments.
* profile.c (profile_dump_file): Removed.
(branch_prob): Use dump_file instead of profile_dump_file.
* ipa.c (cgraph_remove_unreachable_nodes): Do not call argument
dump_file.
* tree-ssa-copy.c (dump_copy_of): Ditto.
* rtl-factoring.c (rtl_seqabstr, rest_of_rtl_seqabstr): Do not pass
dump file to life_analysis.
* bt-load.c (branch_target_load_optimize): Ditto.
* cfgcleanup.c (rest_of_handle_jump2): Do not pass dump_file to
renumber_insns.
* rtl.h (cse_main, renumber_insns, schedule_insns, schedule_ebbs,
regclass, dbr_schedule): Declaration changed.
* sched-int.h (sched_init): Declaration changed.
* tree-profile.c (tree_profile_dump_file): Removed.
(tree_profile_hooks): Removed profile_dump_file hook.
* rtl-profile (rtl_profile_dump_file): Removed.
(rtl_profile_hooks): emoved profile_dump_file hook.
* cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Declaration
changed.
* c-gimplify.c (c_genericize): Do not call local variable dump_file.
* tree-cfg.c (build_tree_cfg): Ditto.
* Makefile.in (haifa-sched.o, sched-ebb.o): Add output.h dependency.
* basic-block.h (life_analysis, pre_edge_lcm, pre_edge_rev_lcm):
Declaration changed.
* config/sh/sh.c (sh_output_mi_thunk): Do not pass dump_file to
life_analysis and schedule_insns.
* config/m68hc11/m68hc11.c (m68hc11_reorg): Do not pass dump_file to
life_analysis.
* config/mt/mt.c (mt_machine_reorg): Do not pass dump_file to
dbr_schedule.
* config/mips/mips.c (mips_reorg): Ditto.
* config/ia64/ia64.c (ia64_reorg): Do not pass dump_file to
schedule_ebbs.
From-SVN: r110656
+2006-02-06 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-vrp.c (execute_vrp): Do not pass dump argument to.
+ loop_optimizer_init and loop_optimizer_finalize
+ * tree-ssa-sink.c (execute_sink_code): Ditto.
+ * tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
+ * tree-ssa-loop.c (tree_loop_optimizer_init, tree_ssa_loop_init,
+ tree_ssa_loop_done): Ditto.
+ * tree-ssa-pre.c (init_pre, fini_pre): Ditto.
+ * sched-ebb.c: Include output.h.
+ (schedule_ebbs): Do not use dump argument.
+ * value-prof.h (struct profile_hooks): Remove profile_dump_file.
+ * loop.c (loop_dump_stream): Removed.
+ (loop_optimize, rest_of_handle_loop_optimize): Do not use dump
+ argument.
+ (scan_loop, move_movables, find_and_verify_loops, mark_loop_jump,
+ emit_prefetch_instructions, loop_bivs_find, loop_bivs_check,
+ final_biv_value, loop_biv_eliminable_p, loop_givs_rescan,
+ loop_iterations, strength_reduce, record_biv, record_giv,
+ final_giv_value, check_final_value, check_ext_dependent_givs,
+ combine_givs, check_dbra_loop, maybe_eliminate_biv, load_mems,
+ try_copy_prop, loop_delete_insns, try_swap_copy_prop): Use
+ dump_file instead of loop_dump_stream.
+ * ddg.c (print_ddg_edge, print_ddg, vcg_print_ddg): Do not call
+ argument dump_file.
+ * reorg.c (dbr_schedule, rest_of_handle_delay_slots): Do not use
+ dump argument.
+ * flow.c (life_analysis, rest_of_handle_life): Ditto.
+ * haifa-sched.c: Include output.h
+ (schedule_insns, sched_init): Do not use dump argument.
+ * mode-switching.c (optimize_mode_switching): Ditto.
+ * modulo-sched.c (stats_file): Removed.
+ (print_node_sched_params): Do not call argument dump_file.
+ (sms_schedule_by_order, loop_canon_p, sms_schedule,
+ rest_of_handle_sms): Do not use dump argument. Use dump_file instead
+ of stats_file.
+ * cse.c (cse_main, rest_of_handle_cse, rest_of_handle_cse2): Do not
+ use dump argument.
+ * loop-init.c (loop_optimizer_init, loop_optimizer_finalize,
+ rtl_loop_init, rtl_loop_done): Ditto.
+ * global.c (global_alloc, rest_of_handle_global_alloc): Ditto.
+ * predict.c (combine_predictions_for_bb, tree_estimate_probability):
+ Ditto.
+ * recog.c (peephole2_optimize, rest_of_handle_peephole2): Ditto.
+ * lcm.c (pre_edge_lcm, pre_edge_rev_lcm): Ditto.
+ * regmove.c (fixup_match_1, fixup_match_2, regmove_optimize,
+ rest_of_handle_regmove, rest_of_handle_stack_adjustments): Ditto.
+ * emit-rtl.c (renumber_insns): Ditto.
+ * cfgexpand.c (add_reg_br_prob_note, expand_gimple_cond_expr,
+ expand_gimple_basic_block, tree_expand_cfg): Ditto.
+ * regclass.c (regclass): Ditto.
+ * tree-outof-ssa.c (analyze_edges_for_bb, perform_edge_inserts,
+ remove_ssa_form, rewrite_out_of_ssa): Ditto.
+ * reg-stack.c (compensate_edge, compensate_edges, convert_regs_1,
+ convert_regs_2, convert_regs, reg_to_stack, rest_of_handle_stack_regs):
+ Ditto.
+ * sched-rgn.c (schedule_insns, rest_of_handle_sched): Ditto.
+ * local-alloc.c (rest_of_handle_local_alloc): Do not pass dump_file
+ to regclass.
+ * gcse.c (gcse_file, debug_stderr): Removed.
+ (gcse_main, bypass_jumps, rest_of_handle_jump_bypass,
+ rest_of_handle_gcse): Do not use dump argument.
+ (cprop_jump, cprop_insn, do_local_cprop, cprop, find_implicit_sets,
+ one_cprop_pass, bypass_block, compute_pre_data, insert_insn_end_bb,
+ pre_edge_insert, pre_insert_copy_insn, pre_delete, one_pre_gcse_pass,
+ compute_code_hoist_vbeinout, compute_code_hoist_data,
+ one_code_hoisting_pass, trim_ld_motion_mems, update_ld_motion_stores,
+ compute_store_table, build_store_vectors, insert_insn_start_bb,
+ insert_store, remove_reachable_equiv_notes, replace_store_insn,
+ store_motion): Use dump_file instead of gcse_file.
+ * ipa-type-escape.c (type_escape_execute): Remove debugging comments.
+ * profile.c (profile_dump_file): Removed.
+ (branch_prob): Use dump_file instead of profile_dump_file.
+ * ipa.c (cgraph_remove_unreachable_nodes): Do not call argument
+ dump_file.
+ * tree-ssa-copy.c (dump_copy_of): Ditto.
+ * rtl-factoring.c (rtl_seqabstr, rest_of_rtl_seqabstr): Do not pass
+ dump file to life_analysis.
+ * bt-load.c (branch_target_load_optimize): Ditto.
+ * cfgcleanup.c (rest_of_handle_jump2): Do not pass dump_file to
+ renumber_insns.
+ * rtl.h (cse_main, renumber_insns, schedule_insns, schedule_ebbs,
+ regclass, dbr_schedule): Declaration changed.
+ * sched-int.h (sched_init): Declaration changed.
+ * tree-profile.c (tree_profile_dump_file): Removed.
+ (tree_profile_hooks): Removed profile_dump_file hook.
+ * rtl-profile (rtl_profile_dump_file): Removed.
+ (rtl_profile_hooks): emoved profile_dump_file hook.
+ * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Declaration
+ changed.
+ * c-gimplify.c (c_genericize): Do not call local variable dump_file.
+ * tree-cfg.c (build_tree_cfg): Ditto.
+ * Makefile.in (haifa-sched.o, sched-ebb.o): Add output.h dependency.
+ * basic-block.h (life_analysis, pre_edge_lcm, pre_edge_rev_lcm):
+ Declaration changed.
+ * config/sh/sh.c (sh_output_mi_thunk): Do not pass dump_file to
+ life_analysis and schedule_insns.
+ * config/m68hc11/m68hc11.c (m68hc11_reorg): Do not pass dump_file to
+ life_analysis.
+ * config/mt/mt.c (mt_machine_reorg): Do not pass dump_file to
+ dbr_schedule.
+ * config/mips/mips.c (mips_reorg): Ditto.
+ * config/ia64/ia64.c (ia64_reorg): Do not pass dump_file to
+ schedule_ebbs.
+
2006-02-06 Aldy Hernandez <aldyh@redhat.com>
* config/s390/s390.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define.
cfghooks.h $(DF_H) $(GCOV_IO_H) hard-reg-set.h $(TM_H) timevar.h tree-pass.h
haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \
- $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
+ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) output.h
sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h \
sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \
- $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H)
+ $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h
sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \
$(TM_P_H) real.h toplev.h tree-pass.h
to match only full blocks */
#define STRUCT_EQUIV_MATCH_JUMPS 8192 /* Also include the jumps at the end of the block in the comparison. */
-extern void life_analysis (FILE *, int);
+extern void life_analysis (int);
extern int update_life_info (sbitmap, enum update_life_extent, int);
extern int update_life_info_in_dirty_blocks (enum update_life_extent, int);
extern int count_or_remove_death_notes (sbitmap, int);
extern void free_propagate_block_info (struct propagate_block_info *);
/* In lcm.c */
-extern struct edge_list *pre_edge_lcm (FILE *, int, sbitmap *, sbitmap *,
+extern struct edge_list *pre_edge_lcm (int, sbitmap *, sbitmap *,
sbitmap *, sbitmap *, sbitmap **,
sbitmap **);
-extern struct edge_list *pre_edge_rev_lcm (FILE *, int, sbitmap *,
+extern struct edge_list *pre_edge_rev_lcm (int, sbitmap *,
sbitmap *, sbitmap *,
sbitmap *, sbitmap **,
sbitmap **);
cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
#endif
- life_analysis (NULL, 0);
+ life_analysis (0);
/* Dominator info is also needed for migrate_btr_def. */
calculate_dominance_info (CDI_DOMINATORS);
void
c_genericize (tree fndecl)
{
- FILE *dump_file;
+ FILE *dump_orig;
int local_dump_flags;
struct cgraph_node *cgn;
/* Dump the C-specific tree IR. */
- dump_file = dump_begin (TDI_original, &local_dump_flags);
- if (dump_file)
+ dump_orig = dump_begin (TDI_original, &local_dump_flags);
+ if (dump_orig)
{
- fprintf (dump_file, "\n;; Function %s",
+ fprintf (dump_orig, "\n;; Function %s",
lang_hooks.decl_printable_name (fndecl, 2));
- fprintf (dump_file, " (%s)\n",
+ fprintf (dump_orig, " (%s)\n",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
- fprintf (dump_file, ";; enabled by -%s\n", dump_flag_name (TDI_original));
- fprintf (dump_file, "\n");
+ fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
+ fprintf (dump_orig, "\n");
if (local_dump_flags & TDF_RAW)
dump_node (DECL_SAVED_TREE (fndecl),
- TDF_SLIM | local_dump_flags, dump_file);
+ TDF_SLIM | local_dump_flags, dump_orig);
else
- print_c_tree (dump_file, DECL_SAVED_TREE (fndecl));
- fprintf (dump_file, "\n");
+ print_c_tree (dump_orig, DECL_SAVED_TREE (fndecl));
+ fprintf (dump_orig, "\n");
- dump_end (TDI_original, dump_file);
+ dump_end (TDI_original, dump_orig);
}
/* Go ahead and gimplify for now. */
future passes, allocate arrays whose dimensions involve the
maximum instruction UID, so if we can reduce the maximum UID
we'll save big on memory. */
- renumber_insns (dump_file);
+ renumber_insns ();
}
re-distribute it when the conditional expands into multiple conditionals.
This is however difficult to do. */
static void
-add_reg_br_prob_note (FILE *dump_file, rtx last, int probability)
+add_reg_br_prob_note (rtx last, int probability)
{
if (profile_status == PROFILE_ABSENT)
return;
if (TREE_CODE (then_exp) == GOTO_EXPR && IS_EMPTY_STMT (else_exp))
{
jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp)));
- add_reg_br_prob_note (dump_file, last, true_edge->probability);
+ add_reg_br_prob_note (last, true_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (EXPR_LOCUS (then_exp))
emit_line_note (*(EXPR_LOCUS (then_exp)));
if (TREE_CODE (else_exp) == GOTO_EXPR && IS_EMPTY_STMT (then_exp))
{
jumpifnot (pred, label_rtx (GOTO_DESTINATION (else_exp)));
- add_reg_br_prob_note (dump_file, last, false_edge->probability);
+ add_reg_br_prob_note (last, false_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (EXPR_LOCUS (else_exp))
emit_line_note (*(EXPR_LOCUS (else_exp)));
&& TREE_CODE (else_exp) == GOTO_EXPR);
jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp)));
- add_reg_br_prob_note (dump_file, last, true_edge->probability);
+ add_reg_br_prob_note (last, true_edge->probability);
last = get_last_insn ();
expand_expr (else_exp, const0_rtx, VOIDmode, 0);
/* Expand basic block BB from GIMPLE trees to RTL. */
static basic_block
-expand_gimple_basic_block (basic_block bb, FILE * dump_file)
+expand_gimple_basic_block (basic_block bb)
{
block_stmt_iterator bsi = bsi_start (bb);
tree stmt = NULL;
init_block = construct_init_block ();
FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb)
- bb = expand_gimple_basic_block (bb, dump_file);
+ bb = expand_gimple_basic_block (bb);
construct_exit_block ();
extern void init_set_costs (void);
/* Loop optimizer initialization. */
-extern struct loops *loop_optimizer_init (FILE *, unsigned);
-extern void loop_optimizer_finalize (struct loops *, FILE *);
+extern struct loops *loop_optimizer_init (unsigned);
+extern void loop_optimizer_finalize (struct loops *);
/* Optimization passes. */
extern void unswitch_loops (struct loops *);
_1mfb_ = get_cpu_unit_code ("1b_1mfb.");
_1mlx_ = get_cpu_unit_code ("1b_1mlx.");
}
- schedule_ebbs (dump_file);
+ schedule_ebbs ();
finish_bundle_states ();
if (ia64_tune == PROCESSOR_ITANIUM)
{
}
}
- life_analysis (0, PROP_REG_INFO | PROP_DEATH_NOTES);
+ life_analysis (PROP_REG_INFO | PROP_DEATH_NOTES);
}
z_replacement_completed = 2;
else if (TARGET_EXPLICIT_RELOCS)
{
if (mips_flag_delayed_branch)
- dbr_schedule (get_insns (), dump_file);
+ dbr_schedule (get_insns ());
mips_avoid_hazards ();
if (TUNE_MIPS4130 && TARGET_VR4130_ALIGN)
vr4130_align_insns ();
mt_reorg_loops (dump_file);
if (mt_flag_delayed_branch)
- dbr_schedule (get_insns (), dump_file);
+ dbr_schedule (get_insns ());
if (TARGET_MS2)
{
if (flag_schedule_insns_after_reload)
{
- life_analysis (dump_file, PROP_FINAL);
+ life_analysis (PROP_FINAL);
split_all_insns (1);
- schedule_insns (dump_file);
+ schedule_insns ();
}
/* We must split jmp insn in PIC case. */
else if (flag_pic)
sh_reorg ();
if (optimize > 0 && flag_delayed_branch)
- dbr_schedule (insns, dump_file);
+ dbr_schedule (insns);
shorten_branches (insns);
final_start_function (insns, file, 1);
in conditional jump instructions. */
int
-cse_main (rtx f, int nregs, FILE *file)
+cse_main (rtx f, int nregs)
{
struct cse_basic_block_data val;
rtx insn = f;
cse_basic_block_end = val.high_cuid;
max_qty = val.nsets * 2;
- if (file)
- fprintf (file, ";; Processing block from %d to %d, %d sets.\n",
+ if (dump_file)
+ fprintf (dump_file, ";; Processing block from %d to %d, %d sets.\n",
INSN_UID (insn), val.last ? INSN_UID (val.last) : 0,
val.nsets);
reg_scan (get_insns (), max_reg_num ());
- tem = cse_main (get_insns (), max_reg_num (), dump_file);
+ tem = cse_main (get_insns (), max_reg_num ());
if (tem)
rebuild_jump_labels (get_insns ());
if (purge_all_dead_edges ())
if (dump_file)
dump_flow_info (dump_file);
- tem = cse_main (get_insns (), max_reg_num (), dump_file);
+ tem = cse_main (get_insns (), max_reg_num ());
/* Run a pass to eliminate duplicated assignments to condition code
registers. We have to run this after bypass_jumps, because it
}
void
-print_ddg_edge (FILE *dump_file, ddg_edge_ptr e)
+print_ddg_edge (FILE *file, ddg_edge_ptr e)
{
char dep_c;
dep_c = 'T';
}
- fprintf (dump_file, " [%d -(%c,%d,%d)-> %d] ", INSN_UID (e->src->insn),
+ fprintf (file, " [%d -(%c,%d,%d)-> %d] ", INSN_UID (e->src->insn),
dep_c, e->latency, e->distance, INSN_UID (e->dest->insn));
}
/* Print the DDG nodes with there in/out edges to the dump file. */
void
-print_ddg (FILE *dump_file, ddg_ptr g)
+print_ddg (FILE *file, ddg_ptr g)
{
int i;
{
ddg_edge_ptr e;
- print_rtl_single (dump_file, g->nodes[i].insn);
- fprintf (dump_file, "OUT ARCS: ");
+ print_rtl_single (file, g->nodes[i].insn);
+ fprintf (file, "OUT ARCS: ");
for (e = g->nodes[i].out; e; e = e->next_out)
- print_ddg_edge (dump_file, e);
+ print_ddg_edge (file, e);
- fprintf (dump_file, "\nIN ARCS: ");
+ fprintf (file, "\nIN ARCS: ");
for (e = g->nodes[i].in; e; e = e->next_in)
- print_ddg_edge (dump_file, e);
+ print_ddg_edge (file, e);
- fprintf (dump_file, "\n");
+ fprintf (file, "\n");
}
}
/* Print the given DDG in VCG format. */
void
-vcg_print_ddg (FILE *dump_file, ddg_ptr g)
+vcg_print_ddg (FILE *file, ddg_ptr g)
{
int src_cuid;
- fprintf (dump_file, "graph: {\n");
+ fprintf (file, "graph: {\n");
for (src_cuid = 0; src_cuid < g->num_nodes; src_cuid++)
{
ddg_edge_ptr e;
int src_uid = INSN_UID (g->nodes[src_cuid].insn);
- fprintf (dump_file, "node: {title: \"%d_%d\" info1: \"", src_cuid, src_uid);
- print_rtl_single (dump_file, g->nodes[src_cuid].insn);
- fprintf (dump_file, "\"}\n");
+ fprintf (file, "node: {title: \"%d_%d\" info1: \"", src_cuid, src_uid);
+ print_rtl_single (file, g->nodes[src_cuid].insn);
+ fprintf (file, "\"}\n");
for (e = g->nodes[src_cuid].out; e; e = e->next_out)
{
int dst_uid = INSN_UID (e->dest->insn);
/* Give the backarcs a different color. */
if (e->distance > 0)
- fprintf (dump_file, "backedge: {color: red ");
+ fprintf (file, "backedge: {color: red ");
else
- fprintf (dump_file, "edge: { ");
+ fprintf (file, "edge: { ");
- fprintf (dump_file, "sourcename: \"%d_%d\" ", src_cuid, src_uid);
- fprintf (dump_file, "targetname: \"%d_%d\" ", dst_cuid, dst_uid);
- fprintf (dump_file, "label: \"%d_%d\"}\n", e->latency, e->distance);
+ fprintf (file, "sourcename: \"%d_%d\" ", src_cuid, src_uid);
+ fprintf (file, "targetname: \"%d_%d\" ", dst_cuid, dst_uid);
+ fprintf (file, "label: \"%d_%d\"}\n", e->latency, e->distance);
}
}
- fprintf (dump_file, "}\n");
+ fprintf (file, "}\n");
}
/* Create an edge and initialize it with given values. */
/* Renumber instructions so that no instruction UIDs are wasted. */
void
-renumber_insns (FILE *stream)
+renumber_insns (void)
{
rtx insn;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
- if (stream)
- fprintf (stream, "Renumbering insn %d to %d\n",
+ if (dump_file)
+ fprintf (dump_file, "Renumbering insn %d to %d\n",
INSN_UID (insn), cur_insn_uid);
INSN_UID (insn) = cur_insn_uid++;
}
FLAGS is a set of PROP_* flags to be used in accumulating flow info. */
void
-life_analysis (FILE *file, int flags)
+life_analysis (int flags)
{
#ifdef ELIMINABLE_REGS
int i;
if (optimize && (flags & PROP_SCAN_DEAD_STORES))
end_alias_analysis ();
- if (file)
- dump_flow_info (file);
+ if (dump_file)
+ dump_flow_info (dump_file);
/* Removing dead insns should have made jumptables really dead. */
delete_dead_jumptables ();
{
regclass_init ();
- life_analysis (dump_file, PROP_FINAL);
+ life_analysis (PROP_FINAL);
if (optimize)
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE | CLEANUP_LOG_LINKS
| (flag_thread_jumps ? CLEANUP_THREADING : 0));
\f
/* GCSE global vars. */
-/* -dG dump file. */
-static FILE *gcse_file;
-
/* Note whether or not we should run jump optimization after gcse. We
want to do this for two cases.
* If we added any labels via edge splitting. */
static int run_jump_opt_after_gcse;
-/* Bitmaps are normally not included in debugging dumps.
- However it's useful to be able to print them from GDB.
- We could create special functions for this, but it's simpler to
- just allow passing stderr to the dump_foo fns. Since stderr can
- be a macro, we store a copy here. */
-static FILE *debug_stderr;
-
/* An obstack for our working variables. */
static struct obstack gcse_obstack;
change is mode. */
static int
-gcse_main (rtx f ATTRIBUTE_UNUSED, FILE *file)
+gcse_main (rtx f ATTRIBUTE_UNUSED)
{
int changed, pass;
/* Bytes used at start of pass. */
/* Assume that we do not need to run jump optimizations after gcse. */
run_jump_opt_after_gcse = 0;
- /* For calling dump_foo fns from gdb. */
- debug_stderr = stderr;
- gcse_file = file;
-
/* Identify the basic block information for this function, including
successors and predecessors. */
max_gcse_regno = max_reg_num ();
- if (file)
- dump_flow_info (file);
+ if (dump_file)
+ dump_flow_info (dump_file);
/* Return if there's nothing to do, or it is too expensive. */
if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1
while (changed && pass < MAX_GCSE_PASSES)
{
changed = 0;
- if (file)
- fprintf (file, "GCSE pass %d\n\n", pass + 1);
+ if (dump_file)
+ fprintf (dump_file, "GCSE pass %d\n\n", pass + 1);
/* Initialize bytes_used to the space for the pred/succ lists,
and the reg_set_table data. */
timevar_pop (TV_HOIST);
}
- if (file)
+ if (dump_file)
{
- fprintf (file, "\n");
- fflush (file);
+ fprintf (dump_file, "\n");
+ fflush (dump_file);
}
obstack_free (&gcse_obstack, gcse_obstack_bottom);
timevar_pop (TV_CPROP2);
free_gcse_mem ();
- if (file)
+ if (dump_file)
{
- fprintf (file, "GCSE of %s: %d basic blocks, ",
+ fprintf (dump_file, "GCSE of %s: %d basic blocks, ",
current_function_name (), n_basic_blocks);
- fprintf (file, "%d pass%s, %d bytes\n\n",
+ fprintf (dump_file, "%d pass%s, %d bytes\n\n",
pass, pass > 1 ? "es" : "", max_pass_bytes);
}
run_jump_opt_after_gcse = 1;
global_const_prop_count++;
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file,
+ fprintf (dump_file,
"GLOBAL CONST-PROP: Replacing reg %d in jump_insn %d with constant ",
REGNO (from), INSN_UID (jump));
- print_rtl (gcse_file, src);
- fprintf (gcse_file, "\n");
+ print_rtl (dump_file, src);
+ fprintf (dump_file, "\n");
}
purge_dead_edges (bb);
{
changed = 1;
global_const_prop_count++;
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file, "GLOBAL CONST-PROP: Replacing reg %d in ", regno);
- fprintf (gcse_file, "insn %d with constant ", INSN_UID (insn));
- print_rtl (gcse_file, src);
- fprintf (gcse_file, "\n");
+ fprintf (dump_file, "GLOBAL CONST-PROP: Replacing reg %d in ", regno);
+ fprintf (dump_file, "insn %d with constant ", INSN_UID (insn));
+ print_rtl (dump_file, src);
+ fprintf (dump_file, "\n");
}
if (INSN_DELETED_P (insn))
return 1;
{
changed = 1;
global_copy_prop_count++;
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file, "GLOBAL COPY-PROP: Replacing reg %d in insn %d",
+ fprintf (dump_file, "GLOBAL COPY-PROP: Replacing reg %d in insn %d",
regno, INSN_UID (insn));
- fprintf (gcse_file, " with reg %d\n", REGNO (src));
+ fprintf (dump_file, " with reg %d\n", REGNO (src));
}
/* The original insn setting reg_used may or may not now be
adjusted = adjust_libcall_notes (x, newcnst, insn, libcall_sp);
gcc_assert (adjusted);
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ",
+ fprintf (dump_file, "LOCAL CONST-PROP: Replacing reg %d in ",
REGNO (x));
- fprintf (gcse_file, "insn %d with constant ",
+ fprintf (dump_file, "insn %d with constant ",
INSN_UID (insn));
- print_rtl (gcse_file, newcnst);
- fprintf (gcse_file, "\n");
+ print_rtl (dump_file, newcnst);
+ fprintf (dump_file, "\n");
}
local_const_prop_count++;
return true;
else if (newreg && newreg != x && try_replace_reg (x, newreg, insn))
{
adjust_libcall_notes (x, newreg, insn, libcall_sp);
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file,
+ fprintf (dump_file,
"LOCAL COPY-PROP: Replacing reg %d in insn %d",
REGNO (x), INSN_UID (insn));
- fprintf (gcse_file, " with reg %d\n", REGNO (newreg));
+ fprintf (dump_file, " with reg %d\n", REGNO (newreg));
}
local_copy_prop_count++;
return true;
/* Note we start at block 1. */
if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR)
{
- if (gcse_file != NULL)
- fprintf (gcse_file, "\n");
+ if (dump_file != NULL)
+ fprintf (dump_file, "\n");
return 0;
}
}
}
- if (gcse_file != NULL)
- fprintf (gcse_file, "\n");
+ if (dump_file != NULL)
+ fprintf (dump_file, "\n");
return changed;
}
new = gen_rtx_SET (VOIDmode, XEXP (cond, 0),
XEXP (cond, 1));
implicit_sets[dest->index] = new;
- if (gcse_file)
+ if (dump_file)
{
- fprintf(gcse_file, "Implicit set of reg %d in ",
+ fprintf(dump_file, "Implicit set of reg %d in ",
REGNO (XEXP (cond, 0)));
- fprintf(gcse_file, "basic block %d\n", dest->index);
+ fprintf(dump_file, "basic block %d\n", dest->index);
}
count++;
}
}
}
- if (gcse_file)
- fprintf (gcse_file, "Found %d implicit sets\n", count);
+ if (dump_file)
+ fprintf (dump_file, "Found %d implicit sets\n", count);
}
/* Perform one copy/constant propagation pass.
free (implicit_sets);
implicit_sets = NULL;
- if (gcse_file)
- dump_hash_table (gcse_file, "SET", &set_hash_table);
+ if (dump_file)
+ dump_hash_table (dump_file, "SET", &set_hash_table);
if (set_hash_table.n_elems > 0)
{
alloc_cprop_mem (last_basic_block, set_hash_table.n_elems);
free_hash_table (&set_hash_table);
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "CPROP of %s, pass %d: %d bytes needed, ",
+ fprintf (dump_file, "CPROP of %s, pass %d: %d bytes needed, ",
current_function_name (), pass, bytes_used);
- fprintf (gcse_file, "%d local const props, %d local copy props, ",
+ fprintf (dump_file, "%d local const props, %d local copy props, ",
local_const_prop_count, local_copy_prop_count);
- fprintf (gcse_file, "%d global const props, %d global copy props\n\n",
+ fprintf (dump_file, "%d global const props, %d global copy props\n\n",
global_const_prop_count, global_copy_prop_count);
}
/* Global analysis may get into infinite loops for unreachable blocks. */
insert_insn_on_edge (copy_insn (pat), e);
}
- if (gcse_file != NULL)
+ if (dump_file != NULL)
{
- fprintf (gcse_file, "JUMP-BYPASS: Proved reg %d "
+ fprintf (dump_file, "JUMP-BYPASS: Proved reg %d "
"in jump_insn %d equals constant ",
regno, INSN_UID (jump));
- print_rtl (gcse_file, SET_SRC (set->expr));
- fprintf (gcse_file, "\nBypass edge from %d->%d to %d\n",
+ print_rtl (dump_file, SET_SRC (set->expr));
+ fprintf (dump_file, "\nBypass edge from %d->%d to %d\n",
e->src->index, old_dest->index, dest->index);
}
change = 1;
sbitmap_not (ae_kill[bb->index], ae_kill[bb->index]);
}
- edge_list = pre_edge_lcm (gcse_file, expr_hash_table.n_elems, transp, comp, antloc,
+ edge_list = pre_edge_lcm (expr_hash_table.n_elems, transp, comp, antloc,
ae_kill, &pre_insert_map, &pre_delete_map);
sbitmap_vector_free (antloc);
antloc = NULL;
gcse_create_count++;
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "PRE/HOIST: end of bb %d, insn %d, ",
+ fprintf (dump_file, "PRE/HOIST: end of bb %d, insn %d, ",
bb->index, INSN_UID (new_insn));
- fprintf (gcse_file, "copying expression %d to reg %d\n",
+ fprintf (dump_file, "copying expression %d to reg %d\n",
expr->bitmap_index, regno);
}
}
insert_insn_on_edge (insn, eg);
}
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "PRE/HOIST: edge (%d,%d), ",
+ fprintf (dump_file, "PRE/HOIST: edge (%d,%d), ",
bb->index,
INDEX_EDGE_SUCC_BB (edge_list, e)->index);
- fprintf (gcse_file, "copy expression %d\n",
+ fprintf (dump_file, "copy expression %d\n",
expr->bitmap_index);
}
gcse_create_count++;
- if (gcse_file)
- fprintf (gcse_file,
+ if (dump_file)
+ fprintf (dump_file,
"PRE: bb %d, insn %d, copy expression %d in insn %d to reg %d\n",
BLOCK_NUM (insn), INSN_UID (new_insn), indx,
INSN_UID (insn), regno);
changed = 1;
gcse_subst_count++;
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file,
+ fprintf (dump_file,
"PRE: redundant insn %d (expression %d) in ",
INSN_UID (insn), indx);
- fprintf (gcse_file, "bb %d, reaching reg is %d\n",
+ fprintf (dump_file, "bb %d, reaching reg is %d\n",
bb->index, REGNO (expr->reaching_reg));
}
}
compute_hash_table (&expr_hash_table);
trim_ld_motion_mems ();
- if (gcse_file)
- dump_hash_table (gcse_file, "Expression", &expr_hash_table);
+ if (dump_file)
+ dump_hash_table (dump_file, "Expression", &expr_hash_table);
if (expr_hash_table.n_elems > 0)
{
remove_fake_exit_edges ();
free_hash_table (&expr_hash_table);
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "\nPRE GCSE of %s, pass %d: %d bytes needed, ",
+ fprintf (dump_file, "\nPRE GCSE of %s, pass %d: %d bytes needed, ",
current_function_name (), pass, bytes_used);
- fprintf (gcse_file, "%d substs, %d insns created\n",
+ fprintf (dump_file, "%d substs, %d insns created\n",
gcse_subst_count, gcse_create_count);
}
passes++;
}
- if (gcse_file)
- fprintf (gcse_file, "hoisting vbeinout computation: %d passes\n", passes);
+ if (dump_file)
+ fprintf (dump_file, "hoisting vbeinout computation: %d passes\n", passes);
}
/* Top level routine to do the dataflow analysis needed by code hoisting. */
compute_transpout ();
compute_code_hoist_vbeinout ();
calculate_dominance_info (CDI_DOMINATORS);
- if (gcse_file)
- fprintf (gcse_file, "\n");
+ if (dump_file)
+ fprintf (dump_file, "\n");
}
/* Determine if the expression identified by EXPR_INDEX would
alloc_hash_table (max_cuid, &expr_hash_table, 0);
compute_hash_table (&expr_hash_table);
- if (gcse_file)
- dump_hash_table (gcse_file, "Code Hosting Expressions", &expr_hash_table);
+ if (dump_file)
+ dump_hash_table (dump_file, "Code Hosting Expressions", &expr_hash_table);
if (expr_hash_table.n_elems > 0)
{
}
/* Show the world what we've found. */
- if (gcse_file && pre_ldst_mems != NULL)
- print_ldst_list (gcse_file);
+ if (dump_file && pre_ldst_mems != NULL)
+ print_ldst_list (dump_file);
}
/* This routine will take an expression which we are replacing with
if (expr->reaching_reg == src)
continue;
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "PRE: store updated with reaching reg ");
- print_rtl (gcse_file, expr->reaching_reg);
- fprintf (gcse_file, ":\n ");
- print_inline_rtx (gcse_file, insn, 8);
- fprintf (gcse_file, "\n");
+ fprintf (dump_file, "PRE: store updated with reaching reg ");
+ print_rtl (dump_file, expr->reaching_reg);
+ fprintf (dump_file, ":\n ");
+ print_inline_rtx (dump_file, insn, 8);
+ fprintf (dump_file, "\n");
}
copy = gen_move_insn ( reg, copy_rtx (SET_SRC (pat)));
ret = enumerate_ldsts ();
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "ST_avail and ST_antic (shown under loads..)\n");
- print_ldst_list (gcse_file);
+ fprintf (dump_file, "ST_avail and ST_antic (shown under loads..)\n");
+ print_ldst_list (dump_file);
}
free (last_set_in);
if (TEST_BIT (ae_gen[bb->index], ptr->index))
{
rtx r = gen_reg_rtx (GET_MODE (ptr->pattern));
- if (gcse_file)
- fprintf (gcse_file, "Removing redundant store:\n");
+ if (dump_file)
+ fprintf (dump_file, "Removing redundant store:\n");
replace_store_insn (r, XEXP (st, 0), bb, ptr);
continue;
}
free (regs_set_in_block);
- if (gcse_file)
+ if (dump_file)
{
- dump_sbitmap_vector (gcse_file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (gcse_file, "st_kill", "", ae_kill, last_basic_block);
- dump_sbitmap_vector (gcse_file, "Transpt", "", transp, last_basic_block);
- dump_sbitmap_vector (gcse_file, "st_avloc", "", ae_gen, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_kill", "", ae_kill, last_basic_block);
+ dump_sbitmap_vector (dump_file, "Transpt", "", transp, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_avloc", "", ae_gen, last_basic_block);
}
}
insn = emit_insn_after_noloc (insn, prev);
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "STORE_MOTION insert store at start of BB %d:\n",
+ fprintf (dump_file, "STORE_MOTION insert store at start of BB %d:\n",
bb->index);
- print_inline_rtx (gcse_file, insn, 6);
- fprintf (gcse_file, "\n");
+ print_inline_rtx (dump_file, insn, 6);
+ fprintf (dump_file, "\n");
}
}
insert_insn_on_edge (insn, e);
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "STORE_MOTION insert insn on edge (%d, %d):\n",
+ fprintf (dump_file, "STORE_MOTION insert insn on edge (%d, %d):\n",
e->src->index, e->dest->index);
- print_inline_rtx (gcse_file, insn, 6);
- fprintf (gcse_file, "\n");
+ print_inline_rtx (dump_file, insn, 6);
+ fprintf (dump_file, "\n");
}
return 1;
if (!note || !expr_equiv_p (XEXP (note, 0), mem))
continue;
- if (gcse_file)
- fprintf (gcse_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
+ if (dump_file)
+ fprintf (dump_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
INSN_UID (insn));
remove_note (insn, note);
}
insn = gen_move_insn (reg, SET_SRC (single_set (del)));
insn = emit_insn_after (insn, del);
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file,
+ fprintf (dump_file,
"STORE_MOTION delete insn in BB %d:\n ", bb->index);
- print_inline_rtx (gcse_file, del, 6);
- fprintf (gcse_file, "\nSTORE MOTION replaced with insn:\n ");
- print_inline_rtx (gcse_file, insn, 6);
- fprintf (gcse_file, "\n");
+ print_inline_rtx (dump_file, del, 6);
+ fprintf (dump_file, "\nSTORE MOTION replaced with insn:\n ");
+ print_inline_rtx (dump_file, insn, 6);
+ fprintf (dump_file, "\n");
}
for (ptr = ANTIC_STORE_LIST (smexpr); ptr; ptr = XEXP (ptr, 1))
if (!note || !expr_equiv_p (XEXP (note, 0), mem))
continue;
- if (gcse_file)
- fprintf (gcse_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
+ if (dump_file)
+ fprintf (dump_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
INSN_UID (insn));
remove_note (insn, note);
}
struct ls_expr * ptr;
int update_flow = 0;
- if (gcse_file)
+ if (dump_file)
{
- fprintf (gcse_file, "before store motion\n");
- print_rtl (gcse_file, get_insns ());
+ fprintf (dump_file, "before store motion\n");
+ print_rtl (dump_file, get_insns ());
}
init_alias_analysis ();
add_noreturn_fake_exit_edges ();
connect_infinite_loops_to_exit ();
- edge_list = pre_edge_rev_lcm (gcse_file, num_stores, transp, ae_gen,
+ edge_list = pre_edge_rev_lcm (num_stores, transp, ae_gen,
st_antloc, ae_kill, &pre_insert_map,
&pre_delete_map);
if (x >= 0)
{
- if (gcse_file != NULL)
- fprintf (gcse_file,
+ if (dump_file != NULL)
+ fprintf (dump_file,
"Can't replace store %d: abnormal edge from %d to %d\n",
ptr->index, INDEX_EDGE (edge_list, x)->src->index,
INDEX_EDGE (edge_list, x)->dest->index);
/* Entry point for jump bypassing optimization pass. */
static int
-bypass_jumps (FILE *file)
+bypass_jumps (void)
{
int changed;
if (current_function_calls_setjmp)
return 0;
- /* For calling dump_foo fns from gdb. */
- debug_stderr = stderr;
- gcse_file = file;
-
/* Identify the basic block information for this function, including
successors and predecessors. */
max_gcse_regno = max_reg_num ();
- if (file)
- dump_flow_info (file);
+ if (dump_file)
+ dump_flow_info (dump_file);
/* Return if there's nothing to do, or it is too expensive. */
if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1
changed = one_cprop_pass (MAX_GCSE_PASSES + 2, true, true);
free_gcse_mem ();
- if (file)
+ if (dump_file)
{
- fprintf (file, "BYPASS of %s: %d basic blocks, ",
+ fprintf (dump_file, "BYPASS of %s: %d basic blocks, ",
current_function_name (), n_basic_blocks);
- fprintf (file, "%d bytes\n\n", bytes_used);
+ fprintf (dump_file, "%d bytes\n\n", bytes_used);
}
obstack_free (&gcse_obstack, NULL);
cleanup_cfg (CLEANUP_EXPENSIVE);
reg_scan (get_insns (), max_reg_num ());
- if (bypass_jumps (dump_file))
+ if (bypass_jumps ())
{
rebuild_jump_labels (get_insns ());
cleanup_cfg (CLEANUP_EXPENSIVE);
int save_csb, save_cfj;
int tem2 = 0, tem;
- tem = gcse_main (get_insns (), dump_file);
+ tem = gcse_main (get_insns ());
rebuild_jump_labels (get_insns ());
delete_trivially_dead_insns (get_insns (), max_reg_num ());
{
timevar_push (TV_CSE);
reg_scan (get_insns (), max_reg_num ());
- tem2 = cse_main (get_insns (), max_reg_num (), dump_file);
+ tem2 = cse_main (get_insns (), max_reg_num ());
purge_all_dead_edges ();
delete_trivially_dead_insns (get_insns (), max_reg_num ());
timevar_pop (TV_CSE);
\f
/* Perform allocation of pseudo-registers not allocated by local_alloc.
- FILE is a file to output debugging information on,
- or zero if such output is not desired.
Return value is nonzero if reload failed
and we must not do any more for this function. */
static int
-global_alloc (FILE *file)
+global_alloc (void)
{
int retval;
#ifdef ELIMINABLE_REGS
prune_preferences ();
- if (file)
- dump_conflicts (file);
+ if (dump_file)
+ dump_conflicts (dump_file);
/* Try allocating them, one by one, in that order,
except for parameters marked with reg_live_length[regno] == -2. */
pass fixing up any insns that are invalid. */
if (optimize)
- failure = global_alloc (dump_file);
+ failure = global_alloc ();
else
{
build_insn_chain (get_insns ());
#include "recog.h"
#include "sched-int.h"
#include "target.h"
+#include "output.h"
#ifdef INSN_SCHEDULING
\f
#ifndef INSN_SCHEDULING
void
-schedule_insns (FILE *dump_file ATTRIBUTE_UNUSED)
+schedule_insns (void)
{
}
#else
return n_insn;
}
-/* Initialize some global state for the scheduler. DUMP_FILE is to be used
- for debugging output. */
+/* Initialize some global state for the scheduler. */
void
-sched_init (FILE *dump_file)
+sched_init (void)
{
int luid;
basic_block b;
result = splay_tree_successor (all_canon_types, (splay_tree_key) key);
}
-/* { */
-/* FILE * tmp = dump_file; */
-/* dump_file = stderr; */
if (dump_file)
{
EXECUTE_IF_SET_IN_BITMAP (global_types_seen, 0, i, bi)
fprintf(dump_file, " contained\n");
}
}
-/* dump_file = tmp; */
-/* } */
/* Get rid of uid_to_addressof_up_map and its bitmaps. */
result = splay_tree_min (uid_to_addressof_up_map);
removes unneeded bodies of extern inline functions. */
bool
-cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file)
+cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
{
struct cgraph_node *first = (void *) 1;
struct cgraph_node *node;
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
- if (dump_file)
- fprintf (dump_file, "\nReclaiming functions:");
+ if (file)
+ fprintf (file, "\nReclaiming functions:");
#ifdef ENABLE_CHECKING
for (node = cgraph_nodes; node; node = node->next)
gcc_assert (!node->aux);
local_insns = node->local.self_insns;
else
local_insns = 0;
- if (dump_file)
- fprintf (dump_file, " %s", cgraph_node_name (node));
+ if (file)
+ fprintf (file, " %s", cgraph_node_name (node));
if (!node->analyzed || !DECL_EXTERNAL (node->decl)
|| before_inlining_p)
cgraph_remove_node (node);
}
for (node = cgraph_nodes; node; node = node->next)
node->aux = NULL;
- if (dump_file)
- fprintf (dump_file, "\nReclaimed %i insns", insns);
+ if (file)
+ fprintf (file, "\nReclaimed %i insns", insns);
return changed;
}
map the insert vector to what edge an expression should be inserted on. */
struct edge_list *
-pre_edge_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
+pre_edge_lcm (int n_exprs, sbitmap *transp,
sbitmap *avloc, sbitmap *antloc, sbitmap *kill,
sbitmap **insert, sbitmap **delete)
{
num_edges = NUM_EDGES (edge_list);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- fprintf (file, "Edge List:\n");
- verify_edge_list (file, edge_list);
- print_edge_list (file, edge_list);
- dump_sbitmap_vector (file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (file, "antloc", "", antloc, last_basic_block);
- dump_sbitmap_vector (file, "avloc", "", avloc, last_basic_block);
- dump_sbitmap_vector (file, "kill", "", kill, last_basic_block);
+ fprintf (dump_file, "Edge List:\n");
+ verify_edge_list (dump_file, edge_list);
+ print_edge_list (dump_file, edge_list);
+ dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_sbitmap_vector (dump_file, "antloc", "", antloc, last_basic_block);
+ dump_sbitmap_vector (dump_file, "avloc", "", avloc, last_basic_block);
+ dump_sbitmap_vector (dump_file, "kill", "", kill, last_basic_block);
}
#endif
compute_antinout_edge (antloc, transp, antin, antout);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "antin", "", antin, last_basic_block);
- dump_sbitmap_vector (file, "antout", "", antout, last_basic_block);
+ dump_sbitmap_vector (dump_file, "antin", "", antin, last_basic_block);
+ dump_sbitmap_vector (dump_file, "antout", "", antout, last_basic_block);
}
#endif
compute_earliest (edge_list, n_exprs, antin, antout, avout, kill, earliest);
#ifdef LCM_DEBUG_INFO
- if (file)
- dump_sbitmap_vector (file, "earliest", "", earliest, num_edges);
+ if (dump_file)
+ dump_sbitmap_vector (dump_file, "earliest", "", earliest, num_edges);
#endif
sbitmap_vector_free (antout);
compute_laterin (edge_list, earliest, antloc, later, laterin);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "laterin", "", laterin, last_basic_block + 1);
- dump_sbitmap_vector (file, "later", "", later, num_edges);
+ dump_sbitmap_vector (dump_file, "laterin", "", laterin, last_basic_block + 1);
+ dump_sbitmap_vector (dump_file, "later", "", later, num_edges);
}
#endif
sbitmap_vector_free (later);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (file, "pre_delete_map", "", *delete,
+ dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete,
last_basic_block);
}
#endif
an expression should be inserted on. */
struct edge_list *
-pre_edge_rev_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
+pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
sbitmap *st_avloc, sbitmap *st_antloc, sbitmap *kill,
sbitmap **insert, sbitmap **delete)
{
compute_available (st_avloc, kill, st_avout, st_avin);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- fprintf (file, "Edge List:\n");
- verify_edge_list (file, edge_list);
- print_edge_list (file, edge_list);
- dump_sbitmap_vector (file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (file, "st_avloc", "", st_avloc, last_basic_block);
- dump_sbitmap_vector (file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (file, "st_antin", "", st_antin, last_basic_block);
- dump_sbitmap_vector (file, "st_antout", "", st_antout, last_basic_block);
- dump_sbitmap_vector (file, "st_kill", "", kill, last_basic_block);
+ fprintf (dump_file, "Edge List:\n");
+ verify_edge_list (dump_file, edge_list);
+ print_edge_list (dump_file, edge_list);
+ dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_antin", "", st_antin, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_antout", "", st_antout, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_kill", "", kill, last_basic_block);
}
#endif
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "st_avout", "", st_avout, last_basic_block);
- dump_sbitmap_vector (file, "st_avin", "", st_avin, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_avout", "", st_avout, last_basic_block);
+ dump_sbitmap_vector (dump_file, "st_avin", "", st_avin, last_basic_block);
}
#endif
kill, farthest);
#ifdef LCM_DEBUG_INFO
- if (file)
- dump_sbitmap_vector (file, "farthest", "", farthest, num_edges);
+ if (dump_file)
+ dump_sbitmap_vector (dump_file, "farthest", "", farthest, num_edges);
#endif
sbitmap_vector_free (st_antin);
compute_nearerout (edge_list, farthest, st_avloc, nearer, nearerout);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "nearerout", "", nearerout,
+ dump_sbitmap_vector (dump_file, "nearerout", "", nearerout,
last_basic_block + 1);
- dump_sbitmap_vector (file, "nearer", "", nearer, num_edges);
+ dump_sbitmap_vector (dump_file, "nearer", "", nearer, num_edges);
}
#endif
sbitmap_vector_free (nearer);
#ifdef LCM_DEBUG_INFO
- if (file)
+ if (dump_file)
{
- dump_sbitmap_vector (file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (file, "pre_delete_map", "", *delete,
+ dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete,
last_basic_block);
}
#endif
allocate_initial_values (reg_equiv_memory_loc);
- regclass (get_insns (), max_reg_num (), dump_file);
+ regclass (get_insns (), max_reg_num ());
rebuild_notes = local_alloc ();
/* Local allocation may have turned an indirect jump into a direct
loops. */
struct loops *
-loop_optimizer_init (FILE *dumpfile, unsigned flags)
+loop_optimizer_init (unsigned flags)
{
struct loops *loops = XCNEW (struct loops);
edge e;
mark_single_exit_loops (loops);
/* Dump loops. */
- flow_loops_dump (loops, dumpfile, NULL, 1);
+ flow_loops_dump (loops, dump_file, NULL, 1);
#ifdef ENABLE_CHECKING
verify_dominators (CDI_DOMINATORS);
/* Finalize loop optimizer. */
void
-loop_optimizer_finalize (struct loops *loops, FILE *dumpfile)
+loop_optimizer_finalize (struct loops *loops)
{
unsigned i;
if (loops->parray[i])
free_simple_loop_desc (loops->parray[i]);
- /* Another dump. */
- flow_loops_dump (loops, dumpfile, NULL, 1);
-
/* Clean up. */
flow_loops_free (loops);
free (loops);
/* Initialize structures for layout changes. */
cfg_layout_initialize (0);
- current_loops = loop_optimizer_init (dump_file, LOOPS_NORMAL);
+ current_loops = loop_optimizer_init (LOOPS_NORMAL);
}
struct tree_opt_pass pass_rtl_loop_init =
basic_block bb;
if (current_loops)
- loop_optimizer_finalize (current_loops, dump_file);
+ loop_optimizer_finalize (current_loops);
free_dominance_info (CDI_DOMINATORS);
};
-static FILE *loop_dump_stream;
-
/* Forward declarations. */
static void invalidate_loops_containing_label (rtx);
}
\f
/* Entry point of this file. Perform loop optimization
- on the current function. F is the first insn of the function
- and DUMPFILE is a stream for output of a trace of actions taken
- (or 0 if none should be output). */
+ on the current function. F is the first insn of the function. */
static void
-loop_optimize (rtx f, FILE *dumpfile, int flags)
+loop_optimize (rtx f, int flags)
{
rtx insn;
int i;
struct loops *loops = &loops_data;
struct loop_info *loops_info;
- loop_dump_stream = dumpfile;
-
init_recog_no_volatile ();
max_reg_before_loop = max_reg_num ();
if (INSN_UID (loop->scan_start) >= max_uid_for_loop
|| !LABEL_P (loop->scan_start))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "\nLoop from %d to %d is phony.\n\n",
+ if (dump_file)
+ fprintf (dump_file, "\nLoop from %d to %d is phony.\n\n",
INSN_UID (loop_start), INSN_UID (loop_end));
return;
}
loop_regs_scan (loop, loop_info->mems_idx + 16);
insn_count = count_insns_in_loop (loop);
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "\nLoop from %d to %d: %d real insns.\n",
+ if (dump_file)
+ fprintf (dump_file, "\nLoop from %d to %d: %d real insns.\n",
INSN_UID (loop_start), INSN_UID (loop_end), insn_count);
/* Scan through the loop finding insns that are safe to move.
{
/* Describe this movable insn. */
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "Insn %d: regno %d (life %d), ",
+ fprintf (dump_file, "Insn %d: regno %d (life %d), ",
INSN_UID (m->insn), m->regno, m->lifetime);
if (m->consec > 0)
- fprintf (loop_dump_stream, "consec %d, ", m->consec);
+ fprintf (dump_file, "consec %d, ", m->consec);
if (m->cond)
- fprintf (loop_dump_stream, "cond ");
+ fprintf (dump_file, "cond ");
if (m->force)
- fprintf (loop_dump_stream, "force ");
+ fprintf (dump_file, "force ");
if (m->global)
- fprintf (loop_dump_stream, "global ");
+ fprintf (dump_file, "global ");
if (m->done)
- fprintf (loop_dump_stream, "done ");
+ fprintf (dump_file, "done ");
if (m->move_insn)
- fprintf (loop_dump_stream, "move-insn ");
+ fprintf (dump_file, "move-insn ");
if (m->match)
- fprintf (loop_dump_stream, "matches %d ",
+ fprintf (dump_file, "matches %d ",
INSN_UID (m->match->insn));
if (m->forces)
- fprintf (loop_dump_stream, "forces %d ",
+ fprintf (dump_file, "forces %d ",
INSN_UID (m->forces->insn));
}
p = m->insn;
regno = m->regno;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "savings %d ", savings);
+ if (dump_file)
+ fprintf (dump_file, "savings %d ", savings);
- if (regs->array[regno].moved_once && loop_dump_stream)
- fprintf (loop_dump_stream, "halved since already moved ");
+ if (regs->array[regno].moved_once && dump_file)
+ fprintf (dump_file, "halved since already moved ");
/* An insn MUST be moved if we already moved something else
which is safe only if this one is moved too: that is,
if (new_start == 0)
new_start = i1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, " moved to %d", INSN_UID (i1));
+ if (dump_file)
+ fprintf (dump_file, " moved to %d", INSN_UID (i1));
}
/* If we are to re-generate the item being moved with a
new move insn, first delete what we have and then emit
m->is_equiv ? REG_EQUIV : REG_EQUAL,
m->set_src);
- if (loop_dump_stream)
- fprintf (loop_dump_stream, " moved to %d", INSN_UID (i1));
+ if (dump_file)
+ fprintf (dump_file, " moved to %d", INSN_UID (i1));
/* The more regs we move, the less we like moving them. */
threshold -= 3;
if (new_start == 0)
new_start = i1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, " moved to %d",
+ if (dump_file)
+ fprintf (dump_file, " moved to %d",
INSN_UID (i1));
/* If library call, now fix the REG_NOTES that contain
}
}
}
- else if (loop_dump_stream)
- fprintf (loop_dump_stream, "not desirable");
+ else if (dump_file)
+ fprintf (dump_file, "not desirable");
}
- else if (loop_dump_stream && !m->match)
- fprintf (loop_dump_stream, "not safe");
+ else if (dump_file && !m->match)
+ fprintf (dump_file, "not safe");
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "\n");
+ if (dump_file)
+ fprintf (dump_file, "\n");
}
if (new_start == 0)
for (loop = current_loop; loop; loop = loop->outer)
{
loop->invalid = 1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"\nLoop at %d ignored due to setjmp.\n",
INSN_UID (loop->start));
}
return;
/* If we get here, we know we need to invalidate a loop. */
- if (loop_dump_stream && ! dest_loop->invalid)
- fprintf (loop_dump_stream,
+ if (dump_file && ! dest_loop->invalid)
+ fprintf (dump_file,
"\nLoop at %d ignored due to multiple entry points.\n",
INSN_UID (dest_loop->start));
{
for (outer_loop = loop; outer_loop; outer_loop = outer_loop->outer)
{
- if (loop_dump_stream && ! outer_loop->invalid)
- fprintf (loop_dump_stream,
+ if (dump_file && ! outer_loop->invalid)
+ fprintf (dump_file,
"\nLoop at %d ignored due to unknown exit jump.\n",
INSN_UID (outer_loop->start));
outer_loop->invalid = 1;
slow enough to read the memory. */
if (PREFETCH_NO_CALL && LOOP_INFO (loop)->has_call)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Prefetch: ignoring loop: has call.\n");
+ if (dump_file)
+ fprintf (dump_file, "Prefetch: ignoring loop: has call.\n");
return;
}
&& LOOP_INFO (loop)->n_iterations
&& LOOP_INFO (loop)->n_iterations <= PREFETCH_LOW_LOOPCNT)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Prefetch: ignoring loop: not enough iterations.\n");
return;
}
heuristics more conservative. */
if (GET_CODE (biv->add_val) != CONST_INT)
{
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Prefetch: ignoring biv %d: non-constant addition at insn %d:",
REGNO (biv->src_reg), INSN_UID (biv->insn));
- print_rtl (loop_dump_stream, biv->add_val);
- fprintf (loop_dump_stream, "\n");
+ print_rtl (dump_file, biv->add_val);
+ fprintf (dump_file, "\n");
}
break;
}
if (biv->maybe_multiple)
{
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Prefetch: ignoring biv %d: maybe_multiple at insn %i:",
REGNO (biv->src_reg), INSN_UID (biv->insn));
- print_rtl (loop_dump_stream, biv->add_val);
- fprintf (loop_dump_stream, "\n");
+ print_rtl (dump_file, biv->add_val);
+ fprintf (dump_file, "\n");
}
break;
}
if (ignore_reason != NULL)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Prefetch: ignoring giv at %d: %s.\n",
INSN_UID (iv->insn), ignore_reason);
continue;
note_stores (PATTERN (iv->insn), check_store, &d);
else
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Prefetch: Ignoring giv at %d: %s\n",
+ if (dump_file)
+ fprintf (dump_file, "Prefetch: Ignoring giv at %d: %s\n",
INSN_UID (iv->insn), "in conditional code.");
continue;
}
num_prefetches++;
if (num_prefetches >= MAX_PREFETCHES)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Maximal number of prefetches exceeded.\n");
return;
}
else
{
info[i].prefetch_in_loop = 0, info[i].prefetch_before_loop = 0;
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Prefetch: ignoring giv at %d: %d%% density is too low.\n",
INSN_UID (info[i].giv->insn), density);
}
{
if ((ahead = SIMULTANEOUS_PREFETCHES / num_real_prefetches) == 0)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Prefetch: ignoring prefetches within loop: ahead is zero; %d < %d\n",
SIMULTANEOUS_PREFETCHES, num_real_prefetches);
num_real_prefetches = 0, num_real_write_prefetches = 0;
num_write_prefetches_before += n;
}
- if (loop_dump_stream)
+ if (dump_file)
{
if (info[i].prefetch_in_loop == 0
&& info[i].prefetch_before_loop == 0)
continue;
- fprintf (loop_dump_stream, "Prefetch insn: %d",
+ fprintf (dump_file, "Prefetch insn: %d",
INSN_UID (info[i].giv->insn));
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"; in loop: %d; before: %d; %s\n",
info[i].prefetch_in_loop,
info[i].prefetch_before_loop,
info[i].write ? "read/write" : "read only");
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
" density: %d%%; bytes_accessed: %u; total_bytes: %u\n",
(int) (info[i].bytes_accessed * 100 / info[i].stride),
info[i].bytes_accessed, info[i].total_bytes);
- fprintf (loop_dump_stream, " index: " HOST_WIDE_INT_PRINT_DEC
+ fprintf (dump_file, " index: " HOST_WIDE_INT_PRINT_DEC
"; stride: " HOST_WIDE_INT_PRINT_DEC "; address: ",
info[i].index, info[i].stride);
- print_rtl (loop_dump_stream, info[i].base_address);
- fprintf (loop_dump_stream, "\n");
+ print_rtl (dump_file, info[i].base_address);
+ fprintf (dump_file, "\n");
}
}
/* Record that this loop uses prefetch instructions. */
LOOP_INFO (loop)->has_prefetch = 1;
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "Real prefetches needed within loop: %d (write: %d)\n",
+ fprintf (dump_file, "Real prefetches needed within loop: %d (write: %d)\n",
num_real_prefetches, num_real_write_prefetches);
- fprintf (loop_dump_stream, "Real prefetches needed before loop: %d (write: %d)\n",
+ fprintf (dump_file, "Real prefetches needed before loop: %d (write: %d)\n",
num_prefetches_before, num_write_prefetches_before);
}
}
move. So leave it alone. */
|| ! bl->incremented)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Biv %d: discarded, %s\n",
+ if (dump_file)
+ fprintf (dump_file, "Biv %d: discarded, %s\n",
bl->regno,
(REG_IV_TYPE (ivs, bl->regno) != BASIC_INDUCT
? "not induction variable"
{
backbl = &bl->next;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Biv %d: verified\n", bl->regno);
+ if (dump_file)
+ fprintf (dump_file, "Biv %d: verified\n", bl->regno);
}
}
}
else
src = SET_SRC (bl->init_set);
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Biv %d: initialized at insn %d: initial value ",
bl->regno, INSN_UID (bl->init_insn));
{
bl->initial_value = src;
- if (loop_dump_stream)
+ if (dump_file)
{
- print_simple_rtl (loop_dump_stream, src);
- fputc ('\n', loop_dump_stream);
+ print_simple_rtl (dump_file, src);
+ fputc ('\n', dump_file);
}
}
/* If we can't make it a giv,
let biv keep initial value of "itself". */
- else if (loop_dump_stream)
- fprintf (loop_dump_stream, "is complex\n");
+ else if (dump_file)
+ fprintf (dump_file, "is complex\n");
}
}
no other loop exits, so we can return any value. */
if (bl->reversed)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final biv value for %d, reversed biv.\n", bl->regno);
return const0_rtx;
loop_iv_add_mult_sink (loop, increment, GEN_INT (n_iterations),
bl->initial_value, tem);
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final biv value for %d, calculated.\n", bl->regno);
return tem;
/* Check to see if the biv is dead at all loop exits. */
if (reg_dead_after_loop (loop, bl->biv->src_reg))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final biv value for %d, biv dead after loop exit.\n",
bl->regno);
#ifdef HAVE_decrement_and_branch_until_zero
if (bl->nonneg)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Cannot eliminate nonneg biv %d.\n", bl->regno);
return 0;
}
|| (bl->final_value = final_biv_value (loop, bl)))
return maybe_eliminate_biv (loop, bl, 0, threshold, insn_count);
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Cannot eliminate biv %d.\n",
bl->regno);
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"First use: insn %d, last use: insn %d.\n",
REGNO_FIRST_UID (bl->regno),
REGNO_LAST_UID (bl->regno));
else
{
end_sequence ();
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"unable to reduce iv in insn %d\n",
INSN_UID (v->insn));
bl->all_reduced = 0;
gen_load_of_final_value (v->dest_reg,
v->final_value));
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "giv at %d reduced to ",
+ fprintf (dump_file, "giv at %d reduced to ",
INSN_UID (v->insn));
- print_simple_rtl (loop_dump_stream, v->new_reg);
- fprintf (loop_dump_stream, "\n");
+ print_simple_rtl (dump_file, v->new_reg);
+ fprintf (dump_file, "\n");
}
}
}
the last loop insn is a jump to the top of the loop. */
if (!JUMP_P (last_loop_insn))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: No final conditional branch found.\n");
return 0;
}
we cannot (easily) determine the iteration count. */
if (LABEL_NUSES (JUMP_LABEL (last_loop_insn)) > 1)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Loop has multiple back edges.\n");
return 0;
}
comparison = get_condition_for_loop (loop, last_loop_insn);
if (comparison == 0)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: No final comparison found.\n");
return 0;
}
if (!REG_P (iteration_var))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Comparison not against register.\n");
return 0;
}
reg_iv_type entry for it. */
if ((unsigned) REGNO (iteration_var) >= ivs->n_regs)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: No reg_iv_type entry for iteration var.\n");
return 0;
}
else if ((GET_MODE_BITSIZE (GET_MODE (iteration_var))
> HOST_BITS_PER_WIDE_INT))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Iteration var rejected because mode too large.\n");
return 0;
}
else if (GET_MODE_CLASS (GET_MODE (iteration_var)) != MODE_INT)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Iteration var not an integer.\n");
return 0;
}
initial_value = bl->initial_value;
if (!bl->biv->always_executed || bl->biv->maybe_multiple)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Basic induction var not set once in each iteration.\n");
return 0;
}
if (!v->always_executed || v->maybe_multiple)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: General induction var not set once in each iteration.\n");
return 0;
}
{
if (REG_P (biv_inc->add_val))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Basic induction var add_val is REG %d.\n",
REGNO (biv_inc->add_val));
return 0;
}
}
}
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Giv iterator, initial value bias %ld.\n",
(long) offset);
}
else
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Not basic or general induction var.\n");
return 0;
}
if (increment == 0)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Loop iterations: Increment value can't be calculated.\n");
return 0;
}
if (GET_CODE (increment) != CONST_INT)
{
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Loop iterations: Increment value not constant ");
- print_simple_rtl (loop_dump_stream, increment);
- fprintf (loop_dump_stream, ".\n");
+ print_simple_rtl (dump_file, increment);
+ fprintf (dump_file, ".\n");
}
return 0;
}
if (GET_CODE (initial_value) != CONST_INT)
{
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Loop iterations: Initial value not constant ");
- print_simple_rtl (loop_dump_stream, initial_value);
- fprintf (loop_dump_stream, ".\n");
+ print_simple_rtl (dump_file, initial_value);
+ fprintf (dump_file, ".\n");
}
return 0;
}
else if (GET_CODE (final_value) != CONST_INT)
{
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream,
+ fprintf (dump_file,
"Loop iterations: Final value not constant ");
- print_simple_rtl (loop_dump_stream, final_value);
- fprintf (loop_dump_stream, ".\n");
+ print_simple_rtl (dump_file, final_value);
+ fprintf (dump_file, ".\n");
}
return 0;
}
{
rtx inc_once;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Loop iterations: EQ comparison loop.\n");
+ if (dump_file)
+ fprintf (dump_file, "Loop iterations: EQ comparison loop.\n");
inc_once = gen_int_mode (INTVAL (initial_value) + INTVAL (increment),
GET_MODE (iteration_var));
;
else
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Loop iterations: Not normal loop.\n");
+ if (dump_file)
+ fprintf (dump_file, "Loop iterations: Not normal loop.\n");
return 0;
}
if (v->lifetime * threshold * benefit < insn_count
&& ! bl->reversed)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"giv of insn %d not worth while, %d vs %d.\n",
INSN_UID (v->insn),
v->lifetime * threshold * benefit, insn_count);
&& (may_trap_or_fault_p (v->add_val)
|| may_trap_or_fault_p (v->mult_val)))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"giv of insn %d: not always computable.\n",
INSN_UID (v->insn));
v->ignore = 1;
if (tv->mult_val == const1_rtx
&& ! product_cheap_p (tv->add_val, v->mult_val))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"giv of insn %d: would need a multiply.\n",
INSN_UID (v->insn));
v->ignore = 1;
gen_load_of_final_value (bl->biv->dest_reg,
bl->final_value));
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Reg %d: biv eliminated\n",
+ if (dump_file)
+ fprintf (dump_file, "Reg %d: biv eliminated\n",
bl->regno);
}
/* See above note wrt final_value. But since we couldn't eliminate
INSN_CODE (p) = -1;
}
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "\n");
+ if (dump_file)
+ fprintf (dump_file, "\n");
loop_ivs_free (loop);
if (reg_map)
if (mult_val == const1_rtx)
bl->incremented = 1;
- if (loop_dump_stream)
- loop_biv_dump (v, loop_dump_stream, 0);
+ if (dump_file)
+ loop_biv_dump (v, dump_file, 0);
}
\f
/* Fill in the data about one giv.
}
}
- if (loop_dump_stream)
- loop_giv_dump (v, loop_dump_stream, 0);
+ if (dump_file)
+ loop_giv_dump (v, dump_file, 0);
}
/* Try to calculate the final value of the giv, the value it will have at
and there are no other loop exits, so we can return any value. */
if (bl->reversed)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final giv value for %d, depends on reversed biv\n",
REGNO (v->dest_reg));
return const0_rtx;
/* Now calculate the giv's final value. */
loop_iv_add_mult_sink (loop, tem, v->mult_val, v->add_val, tem);
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final giv value for %d, calc from biv's value.\n",
REGNO (v->dest_reg));
/* Check to see if the biv is dead at all loop exits. */
if (reg_dead_after_loop (loop, v->dest_reg))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Final giv value for %d, giv dead after loop exit.\n",
REGNO (v->dest_reg));
v->replaceable = 0;
v->not_replaceable = 1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Found branch outside giv lifetime.\n");
break;
v->final_value = final_value;
}
- if (loop_dump_stream && v->replaceable)
- fprintf (loop_dump_stream, "Insn %d: giv reg %d final_value replaceable\n",
+ if (dump_file && v->replaceable)
+ fprintf (dump_file, "Insn %d: giv reg %d final_value replaceable\n",
INSN_UID (v->insn), REGNO (v->dest_reg));
}
\f
if (incr != 0
&& extension_within_bounds_p (loop, bl, incr, v->ext_dependent))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Verified ext dependent giv at %d of reg %d\n",
INSN_UID (v->insn), bl->regno);
}
else
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Failed ext dependent giv at %d\n",
INSN_UID (v->insn));
restart:
qsort (stats, giv_count, sizeof (*stats), cmp_combine_givs_stats);
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "Sorted combine statistics:\n");
+ fprintf (dump_file, "Sorted combine statistics:\n");
for (k = 0; k < giv_count; k++)
{
g1 = giv_array[stats[k].giv_number];
if (!g1->combined_with && !g1->same)
- fprintf (loop_dump_stream, " {%d, %d}",
+ fprintf (dump_file, " {%d, %d}",
INSN_UID (giv_array[stats[k].giv_number]->insn),
stats[k].total_benefit);
}
- putc ('\n', loop_dump_stream);
+ putc ('\n', dump_file);
}
for (k = 0; k < giv_count; k++)
stats[l].total_benefit -= g2->benefit + extra_benefit;
}
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"giv at %d combined with giv at %d; new benefit %d + %d, lifetime %d\n",
INSN_UID (g2->insn), INSN_UID (g1->insn),
g1->benefit, g1_add_benefit, g1->lifetime);
rtx tem;
/* Loop can be reversed. */
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "Can reverse loop\n");
+ if (dump_file)
+ fprintf (dump_file, "Can reverse loop\n");
/* Now check other conditions:
bl->reversed = 1;
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "Reversed loop");
+ fprintf (dump_file, "Reversed loop");
if (bl->nonneg)
- fprintf (loop_dump_stream, " and added reg_nonneg\n");
+ fprintf (dump_file, " and added reg_nonneg\n");
else
- fprintf (loop_dump_stream, "\n");
+ fprintf (dump_file, "\n");
}
return 1;
&& ! maybe_eliminate_biv_1 (loop, PATTERN (p), p, bl,
eliminate_p, where_bb, where_insn))
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
"Cannot eliminate biv %d: biv used in insn %d.\n",
bl->regno, INSN_UID (p));
break;
if (p == loop->end)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "biv %d %s eliminated.\n",
+ if (dump_file)
+ fprintf (dump_file, "biv %d %s eliminated.\n",
bl->regno, eliminate_p ? "was" : "can be");
return 1;
}
loop_insn_emit_after (loop, 0, label, set);
}
- if (loop_dump_stream)
+ if (dump_file)
{
- fprintf (loop_dump_stream, "Hoisted regno %d %s from ",
+ fprintf (dump_file, "Hoisted regno %d %s from ",
REGNO (reg), (written ? "r/w" : "r/o"));
- print_rtl (loop_dump_stream, mem);
- fputc ('\n', loop_dump_stream);
+ print_rtl (dump_file, mem);
+ fputc ('\n', dump_file);
}
/* Attempt a bit of copy propagation. This helps untangle the
gcc_assert (init_insn);
if (apply_change_group ())
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, " Replaced reg %d", regno);
+ if (dump_file)
+ fprintf (dump_file, " Replaced reg %d", regno);
if (store_is_first && replaced_last)
{
rtx first;
/* Delete the instructions. */
loop_delete_insns (first, init_insn);
}
- if (loop_dump_stream)
- fprintf (loop_dump_stream, ".\n");
+ if (dump_file)
+ fprintf (dump_file, ".\n");
}
}
{
while (1)
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream, ", deleting init_insn (%d)",
+ if (dump_file)
+ fprintf (dump_file, ", deleting init_insn (%d)",
INSN_UID (first));
delete_insn (first);
if (apply_change_group ())
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
+ if (dump_file)
+ fprintf (dump_file,
" Swapped set of reg %d at %d with reg %d at %d.\n",
regno, INSN_UID (insn),
new_regno, INSN_UID (prev_insn));
cleanup_barriers ();
/* We only want to perform unrolling once. */
- loop_optimize (get_insns (), dump_file, 0);
+ loop_optimize (get_insns (), 0);
/* The first call to loop_optimize makes some instructions
trivially dead. We delete those instructions now in the
reg_scan (get_insns (), max_reg_num ());
}
cleanup_barriers ();
- loop_optimize (get_insns (), dump_file, do_prefetch);
+ loop_optimize (get_insns (), do_prefetch);
/* Loop can create trivially dead instructions. */
delete_trivially_dead_insns (get_insns (), max_reg_num ());
necessary mode switches. Return true if we did work. */
static int
-optimize_mode_switching (FILE *file)
+optimize_mode_switching (void)
{
rtx insn;
int e;
FOR_EACH_BB (bb)
sbitmap_not (kill[bb->index], transp[bb->index]);
- edge_list = pre_edge_lcm (file, n_entities, transp, comp, antic,
+ edge_list = pre_edge_lcm (n_entities, transp, comp, antic,
kill, &insert, &delete);
for (j = n_entities - 1; j >= 0; j--)
{
#ifdef OPTIMIZE_MODE_SWITCHING
no_new_pseudos = 0;
- optimize_mode_switching (NULL);
+ optimize_mode_switching ();
no_new_pseudos = 1;
#endif /* OPTIMIZE_MODE_SWITCHING */
}
static int issue_rate;
-/* For printing statistics. */
-static FILE *stats_file;
-
static int sms_order_nodes (ddg_ptr, int, int * result);
static void set_node_sched_params (ddg_ptr);
-static partial_schedule_ptr sms_schedule_by_order (ddg_ptr, int, int,
- int *, FILE*);
+static partial_schedule_ptr sms_schedule_by_order (ddg_ptr, int, int, int *);
static void permute_partial_schedule (partial_schedule_ptr ps, rtx last);
static void generate_prolog_epilog (partial_schedule_ptr ,struct loop * loop, rtx);
static void duplicate_insns_of_cycles (partial_schedule_ptr ps,
}
static void
-print_node_sched_params (FILE * dump_file, int num_nodes)
+print_node_sched_params (FILE * file, int num_nodes)
{
int i;
- if (! dump_file)
+ if (! file)
return;
for (i = 0; i < num_nodes; i++)
{
rtx reg_move = nsp->first_reg_move;
int j;
- fprintf (dump_file, "Node %d:\n", i);
- fprintf (dump_file, " asap = %d:\n", nsp->asap);
- fprintf (dump_file, " time = %d:\n", nsp->time);
- fprintf (dump_file, " nreg_moves = %d:\n", nsp->nreg_moves);
+ fprintf (file, "Node %d:\n", i);
+ fprintf (file, " asap = %d:\n", nsp->asap);
+ fprintf (file, " time = %d:\n", nsp->time);
+ fprintf (file, " nreg_moves = %d:\n", nsp->nreg_moves);
for (j = 0; j < nsp->nreg_moves; j++)
{
- fprintf (dump_file, " reg_move = ");
- print_rtl_single (dump_file, reg_move);
+ fprintf (file, " reg_move = ");
+ print_rtl_single (file, reg_move);
reg_move = PREV_INSN (reg_move);
}
}
/* Return true if the loop is in its canonical form and false if not.
i.e. SIMPLE_SMS_LOOP_P and have one preheader block, and single exit. */
static bool
-loop_canon_p (struct loop *loop, FILE *dump_file)
+loop_canon_p (struct loop *loop)
{
if (loop->inner || ! loop->outer)
{
expanded_location xloc;
NOTE_EXPANDED_LOCATION (xloc, line_note);
- fprintf (stats_file, " %s %d (file, line)\n",
+ fprintf (dump_file, " %s %d (file, line)\n",
xloc.file, xloc.line);
}
}
{
expanded_location xloc;
NOTE_EXPANDED_LOCATION (xloc, line_note);
- fprintf (stats_file, " %s %d (file, line)\n",
+ fprintf (dump_file, " %s %d (file, line)\n",
xloc.file, xloc.line);
}
}
/* Main entry point, perform SMS scheduling on the loops of the function
that consist of single basic blocks. */
static void
-sms_schedule (FILE *dump_file)
+sms_schedule (void)
{
static int passes = 0;
rtx insn;
edge latch_edge;
gcov_type trip_count = 0;
- loops = loop_optimizer_init (dump_file, (LOOPS_HAVE_PREHEADERS
- | LOOPS_HAVE_MARKED_SINGLE_EXITS));
+ loops = loop_optimizer_init (LOOPS_HAVE_PREHEADERS
+ | LOOPS_HAVE_MARKED_SINGLE_EXITS);
if (!loops)
return; /* There is no loops to schedule. */
- stats_file = dump_file;
-
/* Initialize issue_rate. */
if (targetm.sched.issue_rate)
{
/* Initialize the scheduler. */
current_sched_info = &sms_sched_info;
- sched_init (NULL);
+ sched_init ();
/* Init Data Flow analysis, to be used in interloop dep calculation. */
df = df_init (DF_HARD_REGS | DF_EQUIV_NOTES | DF_SUBREGS);
break;
}
- if (! loop_canon_p (loop, dump_file))
+ if (! loop_canon_p (loop))
continue;
if (! loop_single_full_bb_p (loop))
if ( latch_edge->count
&& (latch_edge->count < loop->single_exit->count * SMS_LOOP_AVERAGE_COUNT_THRESHOLD))
{
- if (stats_file)
+ if (dump_file)
{
rtx line_note = find_line_note (tail);
{
expanded_location xloc;
NOTE_EXPANDED_LOCATION (xloc, line_note);
- fprintf (stats_file, "SMS bb %s %d (file, line)\n",
+ fprintf (dump_file, "SMS bb %s %d (file, line)\n",
xloc.file, xloc.line);
}
- fprintf (stats_file, "SMS single-bb-loop\n");
+ fprintf (dump_file, "SMS single-bb-loop\n");
if (profile_info && flag_branch_probabilities)
{
- fprintf (stats_file, "SMS loop-count ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "SMS loop-count ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT) bb->count);
- fprintf (stats_file, "\n");
- fprintf (stats_file, "SMS trip-count ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "\n");
+ fprintf (dump_file, "SMS trip-count ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT) trip_count);
- fprintf (stats_file, "\n");
- fprintf (stats_file, "SMS profile-sum-max ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "\n");
+ fprintf (dump_file, "SMS profile-sum-max ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT) profile_info->sum_max);
- fprintf (stats_file, "\n");
+ fprintf (dump_file, "\n");
}
}
continue;
if (insn != NEXT_INSN (tail))
{
- if (stats_file)
+ if (dump_file)
{
if (CALL_P (insn))
- fprintf (stats_file, "SMS loop-with-call\n");
+ fprintf (dump_file, "SMS loop-with-call\n");
else if (BARRIER_P (insn))
- fprintf (stats_file, "SMS loop-with-barrier\n");
+ fprintf (dump_file, "SMS loop-with-barrier\n");
else
- fprintf (stats_file, "SMS loop-with-not-single-set\n");
- print_rtl_single (stats_file, insn);
+ fprintf (dump_file, "SMS loop-with-not-single-set\n");
+ print_rtl_single (dump_file, insn);
}
continue;
if (! (g = create_ddg (bb, df, 0)))
{
- if (stats_file)
- fprintf (stats_file, "SMS doloop\n");
+ if (dump_file)
+ fprintf (dump_file, "SMS doloop\n");
continue;
}
if (loop->single_exit->count)
trip_count = latch_edge->count / loop->single_exit->count;
- if (stats_file)
+ if (dump_file)
{
rtx line_note = find_line_note (tail);
{
expanded_location xloc;
NOTE_EXPANDED_LOCATION (xloc, line_note);
- fprintf (stats_file, "SMS bb %s %d (file, line)\n",
+ fprintf (dump_file, "SMS bb %s %d (file, line)\n",
xloc.file, xloc.line);
}
- fprintf (stats_file, "SMS single-bb-loop\n");
+ fprintf (dump_file, "SMS single-bb-loop\n");
if (profile_info && flag_branch_probabilities)
{
- fprintf (stats_file, "SMS loop-count ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "SMS loop-count ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT) bb->count);
- fprintf (stats_file, "\n");
- fprintf (stats_file, "SMS profile-sum-max ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "\n");
+ fprintf (dump_file, "SMS profile-sum-max ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT) profile_info->sum_max);
- fprintf (stats_file, "\n");
+ fprintf (dump_file, "\n");
}
- fprintf (stats_file, "SMS doloop\n");
- fprintf (stats_file, "SMS built-ddg %d\n", g->num_nodes);
- fprintf (stats_file, "SMS num-loads %d\n", g->num_loads);
- fprintf (stats_file, "SMS num-stores %d\n", g->num_stores);
+ fprintf (dump_file, "SMS doloop\n");
+ fprintf (dump_file, "SMS built-ddg %d\n", g->num_nodes);
+ fprintf (dump_file, "SMS num-loads %d\n", g->num_loads);
+ fprintf (dump_file, "SMS num-stores %d\n", g->num_stores);
}
}
gcc_assert (count_reg);
- if (stats_file && count_init)
+ if (dump_file && count_init)
{
- fprintf (stats_file, "SMS const-doloop ");
- fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC,
+ fprintf (dump_file, "SMS const-doloop ");
+ fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC,
loop_count);
- fprintf (stats_file, "\n");
+ fprintf (dump_file, "\n");
}
node_order = XNEWVEC (int, g->num_nodes);
mii = MAX (res_MII (g), rec_mii);
maxii = (calculate_maxii (g) * SMS_MAX_II_FACTOR) / 100;
- if (stats_file)
- fprintf (stats_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n",
+ if (dump_file)
+ fprintf (dump_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n",
rec_mii, mii, maxii);
/* After sms_order_nodes and before sms_schedule_by_order, to copy over
ASAP. */
set_node_sched_params (g);
- ps = sms_schedule_by_order (g, mii, maxii, node_order, dump_file);
+ ps = sms_schedule_by_order (g, mii, maxii, node_order);
if (ps)
stage_count = PS_STAGE_COUNT (ps);
int new_cycles;
struct undo_replace_buff_elem *reg_move_replaces;
- if (stats_file)
+ if (dump_file)
{
- fprintf (stats_file,
+ fprintf (dump_file,
"SMS succeeded %d %d (with ii, sc)\n", ps->ii,
stage_count);
- print_partial_schedule (ps, stats_file);
- fprintf (stats_file,
+ print_partial_schedule (ps, dump_file);
+ fprintf (dump_file,
"SMS Branch (%d) will later be scheduled at cycle %d.\n",
g->closing_branch->cuid, PS_MIN_CYCLE (ps) - 1);
}
/* Release scheduler data, needed until now because of DFA. */
sched_finish ();
- loop_optimizer_finalize (loops, dump_file);
+ loop_optimizer_finalize (loops);
}
/* The SMS scheduling algorithm itself
/* This function implements the scheduling algorithm for SMS according to the
above algorithm. */
static partial_schedule_ptr
-sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order, FILE *dump_file)
+sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
{
int ii = mii;
int i, c, success;
no_new_pseudos = 0;
/* Collect loop information to be used in SMS. */
cfg_layout_initialize (CLEANUP_UPDATE_LIFE);
- sms_schedule (dump_file);
+ sms_schedule ();
/* Update the life information, because we add pseudos. */
max_regno = max_reg_num ();
Remove now useless prediction entries. */
static void
-combine_predictions_for_bb (FILE *file, basic_block bb)
+combine_predictions_for_bb (basic_block bb)
{
int best_probability = PROB_EVEN;
int best_predictor = END_PREDICTORS;
if (!bb->count)
set_even_probabilities (bb);
bb->predictions = NULL;
- if (file)
- fprintf (file, "%i edges in bb %i predicted to even probabilities\n",
+ if (dump_file)
+ fprintf (dump_file, "%i edges in bb %i predicted to even probabilities\n",
nedges, bb->index);
return;
}
- if (file)
- fprintf (file, "Predictions for bb %i\n", bb->index);
+ if (dump_file)
+ fprintf (dump_file, "Predictions for bb %i\n", bb->index);
/* We implement "first match" heuristics and use probability guessed
by predictor with smallest index. */
first_match = true;
if (!found)
- dump_prediction (file, PRED_NO_PREDICTION, combined_probability, bb, true);
+ dump_prediction (dump_file, PRED_NO_PREDICTION, combined_probability, bb, true);
else
{
- dump_prediction (file, PRED_DS_THEORY, combined_probability, bb,
+ dump_prediction (dump_file, PRED_DS_THEORY, combined_probability, bb,
!first_match);
- dump_prediction (file, PRED_FIRST_MATCH, best_probability, bb,
+ dump_prediction (dump_file, PRED_FIRST_MATCH, best_probability, bb,
first_match);
}
if (first_match)
combined_probability = best_probability;
- dump_prediction (file, PRED_COMBINED, combined_probability, bb, true);
+ dump_prediction (dump_file, PRED_COMBINED, combined_probability, bb, true);
for (pred = bb->predictions; pred; pred = pred->ep_next)
{
if (pred->ep_edge != EDGE_SUCC (bb, 0))
probability = REG_BR_PROB_BASE - probability;
- dump_prediction (file, predictor, probability, bb,
+ dump_prediction (dump_file, predictor, probability, bb,
!first_match || best_predictor == predictor);
}
bb->predictions = NULL;
tree_predict_by_opcode (bb);
}
FOR_EACH_BB (bb)
- combine_predictions_for_bb (dump_file, bb);
+ combine_predictions_for_bb (bb);
if (!flag_loop_optimize)
strip_builtin_expect ();
/* Hooks for profiling. */
static struct profile_hooks* profile_hooks;
-/* File for profiling debug output. */
-static inline FILE*
-profile_dump_file (void) {
- return profile_hooks->profile_dump_file ();
-}
-
/* Additional information about the edges we need. */
struct edge_info {
unsigned int count_valid : 1;
/* Re-merge split basic blocks and the mess introduced by
insert_insn_on_edge. */
cleanup_cfg (profile_arc_flag ? CLEANUP_EXPENSIVE : 0);
- if (profile_dump_file())
- dump_flow_info (profile_dump_file());
+ if (dump_file)
+ dump_flow_info (dump_file);
}
free_edge_list (el);
/* Perform the peephole2 optimization pass. */
static void
-peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
+peephole2_optimize (void)
{
rtx insn, prev;
regset live;
rest_of_handle_peephole2 (void)
{
#ifdef HAVE_peephole2
- peephole2_optimize (dump_file);
+ peephole2_optimize ();
#endif
}
should have been defined by now. */
static bool
-compensate_edge (edge e, FILE *file)
+compensate_edge (edge e)
{
basic_block source = e->src, target = e->dest;
stack target_stack = &BLOCK_INFO (target)->stack_in;
struct stack_def regstack;
int reg;
- if (file)
- fprintf (file, "Edge %d->%d: ", source->index, target->index);
+ if (dump_file)
+ fprintf (dump_file, "Edge %d->%d: ", source->index, target->index);
gcc_assert (target_stack->top != -2);
if (reg == -1)
{
- if (file)
- fprintf (file, "no changes needed\n");
+ if (dump_file)
+ fprintf (dump_file, "no changes needed\n");
return false;
}
}
- if (file)
+ if (dump_file)
{
- fprintf (file, "correcting stack to ");
- print_stack (file, target_stack);
+ fprintf (dump_file, "correcting stack to ");
+ print_stack (dump_file, target_stack);
}
/* Abnormal calls may appear to have values live in st(0), but the
source block to the stack_in of the destination block. */
static bool
-compensate_edges (FILE *file)
+compensate_edges (void)
{
bool inserted = false;
basic_block bb;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->succs)
- inserted |= compensate_edge (e, file);
+ inserted |= compensate_edge (e);
}
return inserted;
}
/* Convert stack register references in one block. */
static void
-convert_regs_1 (FILE *file, basic_block block)
+convert_regs_1 (basic_block block)
{
struct stack_def regstack;
block_info bi = BLOCK_INFO (block);
}
}
- if (file)
+ if (dump_file)
{
- fprintf (file, "\nBasic block %d\nInput stack: ", block->index);
- print_stack (file, &bi->stack_in);
+ fprintf (dump_file, "\nBasic block %d\nInput stack: ", block->index);
+ print_stack (dump_file, &bi->stack_in);
}
/* Process all insns in this block. Keep track of NEXT so that we
if (stack_regs_mentioned (insn)
|| CALL_P (insn))
{
- if (file)
+ if (dump_file)
{
- fprintf (file, " insn %d input stack: ",
+ fprintf (dump_file, " insn %d input stack: ",
INSN_UID (insn));
- print_stack (file, ®stack);
+ print_stack (dump_file, ®stack);
}
control_flow_insn_deleted |= subst_stack_regs (insn, ®stack);
starting_stack_p = false;
}
while (next);
- if (file)
+ if (dump_file)
{
- fprintf (file, "Expected live registers [");
+ fprintf (dump_file, "Expected live registers [");
for (reg = FIRST_STACK_REG; reg <= LAST_STACK_REG; ++reg)
if (TEST_HARD_REG_BIT (bi->out_reg_set, reg))
- fprintf (file, " %d", reg);
- fprintf (file, " ]\nOutput stack: ");
- print_stack (file, ®stack);
+ fprintf (dump_file, " %d", reg);
+ fprintf (dump_file, " ]\nOutput stack: ");
+ print_stack (dump_file, ®stack);
}
insn = BB_END (block);
{
rtx set;
- if (file)
- fprintf (file, "Emitting insn initializing reg %d\n", reg);
+ if (dump_file)
+ fprintf (dump_file, "Emitting insn initializing reg %d\n", reg);
set = gen_rtx_SET (VOIDmode, FP_MODE_REG (reg, SFmode), not_a_num);
insn = emit_insn_after (set, insn);
/* Convert registers in all blocks reachable from BLOCK. */
static void
-convert_regs_2 (FILE *file, basic_block block)
+convert_regs_2 (basic_block block)
{
basic_block *stack, *sp;
*sp++ = e->dest;
}
- convert_regs_1 (file, block);
+ convert_regs_1 (block);
}
while (sp != stack);
to the stack-like registers the 387 uses. */
static void
-convert_regs (FILE *file)
+convert_regs (void)
{
int inserted;
basic_block b;
/* Process all blocks reachable from all entry points. */
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- convert_regs_2 (file, e->dest);
+ convert_regs_2 (e->dest);
/* ??? Process all unreachable blocks. Though there's no excuse
for keeping these even when not optimizing. */
block_info bi = BLOCK_INFO (b);
if (! bi->done)
- convert_regs_2 (file, b);
+ convert_regs_2 (b);
}
- inserted |= compensate_edges (file);
+ inserted |= compensate_edges ();
clear_aux_for_blocks ();
if (inserted)
commit_edge_insertions ();
- if (file)
- fputc ('\n', file);
+ if (dump_file)
+ fputc ('\n', dump_file);
}
\f
/* Convert register usage from "flat" register file usage to a "stack
the edges. */
static bool
-reg_to_stack (FILE *file)
+reg_to_stack (void)
{
basic_block bb;
int i;
&& flag_schedule_insns_after_reload))
{
count_or_remove_death_notes (NULL, 1);
- life_analysis (file, PROP_DEATH_NOTES);
+ life_analysis (PROP_DEATH_NOTES);
}
mark_dfs_back_edges ();
VARRAY_CHAR_INIT (stack_regs_mentioned_data, max_uid + 1,
"stack_regs_mentioned cache");
- convert_regs (file);
+ convert_regs ();
free_aux_for_blocks ();
return true;
rest_of_handle_stack_regs (void)
{
#ifdef STACK_REGS
- if (reg_to_stack (dump_file) && optimize)
+ if (reg_to_stack () && optimize)
{
if (cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
| (flag_crossjumping ? CLEANUP_CROSSJUMP : 0))
This pass comes just before local register allocation. */
void
-regclass (rtx f, int nregs, FILE *dump)
+regclass (rtx f, int nregs)
{
rtx insn;
int i;
{
basic_block bb;
- if (dump)
- fprintf (dump, "\n\nPass %i\n\n",pass);
+ if (dump_file)
+ fprintf (dump_file, "\n\nPass %i\n\n",pass);
/* Zero out our accumulation of the cost of each class for each reg. */
memset (costs, 0, nregs * sizeof (struct costs));
if (pass == 0)
reg_pref = reg_pref_buffer;
- if (dump)
+ if (dump_file)
{
- dump_regclass (dump);
- fprintf (dump,"\n");
+ dump_regclass (dump_file);
+ fprintf (dump_file,"\n");
}
for (i = FIRST_PSEUDO_REGISTER; i < nregs; i++)
{
should be provided as a register class. Don't do this if we
will be doing it again later. */
- if ((pass == 1 || dump) || ! flag_expensive_optimizations)
+ if ((pass == 1 || dump_file) || ! flag_expensive_optimizations)
for (class = 0; class < N_REG_CLASSES; class++)
if (p->cost[class] < p->mem_cost
&& (reg_class_size[(int) reg_class_subunion[(int) alt][class]]
if (alt == best)
alt = NO_REGS;
- if (dump
+ if (dump_file
&& (reg_pref[i].prefclass != (int) best
|| reg_pref[i].altclass != (int) alt))
{
- fprintf (dump, " Register %i", i);
+ fprintf (dump_file, " Register %i", i);
if (alt == ALL_REGS || best == ALL_REGS)
- fprintf (dump, " pref %s\n", reg_class_names[(int) best]);
+ fprintf (dump_file, " pref %s\n", reg_class_names[(int) best]);
else if (alt == NO_REGS)
- fprintf (dump, " pref %s or none\n", reg_class_names[(int) best]);
+ fprintf (dump_file, " pref %s or none\n", reg_class_names[(int) best]);
else
- fprintf (dump, " pref %s, else %s\n",
+ fprintf (dump_file, " pref %s, else %s\n",
reg_class_names[(int) best],
reg_class_names[(int) alt]);
}
static int try_auto_increment (rtx, rtx, rtx, rtx, HOST_WIDE_INT, int);
static int find_matches (rtx, struct match *);
static void replace_in_call_usage (rtx *, unsigned int, rtx, rtx);
-static int fixup_match_1 (rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *);
+static int fixup_match_1 (rtx, rtx, rtx, rtx, rtx, int, int, int);
static int reg_is_remote_constant_p (rtx, rtx, rtx);
static int stable_and_no_regs_but_for_p (rtx, rtx, rtx);
static int regclass_compatible_p (int, int);
static int replacement_quality (rtx);
-static int fixup_match_2 (rtx, rtx, rtx, rtx, FILE *);
+static int fixup_match_2 (rtx, rtx, rtx, rtx);
/* Return nonzero if registers with CLASS1 and CLASS2 can be merged without
causing too much register allocation problems. */
hard register as ultimate source, like the frame pointer. */
static int
-fixup_match_2 (rtx insn, rtx dst, rtx src, rtx offset, FILE *regmove_dump_file)
+fixup_match_2 (rtx insn, rtx dst, rtx src, rtx offset)
{
rtx p, dst_death = 0;
int length, num_calls = 0;
REG_N_CALLS_CROSSED (REGNO (dst)) += num_calls;
}
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
+ if (dump_file)
+ fprintf (dump_file,
"Fixed operand of insn %d.\n",
INSN_UID (insn));
(or 0 if none should be output). */
static void
-regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
+regmove_optimize (rtx f, int nregs)
{
int old_max_uid = get_max_uid ();
rtx insn;
if (! flag_regmove && pass >= flag_expensive_optimizations)
goto done;
- if (regmove_dump_file)
- fprintf (regmove_dump_file, "Starting %s pass...\n",
+ if (dump_file)
+ fprintf (dump_file, "Starting %s pass...\n",
pass ? "backward" : "forward");
for (insn = pass ? get_last_insn () : f; insn;
continue;
if (fixup_match_1 (insn, set, src, src_subreg, dst, pass,
- op_no, match_no,
- regmove_dump_file))
+ op_no, match_no))
break;
}
}
/* A backward pass. Replace input operands with output operands. */
- if (regmove_dump_file)
- fprintf (regmove_dump_file, "Starting backward pass...\n");
+ if (dump_file)
+ fprintf (dump_file, "Starting backward pass...\n");
for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
{
&& GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT
&& XEXP (SET_SRC (set), 0) == src
&& fixup_match_2 (insn, dst, src,
- XEXP (SET_SRC (set), 1),
- regmove_dump_file))
+ XEXP (SET_SRC (set), 1)))
break;
continue;
}
}
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
+ if (dump_file)
+ fprintf (dump_file,
"Could fix operand %d of insn %d matching operand %d.\n",
op_no, INSN_UID (insn), match_no);
REG_LIVE_LENGTH (srcno) = 2;
}
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
+ if (dump_file)
+ fprintf (dump_file,
"Fixed operand %d of insn %d matching operand %d.\n",
op_no, INSN_UID (insn), match_no);
static int
fixup_match_1 (rtx insn, rtx set, rtx src, rtx src_subreg, rtx dst,
- int backward, int operand_number, int match_number,
- FILE *regmove_dump_file)
+ int backward, int operand_number, int match_number)
{
rtx p;
rtx post_inc = 0, post_inc_set = 0, search_end = 0;
code = NOTE;
}
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
+ if (dump_file)
+ fprintf (dump_file,
"Could fix operand %d of insn %d matching operand %d.\n",
operand_number, INSN_UID (insn), match_number);
if (REG_LIVE_LENGTH (REGNO (dst)) < 2)
REG_LIVE_LENGTH (REGNO (dst)) = 2;
}
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
+ if (dump_file)
+ fprintf (dump_file,
"Fixed operand %d of insn %d matching operand %d.\n",
operand_number, INSN_UID (insn), match_number);
return 1;
static void
rest_of_handle_regmove (void)
{
- regmove_optimize (get_insns (), max_reg_num (), dump_file);
+ regmove_optimize (get_insns (), max_reg_num ());
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
}
static void
rest_of_handle_stack_adjustments (void)
{
- life_analysis (dump_file, PROP_POSTRELOAD);
+ life_analysis (PROP_POSTRELOAD);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
| (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
/* Try to find insns to place in delay slots. */
void
-dbr_schedule (rtx first, FILE *file)
+dbr_schedule (rtx first)
{
rtx insn, next, epilogue_insn = 0;
int i;
rest_of_handle_delay_slots (void)
{
#ifdef DELAY_SLOTS
- dbr_schedule (get_insns (), dump_file);
+ dbr_schedule (get_insns ());
#endif
}
/* Update notes. */
count_or_remove_death_notes (NULL, 1);
- life_analysis (dump_file, PROP_DEATH_NOTES |
- PROP_SCAN_DEAD_CODE |
- PROP_KILL_DEAD_CODE);
+ life_analysis (PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
+ | PROP_KILL_DEAD_CODE);
/* Extra cleanup. */
cleanup_cfg (CLEANUP_EXPENSIVE |
static void
rest_of_rtl_seqabstr (void)
{
- life_analysis (dump_file, PROP_DEATH_NOTES |
- PROP_SCAN_DEAD_CODE |
- PROP_KILL_DEAD_CODE);
+ life_analysis (PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE);
cleanup_cfg (CLEANUP_EXPENSIVE |
CLEANUP_UPDATE_LIFE |
safe_insert_insn_on_edge (sequence, e);
}
-/* Return the file on which profile dump output goes, if any. */
-
-static FILE *rtl_profile_dump_file (void) {
- return dump_file;
-}
\f
struct profile_hooks rtl_profile_hooks =
{
rtl_gen_interval_profiler,
rtl_gen_pow2_profiler,
rtl_gen_one_value_profiler,
- rtl_gen_const_delta_profiler,
- rtl_profile_dump_file
+ rtl_gen_const_delta_profiler
};
/* In cse.c */
extern int delete_trivially_dead_insns (rtx, int);
-extern int cse_main (rtx, int, FILE *);
+extern int cse_main (rtx, int);
extern int exp_equiv_p (rtx, rtx, int, bool);
extern unsigned hash_rtx (rtx x, enum machine_mode, int *, int *, bool);
extern void remove_insn (rtx);
extern void emit_insn_after_with_line_notes (rtx, rtx, rtx);
extern rtx emit (rtx);
-extern void renumber_insns (FILE *);
+extern void renumber_insns (void);
extern void remove_unnecessary_notes (void);
extern rtx delete_insn (rtx);
extern rtx entry_of_function (void);
extern void debug_insn_slim (rtx x);
/* In sched-rgn.c. */
-extern void schedule_insns (FILE *);
+extern void schedule_insns (void);
/* In sched-ebb.c. */
-extern void schedule_ebbs (FILE *);
+extern void schedule_ebbs (void);
/* In haifa-sched.c. */
extern void fix_sched_param (const char *, const char *);
extern void init_fake_stack_mems (void);
extern void init_reg_sets (void);
extern void regclass_init (void);
-extern void regclass (rtx, int, FILE *);
+extern void regclass (rtx, int);
extern void reg_scan (rtx, unsigned int);
extern void reg_scan_update (rtx, rtx, unsigned int);
extern void fix_register (const char *, int, int);
enum machine_mode);
/* In reorg.c */
-extern void dbr_schedule (rtx, FILE *);
+extern void dbr_schedule (rtx);
/* In local-alloc.c */
extern void dump_local_alloc (FILE *);
#include "params.h"
#include "sched-int.h"
#include "target.h"
+#include "output.h"
\f
/* The number of insns to be scheduled in total. */
static int target_n_insns;
return b;
}
-/* The one entry point in this file. DUMP_FILE is the dump file for
- this pass. */
+/* The one entry point in this file. */
void
-schedule_ebbs (FILE *dump_file)
+schedule_ebbs (void)
{
basic_block bb;
int probability_cutoff;
if (n_basic_blocks == NUM_FIXED_BLOCKS)
return;
- sched_init (dump_file);
+ sched_init ();
current_sched_info = &ebb_sched_info;
extern int set_priorities (rtx, rtx);
extern void schedule_block (int, int);
-extern void sched_init (FILE *);
+extern void sched_init (void);
extern void sched_finish (void);
extern void ready_add (struct ready_list *, rtx);
count_or_remove_death_notes (NULL, 1);
}
-/* The one entry point in this file. DUMP_FILE is the dump file for
- this pass. */
+/* The one entry point in this file. */
void
-schedule_insns (FILE *dump_file)
+schedule_insns (void)
{
sbitmap large_region_blocks, blocks;
int rgn;
nr_inter = 0;
nr_spec = 0;
- sched_init (dump_file);
+ sched_init ();
init_regions ();
/* Do control and data sched analysis,
and write some of the results to dump file. */
- schedule_insns (dump_file);
+ schedule_insns ();
#endif
}
if (flag_sched2_use_superblocks || flag_sched2_use_traces)
{
- schedule_ebbs (dump_file);
+ schedule_ebbs ();
/* No liveness updating code yet, but it should be easy to do.
reg-stack recomputes the liveness when needed for now. */
count_or_remove_death_notes (NULL, 1);
cleanup_cfg (CLEANUP_EXPENSIVE);
}
else
- schedule_insns (dump_file);
+ schedule_insns ();
#endif
}
/* Write the flowgraph to a VCG file. */
{
int local_dump_flags;
- FILE *dump_file = dump_begin (TDI_vcg, &local_dump_flags);
- if (dump_file)
+ FILE *vcg_file = dump_begin (TDI_vcg, &local_dump_flags);
+ if (vcg_file)
{
- tree_cfg2vcg (dump_file);
- dump_end (TDI_vcg, dump_file);
+ tree_cfg2vcg (vcg_file);
+ dump_end (TDI_vcg, vcg_file);
}
}
/* Look at all the incoming edges to block BB, and decide where the best place
- to insert the stmts on each edge are, and perform those insertions. Output
- any debug information to DEBUG_FILE. */
+ to insert the stmts on each edge are, and perform those insertions. */
static void
-analyze_edges_for_bb (basic_block bb, FILE *debug_file)
+analyze_edges_for_bb (basic_block bb)
{
edge e;
edge_iterator ei;
}
- if (debug_file)
- fprintf (debug_file, "\nOpportunities in BB %d for stmt/block reduction:\n",
+ if (dump_file)
+ fprintf (dump_file, "\nOpportunities in BB %d for stmt/block reduction:\n",
bb->index);
new_edge = make_forwarder_block (leader->dest, same_stmt_list_p,
NULL);
bb = new_edge->dest;
- if (debug_file)
+ if (dump_file)
{
- fprintf (debug_file, "Splitting BB %d for Common stmt list. ",
+ fprintf (dump_file, "Splitting BB %d for Common stmt list. ",
leader->dest->index);
- fprintf (debug_file, "Original block is now BB%d.\n", bb->index);
- print_generic_stmt (debug_file, curr_stmt_list, TDF_VOPS);
+ fprintf (dump_file, "Original block is now BB%d.\n", bb->index);
+ print_generic_stmt (dump_file, curr_stmt_list, TDF_VOPS);
}
FOR_EACH_EDGE (e, ei, new_edge->src->preds)
{
e->aux = NULL;
- if (debug_file)
- fprintf (debug_file, " Edge (%d->%d) lands here.\n",
+ if (dump_file)
+ fprintf (dump_file, " Edge (%d->%d) lands here.\n",
e->src->index, e->dest->index);
}
/* This function will analyze the insertions which were performed on edges,
and decide whether they should be left on that edge, or whether it is more
efficient to emit some subset of them in a single block. All stmts are
- inserted somewhere, and if non-NULL, debug information is printed via
- DUMP_FILE. */
+ inserted somewhere. */
static void
-perform_edge_inserts (FILE *dump_file)
+perform_edge_inserts (void)
{
basic_block bb;
init_analyze_edges_for_bb ();
FOR_EACH_BB (bb)
- analyze_edges_for_bb (bb, dump_file);
+ analyze_edges_for_bb (bb);
- analyze_edges_for_bb (EXIT_BLOCK_PTR, dump_file);
+ analyze_edges_for_bb (EXIT_BLOCK_PTR);
/* Free data structures used in analyze_edges_for_bb. */
fini_analyze_edges_for_bb ();
}
-/* Remove the variables specified in MAP from SSA form. Any debug information
- is sent to DUMP. FLAGS indicate what options should be used. */
+/* Remove the variables specified in MAP from SSA form. FLAGS indicate what
+ options should be used. */
static void
-remove_ssa_form (FILE *dump, var_map map, int flags)
+remove_ssa_form (var_map map, int flags)
{
tree_live_info_p liveinfo;
basic_block bb;
tree phi, next;
- FILE *save;
tree *values = NULL;
- save = dump_file;
- dump_file = dump;
-
/* If we are not combining temps, don't calculate live ranges for variables
with only one SSA version. */
if ((flags & SSANORM_COMBINE_TEMPS) == 0)
fini_ssa_operands ();
/* If any copies were inserted on edges, analyze and insert them now. */
- perform_edge_inserts (dump_file);
-
- dump_file = save;
+ perform_edge_inserts ();
}
/* Search every PHI node for arguments associated with backedges which
if (flag_tree_ter && !flag_mudflap)
ssa_flags |= SSANORM_PERFORM_TER;
- remove_ssa_form (dump_file, map, ssa_flags);
+ remove_ssa_form (map, ssa_flags);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_tree_cfg (dump_file, dump_flags & ~TDF_DETAILS);
return false;
}
-/* Return the file on which profile dump output goes, if any. */
-
-static FILE *tree_profile_dump_file (void) {
- return dump_file;
-}
-
static void
tree_profiling (void)
{
tree_gen_interval_profiler, /* gen_interval_profiler */
tree_gen_pow2_profiler, /* gen_pow2_profiler */
tree_gen_one_value_profiler, /* gen_one_value_profiler */
- tree_gen_const_delta_profiler,/* gen_const_delta_profiler */
- tree_profile_dump_file /* profile_dump_file */
+ tree_gen_const_delta_profiler /* gen_const_delta_profiler */
};
#include "gt-tree-profile.h"
}
-/* Dump the copy-of value for variable VAR to DUMP_FILE. */
+/* Dump the copy-of value for variable VAR to FILE. */
static void
-dump_copy_of (FILE *dump_file, tree var)
+dump_copy_of (FILE *file, tree var)
{
tree val;
sbitmap visited;
- print_generic_expr (dump_file, var, dump_flags);
+ print_generic_expr (file, var, dump_flags);
if (TREE_CODE (var) != SSA_NAME)
return;
sbitmap_zero (visited);
SET_BIT (visited, SSA_NAME_VERSION (var));
- fprintf (dump_file, " copy-of chain: ");
+ fprintf (file, " copy-of chain: ");
val = var;
- print_generic_expr (dump_file, val, 0);
- fprintf (dump_file, " ");
+ print_generic_expr (file, val, 0);
+ fprintf (file, " ");
while (copy_of[SSA_NAME_VERSION (val)].value)
{
- fprintf (dump_file, "-> ");
+ fprintf (file, "-> ");
val = copy_of[SSA_NAME_VERSION (val)].value;
- print_generic_expr (dump_file, val, 0);
- fprintf (dump_file, " ");
+ print_generic_expr (file, val, 0);
+ fprintf (file, " ");
if (TEST_BIT (visited, SSA_NAME_VERSION (val)))
break;
SET_BIT (visited, SSA_NAME_VERSION (val));
val = get_copy_of_val (var)->value;
if (val == NULL_TREE)
- fprintf (dump_file, "[UNDEFINED]");
+ fprintf (file, "[UNDEFINED]");
else if (val != var)
- fprintf (dump_file, "[COPY]");
+ fprintf (file, "[COPY]");
else
- fprintf (dump_file, "[NOT A COPY]");
+ fprintf (file, "[NOT A COPY]");
sbitmap_free (visited);
}
unsigned n_bbs;
unsigned bbs_size;
- loops = loop_optimizer_init (dump_file, (LOOPS_HAVE_PREHEADERS
- | LOOPS_HAVE_SIMPLE_LATCHES));
+ loops = loop_optimizer_init (LOOPS_HAVE_PREHEADERS
+ | LOOPS_HAVE_SIMPLE_LATCHES);
if (!loops)
return;
free (bbs);
free (copied_bbs);
- loop_optimizer_finalize (loops, NULL);
+ loop_optimizer_finalize (loops);
}
static bool
struct loops *current_loops = NULL;
-/* Initializes the loop structures. DUMP is the file to that the details
- about the analysis should be dumped. */
+/* Initializes the loop structures. */
static struct loops *
-tree_loop_optimizer_init (FILE *dump)
+tree_loop_optimizer_init (void)
{
struct loops *loops;
- loops = loop_optimizer_init (dump, (LOOPS_NORMAL
- | LOOPS_HAVE_MARKED_SINGLE_EXITS));
+ loops = loop_optimizer_init (LOOPS_NORMAL
+ | LOOPS_HAVE_MARKED_SINGLE_EXITS);
if (!loops)
return NULL;
static void
tree_ssa_loop_init (void)
{
- current_loops = tree_loop_optimizer_init (dump_file);
+ current_loops = tree_loop_optimizer_init ();
if (!current_loops)
return;
free_numbers_of_iterations_estimates (current_loops);
scev_finalize ();
- loop_optimizer_finalize (current_loops,
- (dump_flags & TDF_DETAILS ? dump_file : NULL));
+ loop_optimizer_finalize (current_loops);
current_loops = NULL;
}
vn_init ();
if (!do_fre)
- current_loops = loop_optimizer_init (dump_file, LOOPS_NORMAL);
+ current_loops = loop_optimizer_init (LOOPS_NORMAL);
connect_infinite_loops_to_exit ();
memset (&pre_stats, 0, sizeof (pre_stats));
}
if (!do_fre && current_loops)
{
- loop_optimizer_finalize (current_loops, dump_file);
+ loop_optimizer_finalize (current_loops);
current_loops = NULL;
}
}
static void
execute_sink_code (void)
{
- struct loops *loops = loop_optimizer_init (dump_file, LOOPS_NORMAL);
+ struct loops *loops = loop_optimizer_init (LOOPS_NORMAL);
+
connect_infinite_loops_to_exit ();
memset (&sink_stats, 0, sizeof (sink_stats));
calculate_dominance_info (CDI_DOMINATORS | CDI_POST_DOMINATORS);
fprintf (dump_file, "Sunk statements:%d\n", sink_stats.sunk);
free_dominance_info (CDI_POST_DOMINATORS);
remove_fake_exit_edges ();
- loop_optimizer_finalize (loops, dump_file);
+ loop_optimizer_finalize (loops);
}
/* Gate and execute functions for PRE. */
{
insert_range_assertions ();
- current_loops = loop_optimizer_init (NULL, LOOPS_NORMAL);
+ current_loops = loop_optimizer_init (LOOPS_NORMAL);
if (current_loops)
scev_initialize (current_loops);
if (current_loops)
{
scev_finalize ();
- loop_optimizer_finalize (current_loops, NULL);
+ loop_optimizer_finalize (current_loops);
current_loops = NULL;
}
/* Insert code to find the most common value of a difference between two
evaluations of an expression. */
void (*gen_const_delta_profiler) (histogram_value, unsigned, unsigned);
- FILE * (*profile_dump_file) (void);
};
/* In profile.c. */