This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [vta] Add chains from referenced VALUEs to DVs that reference them


On Tue, Jun 30, 2009 at 03:50:11PM +0100, Andrew Haley wrote:
> Gerald Pfeifer wrote:
> > On Tue, 30 Jun 2009, Jakub Jelinek wrote:
> >> Alternatively we could split the huge HTML_401F.java function into
> >> say 4 smaller ones.
> > 
> > Pleeeeeease! :-)  This one has been causing troubles beyond the context
> > of just vta (where, for example, on some system one needs to boot with
> > a special kernel option to provide sufficient amounts of memory to GCJ).
> 
> I can split the function, but papering over the problem by splitting
> one function won't make the problem go away for others who use gcc.
> It'll just mean that gcc developers don't notice it.

Sure, that's why I've spent last 2 weeks on var-tracking.c improvements
for this exact testcase.  The question just is, if we really need to include
so huge testcases as part of everybody's daily bootstrap/regtest cycle, or
if it is sufficient to keep such testcases on the side, for automated
testers that track their compile time/memory usage and nag us if we regress
too much on it.

> The big function is about 250k lines of GIMPLE.  jc1 uses about 474m of
> RAM at -O2 on a 64-bit system, 414m at -O1, 536m at -O0.  On what class
> of machines are you trying to build this?

>From var-tracking POV, especially on VTA branch, the main problem is
that this function has 10000 basic blocks and on VTA needs to track over
15000 of variables/VALUEs across all those bbs.  Vanilla VTA branch needs
2.9GB of memory and 25 minutes to compile this at -g -O2, with all the
patches I've sent it needs just 1.6GB of memory and 8 minutes.

> Don't we have some sort of heuristic that says "this function is
> freaking huge, don't do any expensive optimizations." ?

For var-tracking we just bail out on highly connected large cfgs:
  if (n_basic_blocks > 500 && n_edges / n_basic_blocks >= 20)
    return 0;

I haven't studied how exactly is --enable-java-maintainer-mode
compiling the classes; if I just gcj -C HTML_401F.java on
Fedora 11 (GCC 4.4.0, ecj 3.4.2), the compile time with patched
VTA is only 4:53 with 1.5GB top memory usage, if I patch HTML_401F.java
with the following patch, it compiles within 0:55 and maxes at 250MB.
I have no idea whether it will work correctly (what to test it with)
and whether it is or is not an ABI change.

2009-06-30  Jakub Jelinek  <jakub@redhat.com>

	* gnu/javax/swing/text/html/parser/HTML_401F.java (defineElements):
	Split this huge method into...
	(defineElements1, defineElements2, defineElements3, defineElements4,
	defineElements5, defineElements6): ... these smaller methods.

--- libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java.jj	2008-09-05 12:58:16.000000000 +0200
+++ libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java	2009-06-30 16:32:18.000000000 +0200
@@ -380,6 +380,20 @@ public class HTML_401F
   protected void defineElements()
   {
     /* Define the elements. */
+    defineElements1();
+    defineElements2();
+    defineElements3();
+    defineElements4();
+    defineElements5();
+    defineElements6();
+  }
+
+  /**
+   * Define first sixth of elements of this DTD.
+   */
+  private void defineElements1()
+  {
+    /* Define the elements. */
       defElement(PCDATA, 0, false, false, null, NONE, NONE,
         new AttributeList[ 0 ]);
 
@@ -885,6 +899,15 @@ public class HTML_401F
           0, IMPLIED)
       }
     );
+
+  }
+
+  /**
+   * Define second sixth of elements of this DTD.
+   */
+  private void defineElements2()
+  {
+    /* Define the elements. */
       defElement(CENTER, 0, false, false, null,
       NONE
       ,
@@ -1373,6 +1396,15 @@ public class HTML_401F
         attr(ONKEYUP, null, null, 0, IMPLIED)
       }
     );
+
+  }
+
+  /**
+   * Define third sixth of elements of this DTD.
+   */
+  private void defineElements3()
+  {
+    /* Define the elements. */
       defElement(FONT, 0, false, false, null,
       NONE
       ,
@@ -1861,6 +1893,15 @@ public class HTML_401F
         attr(VSPACE, null, null, 0, IMPLIED)
       }
     );
+
+  }
+
+  /**
+   * Define fourth sixth of elements of this DTD.
+   */
+  private void defineElements4()
+  {
+    /* Define the elements. */
       defElement(INPUT, EMPTY, false, true, null,
       NONE
       ,
@@ -2357,6 +2398,15 @@ public class HTML_401F
         attr(VSPACE, null, null, 0, IMPLIED)
       }
     );
+
+  }
+
+  /**
+   * Define fifth sixth of elements of this DTD.
+   */
+  private void defineElements5()
+  {
+    /* Define the elements. */
       defElement(OL, 0, false, false, createListModel(),
       NONE
       ,
@@ -2859,6 +2909,15 @@ public class HTML_401F
         attr(ONKEYUP, null, null, 0, IMPLIED)
       }
     );
+
+  }
+
+  /**
+   * Define last sixth of elements of this DTD.
+   */
+  private void defineElements6()
+  {
+    /* Define the elements. */
       defElement(SUP, 0, false, false, null,
       NONE
       ,


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]