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]

Change -fdce to -fssa-dce




I'm planning to prefix the SSA optimizer path options and such with
"ssa".  So -fdce needs to be changed of -fssa-dce to fit into the
desired naming scheme.

This patch fixes -fdce and the related collateral damage related to
changing the name of a pass :-)

Bootstapped on ia32-linux.

	* ssa-dce.c (ssa_eliminate_dead_code): Renamed from
	eliminate_date_code.
	* ssa.h (ssa_eliminate_dead_code): Corresponding changes.
	* timevar.def (TV_SSA_DCE): Renamed from TV_DEAD_CODE_ELIM.
	* toplev.c (DFI_ssa_dce): Renamed from DFI_dce.
	(dump_file_info): Similar changes.
	(flag_ssa_dce): Similarly
	(f_options): Similar changes.
	(rest_of_compilation): Corresponding changes.
	* doc/invoke.texi: Update as option is now -fssa-dce instead
	of -fdce.  Update dump file name.


Index: ssa-dce.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ssa-dce.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 ssa-dce.c
*** ssa-dce.c	2001/06/29 18:26:21	1.4
--- ssa-dce.c	2001/06/29 19:45:46
*************** delete_insn_bb (insn)
*** 503,509 ****
  /* Perform the dead-code elimination.  */
  
  void
! eliminate_dead_code ()
  {
    int i;
    rtx insn;
--- 503,509 ----
  /* Perform the dead-code elimination.  */
  
  void
! ssa_eliminate_dead_code ()
  {
    int i;
    rtx insn;
Index: ssa.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ssa.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ssa.h
*** ssa.h	2001/06/22 22:20:42	1.3
--- ssa.h	2001/06/29 19:45:46
*************** extern int remove_phi_alternative	PARAMS
*** 33,39 ****
  
  /* Optimizations.  */
  /* In ssa-dce.c */
! extern void eliminate_dead_code		PARAMS ((void));
  
  /* SSA definitions and uses.  */
  /* This flag is set when the CFG is in SSA form.  */
--- 33,39 ----
  
  /* Optimizations.  */
  /* In ssa-dce.c */
! extern void ssa_eliminate_dead_code	PARAMS ((void));
  
  /* SSA definitions and uses.  */
  /* This flag is set when the CFG is in SSA form.  */
Index: timevar.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/timevar.def,v
retrieving revision 1.6
diff -c -3 -p -r1.6 timevar.def
*** timevar.def	2000/09/07 00:37:09	1.6
--- timevar.def	2001/06/29 19:45:49
*************** DEFTIMEVAR (TV_REORDER_BLOCKS        , "
*** 70,76 ****
  DEFTIMEVAR (TV_SHORTEN_BRANCH        , "shorten branches")
  DEFTIMEVAR (TV_REG_STACK             , "reg stack")
  DEFTIMEVAR (TV_TO_SSA                , "convert to SSA")
! DEFTIMEVAR (TV_DEAD_CODE_ELIM        , "eliminate dead code")
  DEFTIMEVAR (TV_FROM_SSA              , "convert from SSA")
  DEFTIMEVAR (TV_FINAL                 , "final")
  DEFTIMEVAR (TV_SYMOUT                , "symout")
--- 70,76 ----
  DEFTIMEVAR (TV_SHORTEN_BRANCH        , "shorten branches")
  DEFTIMEVAR (TV_REG_STACK             , "reg stack")
  DEFTIMEVAR (TV_TO_SSA                , "convert to SSA")
! DEFTIMEVAR (TV_SSA_DCE               , "SSA aggressive DCE")
  DEFTIMEVAR (TV_FROM_SSA              , "convert from SSA")
  DEFTIMEVAR (TV_FINAL                 , "final")
  DEFTIMEVAR (TV_SYMOUT                , "symout")
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.475
diff -c -3 -p -r1.475 toplev.c
*** toplev.c	2001/06/26 19:24:08	1.475
--- toplev.c	2001/06/29 19:46:06
*************** enum dump_file_index
*** 256,262 ****
    DFI_cse,
    DFI_addressof,
    DFI_ssa,
!   DFI_dce,
    DFI_ussa,
    DFI_gcse,
    DFI_loop,
--- 256,262 ----
    DFI_cse,
    DFI_addressof,
    DFI_ssa,
!   DFI_ssa_dce,
    DFI_ussa,
    DFI_gcse,
    DFI_loop,
*************** struct dump_file_info dump_file[DFI_MAX]
*** 302,308 ****
    { "cse",	's', 0, 0, 0 },
    { "addressof", 'F', 0, 0, 0 },
    { "ssa",	'e', 1, 0, 0 },
!   { "dce",	'X', 1, 0, 0 },
    { "ussa",	'e', 1, 0, 0 },	/* Yes, duplicate enable switch.  */
    { "gcse",	'G', 1, 0, 0 },
    { "loop",	'L', 1, 0, 0 },
--- 302,308 ----
    { "cse",	's', 0, 0, 0 },
    { "addressof", 'F', 0, 0, 0 },
    { "ssa",	'e', 1, 0, 0 },
!   { "ssadce",	'X', 1, 0, 0 },
    { "ussa",	'e', 1, 0, 0 },	/* Yes, duplicate enable switch.  */
    { "gcse",	'G', 1, 0, 0 },
    { "loop",	'L', 1, 0, 0 },
*************** int flag_gnu_linker = 1;
*** 819,825 ****
  int flag_ssa = 0;
  
  /* Enable dead code elimination. */
! int flag_dce = 0;
  
  /* Tag all structures with __attribute__(packed).  */
  int flag_pack_struct = 0;
--- 819,825 ----
  int flag_ssa = 0;
  
  /* Enable dead code elimination. */
! int flag_ssa_dce = 0;
  
  /* Tag all structures with __attribute__(packed).  */
  int flag_pack_struct = 0;
*************** lang_independent_options f_options[] =
*** 1142,1149 ****
     N_("Instrument function entry/exit with profiling calls") },
    {"ssa", &flag_ssa, 1,
     N_("Enable SSA optimizations") },
!   {"dce", &flag_dce, 1,
!    N_("Enable dead code elimination") },
    {"leading-underscore", &flag_leading_underscore, 1,
     N_("External symbols have a leading underscore") },
    {"ident", &flag_no_ident, 0,
--- 1142,1149 ----
     N_("Instrument function entry/exit with profiling calls") },
    {"ssa", &flag_ssa, 1,
     N_("Enable SSA optimizations") },
!   {"ssa-dce", &flag_ssa_dce, 1,
!    N_("Enable aggressive SSA dead code elimination") },
    {"leading-underscore", &flag_leading_underscore, 1,
     N_("External symbols have a leading underscore") },
    {"ident", &flag_no_ident, 0,
*************** rest_of_compilation (decl)
*** 3064,3081 ****
  	 blocks, e.g., calling find_basic_blocks () or cleanup_cfg (),
  	 may cause problems.  */
  
!       if (flag_dce)
  	{
  	  /* Remove dead code. */
  
! 	  timevar_push (TV_DEAD_CODE_ELIM);
! 	  open_dump_file (DFI_dce, decl);
  
  	  insns = get_insns ();
! 	  eliminate_dead_code();
  
! 	  close_dump_file (DFI_dce, print_rtl_with_bb, insns);
! 	  timevar_pop (TV_DEAD_CODE_ELIM);
  	}
  
        /* Convert from SSA form.  */
--- 3064,3081 ----
  	 blocks, e.g., calling find_basic_blocks () or cleanup_cfg (),
  	 may cause problems.  */
  
!       if (flag_ssa_dce)
  	{
  	  /* Remove dead code. */
  
! 	  timevar_push (TV_SSA_DCE);
! 	  open_dump_file (DFI_ssa_dce, decl);
  
  	  insns = get_insns ();
! 	  ssa_eliminate_dead_code();
  
! 	  close_dump_file (DFI_ssa_dce, print_rtl_with_bb, insns);
! 	  timevar_pop (TV_SSA_DCE);
  	}
  
        /* Convert from SSA form.  */
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/doc/invoke.texi,v
retrieving revision 1.24
diff -c -3 -p -r1.24 invoke.texi
*** invoke.texi	2001/06/27 15:04:15	1.24
--- invoke.texi	2001/06/29 19:46:47
*************** in the following sections.
*** 254,260 ****
  -falign-functions=@var{n}  -falign-jumps=@var{n} @gol
  -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
  -fbranch-probabilities  -fcaller-saves @gol
! -fcse-follow-jumps  -fcse-skip-blocks  -fdata-sections  -fdce @gol
  -fdelayed-branch  -fdelete-null-pointer-checks @gol
  -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
  -fforce-addr  -fforce-mem  -ffunction-sections @gol
--- 254,260 ----
  -falign-functions=@var{n}  -falign-jumps=@var{n} @gol
  -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
  -fbranch-probabilities  -fcaller-saves @gol
! -fcse-follow-jumps  -fcse-skip-blocks  -fdata-sections @gol
  -fdelayed-branch  -fdelete-null-pointer-checks @gol
  -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
  -fforce-addr  -fforce-mem  -ffunction-sections @gol
*************** in the following sections.
*** 270,276 ****
  -fregmove  -frename-registers @gol
  -frerun-cse-after-loop  -frerun-loop-opt @gol
  -fschedule-insns  -fschedule-insns2 @gol
! -fsingle-precision-constant  -fssa @gol
  -fstrength-reduce  -fstrict-aliasing  -fthread-jumps  -ftrapv @gol
  -funroll-all-loops  -funroll-loops  @gol
  --param @var{name}=@var{value}
--- 270,276 ----
  -fregmove  -frename-registers @gol
  -frerun-cse-after-loop  -frerun-loop-opt @gol
  -fschedule-insns  -fschedule-insns2 @gol
! -fsingle-precision-constant  -fssa -fssa-dce @gol
  -fstrength-reduce  -fstrict-aliasing  -fthread-jumps  -ftrapv @gol
  -funroll-all-loops  -funroll-loops  @gol
  --param @var{name}=@var{value}
*************** sometimes follows CSE), to @file{@var{fi
*** 2946,2952 ****
  Dump after the second flow pass, to @file{@var{file}.21.flow2}.
  @item X
  @opindex dX
! Dump after dead code elimination, to @file{@var{file}.06.dce}.
  @item z
  @opindex dz
  Dump after the peephole pass, to @file{@var{file}.22.peephole2}.
--- 2946,2952 ----
  Dump after the second flow pass, to @file{@var{file}.21.flow2}.
  @item X
  @opindex dX
! Dump after SSA aggressive dead code elimination, to 
@file{@var{file}.06.ssadce}.
  @item z
  @opindex dz
  Dump after the peephole pass, to @file{@var{file}.22.peephole2}.
*************** flow graph is translated into SSA form, 
*** 3732,3741 ****
  the flow graph is translated back from SSA form.  Users should not
  specify this option, since it is not yet ready for production use.
  
! @item -fdce
! @opindex fdce
! Perform dead-code elimination in SSA form.  Requires @option{-fssa}.  Like
! @option{-fssa}, this is an experimental feature.
  
  @item -fsingle-precision-constant
  @opindex fsingle-precision-constant
--- 3732,3741 ----
  the flow graph is translated back from SSA form.  Users should not
  specify this option, since it is not yet ready for production use.
  
! @item -fssa-dce
! @opindex fssa-dce
! Perform aggressive dead-code elimination in SSA form.  Requires 
@option{-fssa}.
! Like @option{-fssa}, this is an experimental feature.
  
  @item -fsingle-precision-constant
  @opindex fsingle-precision-constant




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