public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* New size optimization
@ 1998-03-30 16:18 Joern Rennecke
  1998-04-02 11:32 ` Jim Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Joern Rennecke @ 1998-03-30 16:18 UTC (permalink / raw)
  To: wilson; +Cc: egcs

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.  */

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

end of thread, other threads:[~1998-05-14  5:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-30 16:18 New size optimization Joern Rennecke
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

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).