This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Goodbye old scheduler



It's finally time to say farewell to the old scheduler.  It has served us
well over the years, but the costs to maintain it far outweigh any benefits
we derive from keeping it around.

For those of you who remember, getting the most benefit out of the haifa
scheduler may require re-tuning the scheduling parameters -- particularly
those ports which scaled the issue/ready delay values to "fake" superscalar
scheduling with the old scheduler.

Luckily, the key superscalar ports were converted long ago and those few ports
which were not converted (like the sh) should not see any significant
improvement or degradation.  Hopefully someone will submit code which retunes
the SH port to accurately describe its pipelines.

Single-issue machines should show some improvement with the conversion to
the haifa-scheduler (due to loop/region scheduling and better scheduling
heuristics).
	* configure.in: Remove code to select/de-select the haifa
	scheduler.  Every scheduled port gets haifa now.
	* configure: Rebuilt.
	* flags.h, genattrtab.c, rtl.h, toplev.c: Remove HAIFA ifdefs.
	* sched.c Deleted.
	* Makefile.in: Corresponding changes.
	
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.275
diff -c -3 -p -r1.275 configure.in
*** configure.in	1999/08/14 22:04:44	1.275
--- configure.in	1999/08/24 03:13:04
*************** if test x$enable_fast_fixincludes = xno 
*** 232,243 ****
    cp $srcdir/fixincludes ./fixinc.sh
  fi)
  
- # Enable Haifa scheduler.
- AC_ARG_ENABLE(haifa,
- [  --enable-haifa          use the experimental scheduler.
-   --disable-haifa         don't use the experimental scheduler for the
-                           targets which normally enable it.])
- 
  # Enable threads
  # Pass with no value to take the default
  # Pass with a value to specify a thread package
--- 232,237 ----
*************** then float_h_file=Makefile.in
*** 3682,3695 ****
  else float_h_file=float-$float_format.h
  fi
  
- if test x$enable_haifa = x
- then
-   case $target in
-     alpha*-* | hppa*-* | powerpc*-* | rs6000-* | *sparc*-* | m32r*-*)
-       enable_haifa=yes;;
-   esac
- fi
- 
  # Handle cpp installation.
  if test x$enable_cpp != xno
  then
--- 3676,3681 ----
*************** if test x$with_newlib = xyes; then
*** 4503,4528 ****
  	inhibit_libc=-Dinhibit_libc
  fi
  AC_SUBST(inhibit_libc)
- 
- # Override SCHED_OBJ and SCHED_CFLAGS to enable the Haifa scheduler.
- sched_prefix=
- sched_cflags=
- if test x$enable_haifa = xyes; then
-     echo "Using the Haifa scheduler."
-     sched_prefix=haifa-
-     sched_cflags=-DHAIFA
- fi
- AC_SUBST(sched_prefix)
- AC_SUBST(sched_cflags)
- if test x$enable_haifa != x; then
-     # Explicitly remove files that need to be recompiled for the Haifa scheduler.
-     for x in genattrtab.o toplev.o *sched.o; do
- 	if test -f $x; then
- 	    echo "Removing $x"
- 	    rm -f $x
- 	fi
-     done
- fi
  
  # If $(exec_prefix) exists and is not the same as $(prefix), then compute an
  # absolute path for gcc_tooldir based on inserting the number of up-directory
--- 4489,4494 ----
Index: flags.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/flags.h,v
retrieving revision 1.30
diff -c -3 -p -r1.30 flags.h
*** flags.h	1999/08/18 10:43:24	1.30
--- flags.h	1999/08/24 03:13:05
*************** extern int flag_shared_data;
*** 349,355 ****
  extern int flag_schedule_insns;
  extern int flag_schedule_insns_after_reload;
  
- #ifdef HAIFA
  /* The following flags have effect only for scheduling before register
     allocation:
  
--- 349,354 ----
*************** extern int flag_schedule_interblock;
*** 364,370 ****
  extern int flag_schedule_speculative;
  extern int flag_schedule_speculative_load;
  extern int flag_schedule_speculative_load_dangerous;
- #endif  /* HAIFA */
  
  /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
     by a cheaper branch, on a count register. */
--- 363,368 ----
Index: genattrtab.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genattrtab.c,v
retrieving revision 1.49
diff -c -3 -p -r1.49 genattrtab.c
*** genattrtab.c	1999/08/20 23:05:08	1.49
--- genattrtab.c	1999/08/24 03:13:12
*************** expand_units ()
*** 2082,2106 ****
  
  	  for (op = unit->ops; op; op = op->next)
  	    {
- #ifdef HAIFA
  	      rtx blockage = op->issue_exp;
- #else
- 	      rtx blockage = operate_exp (POS_MINUS_OP, readycost,
- 					  make_numeric_value (1));
- 
- 	      if (unit->simultaneity != 0)
- 		{
- 		  rtx filltime = make_numeric_value ((unit->simultaneity - 1)
- 						     * unit->issue_delay.min);
- 		  blockage = operate_exp (MIN_OP, blockage, filltime);
- 		}
- 
- 	      blockage = operate_exp (POS_MINUS_OP,
- 				      make_numeric_value (op->ready),
- 				      blockage);
- 
- 	      blockage = operate_exp (MAX_OP, blockage, op->issue_exp);
- #endif
  	      blockage = simplify_knowing (blockage, unit->condexp);
  
  	      /* Add this op's contribution to MAX (BLOCKAGE (E,*)) and
--- 2082,2088 ----
Index: rtl.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.h,v
retrieving revision 1.117
diff -c -3 -p -r1.117 rtl.h
*** rtl.h	1999/08/20 23:11:18	1.117
--- rtl.h	1999/08/24 03:13:15
*************** extern void dump_combine_total_stats	PRO
*** 1346,1354 ****
  #ifdef BUFSIZ
  extern void schedule_insns		PROTO ((FILE *));
  #endif
- #ifdef HAIFA
  extern void fix_sched_param		PROTO ((const char *, const char *));
! #endif
  
  /* In print-rtl.c */
  extern void debug_rtx			PROTO ((rtx));
--- 1346,1353 ----
  #ifdef BUFSIZ
  extern void schedule_insns		PROTO ((FILE *));
  #endif
  extern void fix_sched_param		PROTO ((const char *, const char *));
! extern void fix_sched_param		PROTO ((char *, char *));
  
  /* In print-rtl.c */
  extern void debug_rtx			PROTO ((rtx));
Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.193
diff -c -3 -p -r1.193 toplev.c
*** toplev.c	1999/08/18 10:43:26	1.193
--- toplev.c	1999/08/24 03:13:23
*************** int flag_pedantic_errors = 0;
*** 674,680 ****
  int flag_schedule_insns = 0;
  int flag_schedule_insns_after_reload = 0;
  
- #ifdef HAIFA
  /* The following flags have effect only for scheduling before register
     allocation:
  
--- 674,679 ----
*************** int flag_schedule_interblock = 1;
*** 689,695 ****
  int flag_schedule_speculative = 1;
  int flag_schedule_speculative_load = 0;
  int flag_schedule_speculative_load_dangerous = 0;
- #endif  /* HAIFA */
  
  /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
     by a cheaper branch, on a count register. */
--- 688,693 ----
*************** lang_independent_options f_options[] =
*** 905,911 ****
     "Reschedule instructions to avoid pipeline stalls"},
    {"schedule-insns2", &flag_schedule_insns_after_reload, 1,
    "Run two passes of the instruction scheduler"},
- #ifdef HAIFA
    {"sched-interblock",&flag_schedule_interblock, 1,
     "Enable scheduling across basic blocks" },
    {"sched-spec",&flag_schedule_speculative, 1,
--- 903,908 ----
*************** lang_independent_options f_options[] =
*** 914,920 ****
     "Allow speculative motion of some loads" },
    {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
     "Allow speculative motion of more loads" },
- #endif  /* HAIFA */
    {"branch-count-reg",&flag_branch_on_count_reg, 1,
     "Replace add,compare,branch with branch on count reg"},
    {"pic", &flag_pic, 1,
--- 911,916 ----
*************** display_help ()
*** 4570,4576 ****
    printf ("  -version                Display the compiler's version\n");
    printf ("  -d[letters]             Enable dumps from specific passes of the compiler\n");
    printf ("  -dumpbase <file>        Base name to be used for dumps from specific passes\n");
! #if defined HAIFA || defined INSN_SCHEDULING
    printf ("  -sched-verbose-<number> Set the verbosity level of the scheduler\n");
  #endif
    printf ("  --help                  Display this information\n");
--- 4566,4572 ----
    printf ("  -version                Display the compiler's version\n");
    printf ("  -d[letters]             Enable dumps from specific passes of the compiler\n");
    printf ("  -dumpbase <file>        Base name to be used for dumps from specific passes\n");
! #if defined INSN_SCHEDULING
    printf ("  -sched-verbose-<number> Set the verbosity level of the scheduler\n");
  #endif
    printf ("  --help                  Display this information\n");
*************** main (argc, argv)
*** 5097,5108 ****
  	      else if (!strncmp (p, "inline-limit-", 13))
  	        inline_max_insns =
  		  read_integral_parameter (p + 13, p - 2, inline_max_insns);
- #ifdef HAIFA
  #ifdef INSN_SCHEDULING
  	      else if (!strncmp (p, "sched-verbose-",14))
  		fix_sched_param("verbose",&p[14]);
  #endif
- #endif  /* HAIFA */
  	      else if (!strncmp (p, "fixed-", 6))
  		fix_register (&p[6], 1, 1);
  	      else if (!strncmp (p, "call-used-", 10))
--- 5093,5102 ----
  
Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/Makefile.in,v
retrieving revision 1.279
diff -c -3 -p -r1.279 Makefile.in
*** Makefile.in	1999/08/18 16:46:53	1.279
--- Makefile.in	1999/08/24 03:27:01
*************** all: all.indirect
*** 533,539 ****
  all.indirect: $(ALL)
  
  # IN_GCC tells various files that system.h, toplev.c, etc are available.
! INTERNAL_CFLAGS = $(CROSS) -DIN_GCC $(SCHED_CFLAGS) @extra_c_flags@
  
  # This is the variable actually used when we compile.
  # If you change this line, you probably also need to change the definition
--- 533,539 ----
  all.indirect: $(ALL)
  
  # IN_GCC tells various files that system.h, toplev.c, etc are available.
! INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
  
  # This is the variable actually used when we compile.
  # If you change this line, you probably also need to change the definition
*************** C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-d
*** 657,665 ****
  # Language-specific object files for C.
  C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
  
- SCHED_PREFIX = @sched_prefix@
- SCHED_CFLAGS = @sched_cflags@
- 
  # Language-independent object files.
  OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
   function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
--- 657,662 ----
*************** OBJS = toplev.o version.o tree.o print-t
*** 667,673 ****
   dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
   integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
   regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
!  insn-peep.o reorg.o $(SCHED_PREFIX)sched.o final.o recog.o reg-stack.o \
   insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
   profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o \
   mbchar.o dyn-string.o splay-tree.o graph.o sbitmap.o resource.o hash.o
--- 664,670 ----
   dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
   integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
   regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
!  insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o \
   insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
   profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o \
   mbchar.o dyn-string.o splay-tree.o graph.o sbitmap.o resource.o hash.o
*************** alias.o : alias.c $(CONFIG_H) system.h $
*** 1569,1575 ****
  regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
     $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h function.h \
     $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
! $(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
     insn-attr.h toplev.h recog.h
  final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
--- 1566,1572 ----
  regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
     $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h function.h \
     $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
! haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
     insn-attr.h toplev.h recog.h
  final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]