public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joern Rennecke <amylaar@cygnus.co.uk>
To: wilson@cygnus.com
Cc: egcs@cygnus.com
Subject: New size optimization
Date: Mon, 30 Mar 1998 16:18:00 -0000	[thread overview]
Message-ID: <199803302250.XAA27657@phal.cygnus.co.uk> (raw)

Invariant code motion in general adds extra moves and register pressure.
AFAIK there are no common scenarios where it can be a precursor for
another optimization that leads to a code size saving.  Thus, I think it
should be turned off when optimizing for space.

I found this while trying to improve giv finding on the SH by correcting
RTX costs, and found that some other code increased significantly in size:
it went from 949 bytes to 997.
However, with the patch below, it went down to 893 bytes.

Mon Mar 30 23:43:58 1998  J"orn Rennecke <amylaar@cygnus.co.uk>

	* loop.c (scan_loop): Don't call move_moveables for optimize_size.

Index: loop.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/loop.c,v
retrieving revision 1.125
diff -p -r1.125 loop.c
*** loop.c	1998/03/25 18:34:32	1.125
--- loop.c	1998/03/30 22:44:19
*************** scan_loop (loop_start, end, nregs, unrol
*** 1052,1059 ****
    /* Now consider each movable insn to decide whether it is worth moving.
       Store 0 in n_times_set for each reg that is moved.  */
  
!   move_movables (movables, threshold,
! 		 insn_count, loop_start, end, nregs);
  
    /* Now candidates that still are negative are those not moved.
       Change n_times_set to indicate that those are not actually invariant.  */
--- 1052,1060 ----
    /* Now consider each movable insn to decide whether it is worth moving.
       Store 0 in n_times_set for each reg that is moved.  */
  
!   if (! optimize_size)
!     move_movables (movables, threshold,
! 		   insn_count, loop_start, end, nregs);
  
    /* Now candidates that still are negative are those not moved.
       Change n_times_set to indicate that those are not actually invariant.  */

WARNING: multiple messages have this Message-ID
From: Joern Rennecke <amylaar@cygnus.co.uk>
To: wilson@cygnus.com
Cc: egcs@cygnus.com
Subject: New size optimization
Date: Fri, 24 Apr 1998 11:56:00 -0000	[thread overview]
Message-ID: <199803302250.XAA27657@phal.cygnus.co.uk> (raw)
Message-ID: <19980424115600.Vi1IfSH080qGhzDUyFH5pjSRPsjIBTm_2Trhwus6tQs@z> (raw)

Invariant code motion in general adds extra moves and register pressure.
AFAIK there are no common scenarios where it can be a precursor for
another optimization that leads to a code size saving.  Thus, I think it
should be turned off when optimizing for space.

I found this while trying to improve giv finding on the SH by correcting
RTX costs, and found that some other code increased significantly in size:
it went from 949 bytes to 997.
However, with the patch below, it went down to 893 bytes.

Mon Mar 30 23:43:58 1998  J"orn Rennecke <amylaar@cygnus.co.uk>

	* loop.c (scan_loop): Don't call move_moveables for optimize_size.

Index: loop.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/loop.c,v
retrieving revision 1.125
diff -p -r1.125 loop.c
*** loop.c	1998/03/25 18:34:32	1.125
--- loop.c	1998/03/30 22:44:19
*************** scan_loop (loop_start, end, nregs, unrol
*** 1052,1059 ****
    /* Now consider each movable insn to decide whether it is worth moving.
       Store 0 in n_times_set for each reg that is moved.  */
  
!   move_movables (movables, threshold,
! 		 insn_count, loop_start, end, nregs);
  
    /* Now candidates that still are negative are those not moved.
       Change n_times_set to indicate that those are not actually invariant.  */
--- 1052,1060 ----
    /* Now consider each movable insn to decide whether it is worth moving.
       Store 0 in n_times_set for each reg that is moved.  */
  
!   if (! optimize_size)
!     move_movables (movables, threshold,
! 		   insn_count, loop_start, end, nregs);
  
    /* Now candidates that still are negative are those not moved.
       Change n_times_set to indicate that those are not actually invariant.  */

----- End of forwarded message from Joern Rennecke -----

             reply	other threads:[~1998-03-30 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-30 16:18 Joern Rennecke [this message]
1998-04-02 11:32 ` Jim Wilson
1998-04-02 11:32   ` Joern Rennecke
1998-04-12 20:43   ` Jeffrey A Law
1998-04-12 20:43 ` Jeffrey A Law
1998-04-24 11:56 ` Joern Rennecke
1998-05-14  5:54 ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199803302250.XAA27657@phal.cygnus.co.uk \
    --to=amylaar@cygnus.co.uk \
    --cc=egcs@cygnus.com \
    --cc=wilson@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).