summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorhagog <hagog@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:55:06 +0000
committerhagog <hagog@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:55:06 +0000
commit406a73e72e285d52b83924c5c6a0347260b2579e (patch)
treeba0032753f675cc964af30f84d718202207f1c63 /gcc/passes.c
parentd263732c915b08ccfb5ef155ed27a8671760dc91 (diff)
downloadgcc-406a73e72e285d52b83924c5c6a0347260b2579e.tar.gz
* ddg.h, ddg.c, modulo-sched.c: New files.
* cfglayout.c (duplicate_insn_chain): Remove "static" and push internals to "dupicate_insn". (duplicate_insn): New function. * cfglayout.h (duplicate_insn_chain, duplicate_insn): New declarations. * common.opt (fmodulo-sched): New flag. * df.c (df_bb_regno_last_use_find, df_bb_regno_first_def_find): Remove static and forward declaration. (df_find_def, df_reg_used, df_bb_regno_last_def_find): New functions. * df.h (df_bb_regno_last_use_find, df_bb_regno_first_def_find, df_bb_regno_last_def_find, df_find_def, df_reg_used): New declarations. * flags.h (flag_modulo_sched): New flag. * opts.c (common_handle_option): Handle modulo-sched flag. * params.def (max-sms-loop-number, sms-max-ii-factor, sms-dfa-history, sms-loop-average-count-threshold): New parameters. * params.h (MAX_SMS_LOOP_NUMBER, SMS_MAX_II_FACTOR, SMS_DFA_HISTORY, SMS_LOOP_AVERAGE_COUNT_THRESHOLD): New parameters. * passes.c ("sms", "sms-vcg"): New dumps. (rest_of_handle_sched): Call sms_schedule. * rtl.h (sms_schedule): New declaration. * timevar.def (TV_SMS): New. * toplev.c (flag_modulo_sched): Initialize. (f_options): Handle -fmodulo-sched option. * docs/invoke.texi: Document -fmodulo-sched & -dm options. * docs/passes.texi: Document new SMS pass.f toplev.c doc/invoke.texi doc/passes.texi git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82235 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 841e361149c..dc19ea88326 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -154,6 +154,7 @@ enum dump_file_index
DFI_combine,
DFI_ce2,
DFI_regmove,
+ DFI_sms,
DFI_sched,
DFI_lreg,
DFI_greg,
@@ -178,7 +179,7 @@ enum dump_file_index
Remaining -d letters:
- " e m q "
+ " e q "
" K O Q WXY "
*/
@@ -207,6 +208,7 @@ static struct dump_file_info dump_file_tbl[DFI_MAX] =
{ "combine", 'c', 1, 0, 0 },
{ "ce2", 'C', 1, 0, 0 },
{ "regmove", 'N', 1, 0, 0 },
+ { "sms", 'm', 0, 0, 0 },
{ "sched", 'S', 1, 0, 0 },
{ "lreg", 'l', 1, 0, 0 },
{ "greg", 'g', 1, 0, 0 },
@@ -742,6 +744,29 @@ rest_of_handle_reorder_blocks (tree decl, rtx insns)
static void
rest_of_handle_sched (tree decl, rtx insns)
{
+ timevar_push (TV_SMS);
+ if (optimize > 0 && flag_modulo_sched)
+ {
+
+ /* Perform SMS module scheduling. */
+ open_dump_file (DFI_sms, decl);
+
+ /* We want to be able to create new pseudos. */
+ no_new_pseudos = 0;
+ sms_schedule (dump_file);
+ close_dump_file (DFI_sms, print_rtl, get_insns ());
+
+
+ /* Update the life information, becuase we add pseudos. */
+ max_regno = max_reg_num ();
+ allocate_reg_info (max_regno, FALSE, FALSE);
+ update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
+ (PROP_DEATH_NOTES
+ | PROP_KILL_DEAD_CODE
+ | PROP_SCAN_DEAD_CODE));
+ no_new_pseudos = 1;
+ }
+ timevar_pop (TV_SMS);
timevar_push (TV_SCHED);
/* Print function header into sched dump now