public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* INTEGRATE_THRESHOLD patch
@ 1998-02-02 11:43 Marc Lehmann
  1998-02-05 22:09 ` Jeffrey A Law
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Lehmann @ 1998-02-02 11:43 UTC (permalink / raw)
  To: egcs

Here's the revised version, doing it in the architecture independent part.

Now we can argue about the 1 + 1.5 * nargs formula ;)

1998-02-02  Marc Lehmann  <pcg@goof.com>

	* integrate.c (INTEGRATE_THRESHOLD): Inline only small functions
	when -Os is specified.
	* toplev.c (main): Don't disable flag_inline_functions anymore when
	-Os is in effect.
	
Index: egcs/gcc/integrate.c
===================================================================
RCS file: /home/cvsroot/egcs/gcc/integrate.c,v
retrieving revision 1.1.1.9
diff -u -p -u -p -r1.1.1.9 integrate.c
--- integrate.c	1998/01/23 21:43:57	1.1.1.9
+++ integrate.c	1998/02/02 04:01:29
@@ -52,8 +52,12 @@ extern tree poplevel ();
 /* Default max number of insns a function can have and still be inline.
    This is overridden on RISC machines.  */
 #ifndef INTEGRATE_THRESHOLD
+/* Inlining small functions might save more space then not inlining at
+   all.  Assume 1 instruction for the call and 1.5 insns per argument.  */
 #define INTEGRATE_THRESHOLD(DECL) \
-  (8 * (8 + list_length (DECL_ARGUMENTS (DECL))))
+  (optimize_size \
+   ? (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2)) \
+   : (8 * (8 + list_length (DECL_ARGUMENTS (DECL)))))
 #endif
 \f
 static rtx initialize_for_inline PROTO((tree, int, int, int, int));
Index: egcs/gcc/toplev.c
===================================================================
RCS file: /home/cvsroot/egcs/gcc/toplev.c,v
retrieving revision 1.1.1.13
diff -u -p -u -p -r1.1.1.13 toplev.c
--- toplev.c	1998/01/30 21:56:19	1.1.1.13
+++ toplev.c	1998/02/02 03:57:15
@@ -3797,12 +3797,6 @@ main (argc, argv, envp)
       flag_inline_functions = 1;
     }
 
-  /* Disable code bloating optimizations if optimizing for size. */
-  if (optimize_size)
-    {
-      flag_inline_functions = 0;
-    }
-
   /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
      modify it.  */
   target_flags = 0;
	

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

* Re: INTEGRATE_THRESHOLD patch
  1998-02-02 11:43 INTEGRATE_THRESHOLD patch Marc Lehmann
@ 1998-02-05 22:09 ` Jeffrey A Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 1998-02-05 22:09 UTC (permalink / raw)
  To: Marc Lehmann; +Cc: egcs

  In message < 19980202051357.36554@cerebro.laendle >you write:
  > 
  > Here's the revised version, doing it in the architecture independent part.
  > 
  > Now we can argue about the 1 + 1.5 * nargs formula ;)
  > 
  > 1998-02-02  Marc Lehmann  <pcg@goof.com>
  > 
  > 	* integrate.c (INTEGRATE_THRESHOLD): Inline only small functions
  > 	when -Os is specified.
  > 	* toplev.c (main): Don't disable flag_inline_functions anymore when
  > 	-Os is in effect.
Installed.  The formula you use is as good as any other right now since
we have no real data on what "the best" value is.

jeff

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

end of thread, other threads:[~1998-02-05 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-02 11:43 INTEGRATE_THRESHOLD patch Marc Lehmann
1998-02-05 22:09 ` 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).