public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
@ 2004-09-11 17:37 Toon Moene
  2004-09-11 19:02 ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Toon Moene @ 2004-09-11 17:37 UTC (permalink / raw)
  To: gcc; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

L.S.,

The flags mentioned in the subject were introduced seven years ago to 
help the heuristics in loop.c in case of code commonly encountered in 
Fortran.

Because loop.c is on its way out and current loop optimizations have a 
different structure, there's little reason to keep these flags.

On the contrary, now that we have decided that 4.0.0 is a nice round 
version number, perhaps we can get away with such a change.

The proposed patch is attached.

Please, reflect.

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

[-- Attachment #2: remflags.patch --]
[-- Type: text/plain, Size: 5818 bytes --]

2004-09-11  Toon Moene  <toon@moene.indiv.nluug.nl>

	* common.opt: Remove flags -fmove-all-movables and
	-freduce-all-givs.
	* loop-invariant.c (find_invariants_to_move):
	Remove all uses of flag_move_all_movables.
	* loop.c (move_movables): Remove all uses of
	flag_move_all_movables.
	(strength_reduce): Remove all uses of
	flag_reduce_all_givs.
	* doc/invoke.texi: Remove documentation of flags
	-fremove-all-movables and -freduce-all-givs.

*** common.opt.orig	Fri Sep 10 22:29:33 2004
--- common.opt	Sat Sep 11 18:59:54 2004
*************** fmodulo-sched
*** 523,532 ****
  Common Report Var(flag_modulo_sched)
  Perform SMS based modulo scheduling before the first scheduling pass
  
- fmove-all-movables
- Common Report Var(flag_move_all_movables)
- Force all loop invariant computations out of loops
- 
  fmove-loop-invariants
  Common Report Var(flag_move_loop_invariants)
  Move loop invariant computations out of loops
--- 523,528 ----
*************** frandom-seed=
*** 646,655 ****
  Common Joined RejectNegative
  -frandom-seed=<string>	Make compile reproducible using <string>
  
- freduce-all-givs
- Common Report Var(flag_reduce_all_givs)
- Strength reduce all loop general induction variables
- 
  freg-struct-return
  Common Report Var(flag_pcc_struct_return,0) VarExists
  Return small aggregates in registers
--- 642,647 ----
*** loop-invariant.c.orig	Fri Sep 10 22:29:35 2004
--- loop-invariant.c	Sat Sep 11 19:00:31 2004
*************** find_invariants_to_move (struct df *df)
*** 715,731 ****
    unsigned i, regs_used, n_inv_uses, regs_needed = 0, new_regs;
    struct invariant *inv = NULL;
  
-   if (flag_move_all_movables)
-     {
-       /* This is easy & stupid.  */
-       for (i = 0; i < VARRAY_ACTIVE_SIZE (invariants); i++)
- 	{
- 	  inv = VARRAY_GENERIC_PTR_NOGC (invariants, i);
- 	  inv->move = true;
- 	}
-       return;
-     }
- 
    if (!VARRAY_ACTIVE_SIZE (invariants))
      return;
  
--- 715,720 ----
*** loop.c.orig	Fri Sep 10 22:29:35 2004
--- loop.c	Sat Sep 11 19:02:23 2004
*************** move_movables (struct loop *loop, struct
*** 1885,1891 ****
  	     extra cost because something else was already moved.  */
  
  	  if (already_moved[regno]
- 	      || flag_move_all_movables
  	      || (threshold * savings * m->lifetime) >=
  		 (regs->array[regno].moved_once ? insn_count * 2 : insn_count)
  	      || (m->forces && m->forces->done
--- 1885,1890 ----
*************** strength_reduce (struct loop *loop, int 
*** 5122,5129 ****
  	     of such giv's whether or not we know they are used after the loop
  	     exit.  */
  
! 	  if (! flag_reduce_all_givs
! 	      && v->lifetime * threshold * benefit < insn_count
  	      && ! bl->reversed)
  	    {
  	      if (loop_dump_stream)
--- 5121,5127 ----
  	     of such giv's whether or not we know they are used after the loop
  	     exit.  */
  
! 	  if (v->lifetime * threshold * benefit < insn_count
  	      && ! bl->reversed)
  	    {
  	      if (loop_dump_stream)
*** doc/invoke.texi.orig	Sat Sep 11 12:06:53 2004
--- doc/invoke.texi	Sat Sep 11 19:04:13 2004
*************** Objective-C and Objective-C++ Dialects}.
*** 294,300 ****
  -floop-optimize -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
  -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
  -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
! -fmodulo-sched -fmove-all-movables  -fnew-ra  -fno-branch-count-reg @gol
  -fno-default-inline  -fno-defer-pop -floop-optimize2 -fmove-loop-invariants @gol
  -fno-function-cse  -fno-guess-branch-probability @gol
  -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
--- 294,300 ----
  -floop-optimize -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
  -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
  -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
! -fmodulo-sched -fnew-ra  -fno-branch-count-reg @gol
  -fno-default-inline  -fno-defer-pop -floop-optimize2 -fmove-loop-invariants @gol
  -fno-function-cse  -fno-guess-branch-probability @gol
  -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
*************** Objective-C and Objective-C++ Dialects}.
*** 303,309 ****
  -fomit-frame-pointer  -foptimize-register-move @gol
  -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
  -fprofile-generate -fprofile-use @gol
! -freduce-all-givs  -fregmove  -frename-registers @gol
  -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
  -frerun-cse-after-loop  -frerun-loop-opt @gol
  -frounding-math -fschedule-insns  -fschedule-insns2 @gol
--- 303,309 ----
  -fomit-frame-pointer  -foptimize-register-move @gol
  -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
  -fprofile-generate -fprofile-use @gol
! -fregmove  -frename-registers @gol
  -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
  -frerun-cse-after-loop  -frerun-loop-opt @gol
  -frounding-math -fschedule-insns  -fschedule-insns2 @gol
*************** the loop is entered.  This usually makes
*** 4702,4721 ****
  If supported by the target machine, generate instructions to prefetch
  memory to improve the performance of loops that access large arrays.
  
- @item -fmove-all-movables
- @opindex fmove-all-movables
- Forces all invariant computations in loops to be moved
- outside the loop.
- 
- @item -freduce-all-givs
- @opindex freduce-all-givs
- Forces all general-induction variables in loops to be
- strength-reduced.
- 
- @emph{Note:} When compiling programs written in Fortran,
- @option{-fmove-all-movables} and @option{-freduce-all-givs} are enabled
- by default when you use the optimizer.
- 
  These options may generate better or worse code; results are highly
  dependent on the structure of loops within the source code.
  
--- 4702,4707 ----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-11 17:37 RFC: Remove flags -fmove-all-movables and -freduce-all-givs Toon Moene
@ 2004-09-11 19:02 ` Richard Henderson
  2004-09-12 11:39   ` Toon Moene
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2004-09-11 19:02 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc, gcc-patches

On Sat, Sep 11, 2004 at 07:14:14PM +0200, Toon Moene wrote:
> 	* common.opt: Remove flags -fmove-all-movables and
> 	-freduce-all-givs.
> 	* loop-invariant.c (find_invariants_to_move):
> 	Remove all uses of flag_move_all_movables.
> 	* loop.c (move_movables): Remove all uses of
> 	flag_move_all_movables.
> 	(strength_reduce): Remove all uses of
> 	flag_reduce_all_givs.
> 	* doc/invoke.texi: Remove documentation of flags
> 	-fremove-all-movables and -freduce-all-givs.

Ok.


r~

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-11 19:02 ` Richard Henderson
@ 2004-09-12 11:39   ` Toon Moene
  2004-09-13 13:51     ` Giovanni Bajo
  0 siblings, 1 reply; 7+ messages in thread
From: Toon Moene @ 2004-09-12 11:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc, gcc-patches

Richard Henderson wrote:

> On Sat, Sep 11, 2004 at 07:14:14PM +0200, Toon Moene wrote:
> 
>>	* common.opt: Remove flags -fmove-all-movables and
>>	-freduce-all-givs.
>>	* loop-invariant.c (find_invariants_to_move):
>>	Remove all uses of flag_move_all_movables.
>>	* loop.c (move_movables): Remove all uses of
>>	flag_move_all_movables.
>>	(strength_reduce): Remove all uses of
>>	flag_reduce_all_givs.
>>	* doc/invoke.texi: Remove documentation of flags
>>	-fremove-all-movables and -freduce-all-givs.
> 
> 
> Ok.

Done after bootstrap and make -k check on powerpc-unknown-linux-gnu.

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-12 11:39   ` Toon Moene
@ 2004-09-13 13:51     ` Giovanni Bajo
  2004-09-13 14:18       ` Joseph S. Myers
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Bajo @ 2004-09-13 13:51 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc-patches, gcc, Gerald Pfeifer

Toon Moene wrote:

>>> * common.opt: Remove flags -fmove-all-movables and
>>> -freduce-all-givs.
>>> * loop-invariant.c (find_invariants_to_move):
>>> Remove all uses of flag_move_all_movables.
>>> * loop.c (move_movables): Remove all uses of
>>> flag_move_all_movables.
>>> (strength_reduce): Remove all uses of
>>> flag_reduce_all_givs.
>>> * doc/invoke.texi: Remove documentation of flags
>>> -fremove-all-movables and -freduce-all-givs.

Can you please update http://gcc.gnu.org/gcc-4.0/changes.html with also a
little rationale about why those options were removed? I thought we owe an
explanation to everybody that was using those flags and upgrade -- whether
their use was really succesfull on code generation or they only believed it
was.

Giovanni Bajo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-13 13:51     ` Giovanni Bajo
@ 2004-09-13 14:18       ` Joseph S. Myers
  2004-09-13 23:51         ` Toon Moene
  2004-09-17 16:30         ` Toon Moene
  0 siblings, 2 replies; 7+ messages in thread
From: Joseph S. Myers @ 2004-09-13 14:18 UTC (permalink / raw)
  To: Giovanni Bajo; +Cc: Toon Moene, gcc-patches, gcc, Gerald Pfeifer

On Mon, 13 Sep 2004, Giovanni Bajo wrote:

> Can you please update http://gcc.gnu.org/gcc-4.0/changes.html with also a
> little rationale about why those options were removed? I thought we owe an
> explanation to everybody that was using those flags and upgrade -- whether
> their use was really succesfull on code generation or they only believed it
> was.

Also, the manual still contains the two paragraphs that followed the 
description of those options:

  These two options are intended to be removed someday, once
  they have helped determine the efficacy of various
  approaches to improving loop optimizations.

  Please contact @w{@email{gcc@@gcc.gnu.org}}, and describe how use of
  these options affects the performance of your production code.
  Examples of code that runs @emph{slower} when these options are
  @emph{enabled} are very valuable.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
  http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-13 14:18       ` Joseph S. Myers
@ 2004-09-13 23:51         ` Toon Moene
  2004-09-17 16:30         ` Toon Moene
  1 sibling, 0 replies; 7+ messages in thread
From: Toon Moene @ 2004-09-13 23:51 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Giovanni Bajo, gcc-patches, gcc, Gerald Pfeifer

Joseph S. Myers wrote:

> On Mon, 13 Sep 2004, Giovanni Bajo wrote:
> 
>>Can you please update http://gcc.gnu.org/gcc-4.0/changes.html with also a
>>little rationale about why those options were removed? I thought we owe an
>>explanation to everybody that was using those flags and upgrade -- whether
>>their use was really succesfull on code generation or they only believed it
>>was.

Thanks for bringing this to my attention - it will be taken care of in 
the next time slot (i.e., the coming weekend :-).

> Also, the manual still contains the two paragraphs that followed the 
> description of those options:

Ugh - I will not even attempt to dig up an explanation for this 
oversight; I'm sorry.  Thanks, Joseph.

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: Remove flags -fmove-all-movables and -freduce-all-givs.
  2004-09-13 14:18       ` Joseph S. Myers
  2004-09-13 23:51         ` Toon Moene
@ 2004-09-17 16:30         ` Toon Moene
  1 sibling, 0 replies; 7+ messages in thread
From: Toon Moene @ 2004-09-17 16:30 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Giovanni Bajo, gcc-patches, gcc, Gerald Pfeifer

Joseph S. Myers wrote:

> Also, the manual still contains the two paragraphs that followed the 
> description of those options:
> 
>   These two options are intended to be removed someday, once
>   they have helped determine the efficacy of various
>   approaches to improving loop optimizations.
> 
>   Please contact @w{@email{gcc@@gcc.gnu.org}}, and describe how use of
>   these options affects the performance of your production code.
>   Examples of code that runs @emph{slower} when these options are
>   @emph{enabled} are very valuable.

Removed with the following patch, which was tested with make dvi:

2004-09-17  Toon Moene  <toon@moene.indiv.nluug.nl>

         * doc/invoke.texi: Remove stray explanation on
         -freduce-all-givs and -fmove-all-movables.

diff -u -r1.538 -r1.539
--- gcc/gcc/doc/invoke.texi	2004/09/17 08:22:43	1.538
+++ gcc/gcc/doc/invoke.texi	2004/09/17 15:51:58	1.539
@@ -4718,15 +4718,6 @@
  These options may generate better or worse code; results are highly
  dependent on the structure of loops within the source code.

-These two options are intended to be removed someday, once
-they have helped determine the efficacy of various
-approaches to improving loop optimizations.
-
-Please contact @w{@email{gcc@@gcc.gnu.org}}, and describe how use of
-these options affects the performance of your production code.
-Examples of code that runs @emph{slower} when these options are
-@emph{enabled} are very valuable.
-
  @item -fno-peephole
  @itemx -fno-peephole2
  @opindex fno-peephole

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-09-17 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-11 17:37 RFC: Remove flags -fmove-all-movables and -freduce-all-givs Toon Moene
2004-09-11 19:02 ` Richard Henderson
2004-09-12 11:39   ` Toon Moene
2004-09-13 13:51     ` Giovanni Bajo
2004-09-13 14:18       ` Joseph S. Myers
2004-09-13 23:51         ` Toon Moene
2004-09-17 16:30         ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).