aboutsummaryrefslogtreecommitdiff
path: root/gcc/modulo-sched.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-02-06 19:20:47 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-02-06 18:20:47 +0000
commit10d22567504587ae20ff4dbe8188f7ead6776cdd (patch)
treeacb6601c5a9ddbbe44f73689c705a8c06f41dc41 /gcc/modulo-sched.c
parent7269aee7d553dc3b89aadc00950024fde12631b4 (diff)
downloadgcc-10d22567504587ae20ff4dbe8188f7ead6776cdd.zip
gcc-10d22567504587ae20ff4dbe8188f7ead6776cdd.tar.gz
gcc-10d22567504587ae20ff4dbe8188f7ead6776cdd.tar.bz2
tree-vrp.c (execute_vrp): Do not pass dump argument to.
* 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
Diffstat (limited to 'gcc/modulo-sched.c')
-rw-r--r--gcc/modulo-sched.c132
1 files changed, 63 insertions, 69 deletions
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 52190e0..86bf1a3 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -181,13 +181,9 @@ static bool ps_unschedule_node (partial_schedule_ptr, ddg_node_ptr );
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,
@@ -374,11 +370,11 @@ set_node_sched_params (ddg_ptr g)
}
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++)
{
@@ -386,14 +382,14 @@ print_node_sched_params (FILE * dump_file, int num_nodes)
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);
}
}
@@ -824,7 +820,7 @@ loop_single_full_bb_p (struct loop *loop)
/* 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)
@@ -841,7 +837,7 @@ loop_canon_p (struct loop *loop, FILE *dump_file)
{
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);
}
}
@@ -859,7 +855,7 @@ loop_canon_p (struct loop *loop, FILE *dump_file)
{
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);
}
}
@@ -897,7 +893,7 @@ canon_loop (struct loop *loop)
/* 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;
@@ -915,13 +911,11 @@ sms_schedule (FILE *dump_file)
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)
{
@@ -936,7 +930,7 @@ sms_schedule (FILE *dump_file)
/* 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);
@@ -967,7 +961,7 @@ sms_schedule (FILE *dump_file)
break;
}
- if (! loop_canon_p (loop, dump_file))
+ if (! loop_canon_p (loop))
continue;
if (! loop_single_full_bb_p (loop))
@@ -986,7 +980,7 @@ sms_schedule (FILE *dump_file)
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);
@@ -994,24 +988,24 @@ sms_schedule (FILE *dump_file)
{
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;
@@ -1031,15 +1025,15 @@ sms_schedule (FILE *dump_file)
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;
@@ -1047,8 +1041,8 @@ sms_schedule (FILE *dump_file)
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;
}
@@ -1084,7 +1078,7 @@ sms_schedule (FILE *dump_file)
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);
@@ -1092,25 +1086,25 @@ sms_schedule (FILE *dump_file)
{
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);
}
@@ -1127,12 +1121,12 @@ sms_schedule (FILE *dump_file)
}
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);
@@ -1142,15 +1136,15 @@ sms_schedule (FILE *dump_file)
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);
@@ -1178,13 +1172,13 @@ sms_schedule (FILE *dump_file)
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);
}
@@ -1267,7 +1261,7 @@ sms_schedule (FILE *dump_file)
/* 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
@@ -1481,7 +1475,7 @@ get_sched_window (partial_schedule_ptr ps, int *nodes_order, int i,
/* 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;
@@ -2510,7 +2504,7 @@ rest_of_handle_sms (void)
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 ();