public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Disabling CSE passes and GC?
@ 2002-12-10  3:31 Richard Guenther
  2002-12-10  7:49 ` Jan Hubicka
  2002-12-10 12:05 ` Geoff Keating
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Guenther @ 2002-12-10  3:31 UTC (permalink / raw)
  To: gcc

Hi!

To speed up compilation I'd like to disable CSE, CSE 2 and garbage
collecting (i.e. just dont free mem at all). I cannot find options to do
so, though (looked at gcc 3.0 and gcc 3.2).

Can we add such options?

Thanks, Richard.

--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

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

* Re: Disabling CSE passes and GC?
  2002-12-10  3:31 Disabling CSE passes and GC? Richard Guenther
@ 2002-12-10  7:49 ` Jan Hubicka
  2002-12-10 12:05 ` Geoff Keating
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Hubicka @ 2002-12-10  7:49 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc

> Hi!
> 
> To speed up compilation I'd like to disable CSE, CSE 2 and garbage
> collecting (i.e. just dont free mem at all). I cannot find options to do
> so, though (looked at gcc 3.0 and gcc 3.2).
CSE is disabled at -O0.  It does not make much sense to have optimizing
compilation without CSE, but you can get it faster with
-fnocse-follow-jumps and -fno-cse-skip-blocks.
CSE2 pass can be disabled with -fnorerun-cse-after-loop
There is no way currently to control GC I believe.
Adding function to control it's behaviour may make sense.

Honza
> 
> Can we add such options?
> 
> Thanks, Richard.
> 
> --
> Richard Guenther <richard.guenther@uni-tuebingen.de>
> WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

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

* Re: Disabling CSE passes and GC?
  2002-12-10  3:31 Disabling CSE passes and GC? Richard Guenther
  2002-12-10  7:49 ` Jan Hubicka
@ 2002-12-10 12:05 ` Geoff Keating
  2002-12-21 10:39   ` Disabling CSE passes and GC? [+ a little bookkeeping patch] Segher Boessenkool
  1 sibling, 1 reply; 4+ messages in thread
From: Geoff Keating @ 2002-12-10 12:05 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc

Richard Guenther <rguenth@tat.physik.uni-tuebingen.de> writes:

> Hi!
> 
> To speed up compilation I'd like to disable CSE, CSE 2 and garbage
> collecting (i.e. just dont free mem at all). I cannot find options to do
> so, though (looked at gcc 3.0 and gcc 3.2).
> 
> Can we add such options?

You can effectively disable GC in GCC 3.3 by using 
--param ggc-min-heapsize=<size in K>
and letting GCC grow the heap to a very large size before collecting.
The default is 4096, which means GCC won't run collection until the
heap is 4Mb or larger; you might want to pick a number like 128000, if
your machine has 256Mb of memory.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: Disabling CSE passes and GC? [+ a little bookkeeping patch]
  2002-12-10 12:05 ` Geoff Keating
@ 2002-12-21 10:39   ` Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2002-12-21 10:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc

Geoff Keating wrote:
> 
> You can effectively disable GC in GCC 3.3 by using
> --param ggc-min-heapsize=<size in K>
> and letting GCC grow the heap to a very large size before collecting.
> The default is 4096, which means GCC won't run collection until the
> heap is 4Mb or larger; you might want to pick a number like 128000, if
> your machine has 256Mb of memory.

I use minimum 16MB and minimum "grow factor" of 4, before doing GC;
works fine, and saves about 30% wall clock time.  This is probably
too big to have as default for GCC on all systems, though; but
setting the grow factor to 2 helps a lot, already.  The current
default of 1.2 isn't very well tuned, it seems.


Before I forget: maybe someone tuning GC will find the attached
old patch useful: it reports which pass allocated how much GC-able
memory (but it doesn't report when it is freed).

No Changelog, I'm lazy, this is just some boring code that someone
might find useful while investigating GC speedup.  And the FSF didn't
process my papers yet anyway.  Oh, and it's for ggc-page only, btw.


Segher



--- /home/segher/gcc/gcc-20020805/gcc/timevar.c	Fri Nov 16 03:36:39 2001
+++ ./timevar.c	Mon Aug 19 18:20:56 2002
@@ -24,6 +24,8 @@
 #include "intl.h"
 #include "rtl.h"
 
+extern HOST_WIDE_INT ggc_total_allocated;
+
 #ifdef HAVE_SYS_TIMES_H
 # include <sys/times.h>
 #endif
@@ -186,6 +188,8 @@
   now->sys  = 0;
   now->wall = 0;
 
+  now->alloc = 0;
+
   if (!TIMEVAR_ENABLE)
     return;
 
@@ -206,6 +210,8 @@
     now->user = clock () * clocks_to_msec;
 #endif
   }
+
+  now->alloc = ggc_total_allocated;
 }
 
 /* Add the difference between STOP_TIME and START_TIME to TIMER.  */
@@ -219,6 +225,8 @@
   timer->user += stop_time->user - start_time->user;
   timer->sys += stop_time->sys - start_time->sys;
   timer->wall += stop_time->wall - start_time->wall;
+
+  timer->alloc += stop_time->alloc - start_time->alloc;
 }
 
 /* Initialize timing variables.  */
@@ -464,7 +472,8 @@
          zeroes.  */
       if (tv->elapsed.user < tiny
 	  && tv->elapsed.sys < tiny
-	  && tv->elapsed.wall < tiny)
+	  && tv->elapsed.wall < tiny
+	  && tv->elapsed.alloc < tiny * 1048576)
 	continue;
 
       /* The timing variable name.  */
@@ -491,6 +500,11 @@
 	       (total->wall == 0 ? 0 : tv->elapsed.wall / total->wall) * 100);
 #endif /* HAVE_WALL_TIME */
 
+      /* Print Megabytes allocated in GC memory.  */
+      fprintf(fp, "%7.2f (%2.0f%%) alloc",
+	      tv->elapsed.alloc / 1048576.,
+	      (total->alloc == 0 ? 0 : (double)tv->elapsed.alloc / total->alloc) * 100);
+
       putc ('\n', fp);
     }
 
@@ -503,9 +517,10 @@
   fprintf (fp, "%7.2f          ", total->sys);
 #endif
 #ifdef HAVE_WALL_TIME
-  fprintf (fp, "%7.2f\n", total->wall);
+  fprintf (fp, "%7.2f           ", total->wall);
 #endif
-  
+  fprintf (fp, "%7.2f\n", total->alloc / 1048576.);
+
 #endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) 
 	  || defined (HAVE_WALL_TIME) */
 }
--- /home/segher/gcc/gcc-20020805/gcc/timevar.h	Tue Oct 30 00:01:45 2001
+++ ./timevar.h	Mon Aug 19 16:49:12 2002
@@ -61,6 +61,9 @@
 
   /* Wall clock time.  */
   float wall;
+
+  /* GC allocated bytes.  */
+  HOST_WIDE_INT alloc;
 };
 
 /* An enumeration of timing variable identifiers.  Constructed from
--- /home/segher/gcc/gcc-20020805/gcc/ggc-page.c	Sat Jan  5 23:11:21 2002
+++ ./ggc-page.c	Mon Aug 19 20:59:59 2002
@@ -335,6 +335,8 @@
   FILE *debug_file;
 } G;
 
+HOST_WIDE_INT ggc_total_allocated;
+
 /* The size in bytes required to maintain a bitmap for the objects
    on a page-entry.  */
 #define BITMAP_SIZE(Num_objects) \
@@ -952,6 +954,7 @@
   /* Keep track of how many bytes are being allocated.  This
      information is used in deciding when to collect.  */
   G.allocated += OBJECT_SIZE (order);
+  ggc_total_allocated += size;
 
   if (GGC_DEBUG_LEVEL >= 3)
     fprintf (G.debug_file, 
@@ -1046,6 +1049,8 @@
 init_ggc ()
 {
   unsigned order;
+
+  ggc_total_allocated = 0;
 
   G.pagesize = getpagesize();
   G.lg_pagesize = exact_log2 (G.pagesize);


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

end of thread, other threads:[~2002-12-21  5:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10  3:31 Disabling CSE passes and GC? Richard Guenther
2002-12-10  7:49 ` Jan Hubicka
2002-12-10 12:05 ` Geoff Keating
2002-12-21 10:39   ` Disabling CSE passes and GC? [+ a little bookkeeping patch] Segher Boessenkool

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