This is the mail archive of the gcc@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: [gnat] reuse of ASTs already constructed


>>>>> "Oliver" == Oliver Kellogg <oliver.kellogg@t-online.de> writes:

Oliver> First tests look very promising. I'm getting noticeable speedups
Oliver> of when supplying N interrelated bodies in a single call as opposed
Oliver> to N individual calls to gnat1. Precise measurements will follow.

This sounds like it has a lot of overlap with the incremental compiler
project I was working on.  I think you could probably rearrange things
to use the compile server infrastructure from the branch without
trouble.

There are some differences in invocation.  I designed the incremental
compiler so that no changes to user Makefiles would be needed; I don't
know whether that is a consideration with Ada.

I think the compile server infrastructure is in decent shape, though I
haven't worked on it in a while, so it is a bit hard to remember
exactly.  The difficult bit is converting a front end to be
server-ready; but from your note it sounds like you have already done
that.

Oliver> It's not totally functioning yet:
Oliver> 1) invocation of "as" (assembler) is only done for the first file

This is solved on the branch.  There, the server starts the assembler
from compile_file.

Oliver> 2) gcc is passing too many switches to the compiler, for example
Oliver> "-o" (output file) should be suppressed when in multi-source mode.

With the compile server you don't have to worry about this kind of
thing.  I changed the options processing code to be re-initializable;
each compiler job in the server runs with its own set of options.

Oliver> * toplev.c:
Oliver> 1) Had to make realloc_for_line_map() global because when repeatedly
Oliver> calling linemap_init(), the member "reallocator" is NULL and I
Oliver> couldn't find a way of setting it to the proper value again.

I suggest a new public function in toplev.c that creates a line table.
I did something similar to this on the incremental branch; except
there I did not have to make it public, since server re-initialization
is done in toplev.c.

I am curious how you handle locations on shared bits of the AST.
I needed some disturbing hacks to make this work well for C.

Oliver> * cgraph.{h,c}, cgraphunit.c:
Oliver> Added many missing reinitializations that are necessary when calling
Oliver> compile_file() repeatedly.

I did this on the branch too.  I needed similar changes in dwarf2out
that you might be interested in.  I also changed things so that debug
output starts "late", but offhand I don't recall whether that is only
relevant to the server case.

Tom


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