[Haskell-cafe] Re: Compiler backend question
john at repetae.net
Mon Jan 7 14:51:42 EST 2008
On Tue, Jan 01, 2008 at 06:44:46PM +0100, Achim Schneider wrote:
> Peter Verswyvelen <bf3 at telenet.be> wrote:
> > Another question regarding the backend: a cool feature of the
> > Microsoft Visual C++ (MVC) compiler is its ability to perform "LTCG"
> > (link-time-code-generation), performing whole program optimization.
> > It something like this possible with Haskell / (or the GCC backend?).
> > Would it be possible to feed all the generated C code of the GHC
> > compiler into the MVC compiler, to generate one big MVC / LTCG
> > generated executable? It would be interesting to see how much the
> > whole program optimization approach (which can do analysis on the
> > program as if it was a single module) would improve performance...
> jhc does that. Or rather, it doesn't compile Haskell modules separately
> but throws them together (presumably) in the first pass.
It optimizes everything seperately to a level that is analogous to ghc
core (which I call, oddly enough, jhc core). it then collects everything
together and translates it into grin, which doesn't have an exact
equivalent in ghc but is equivalent to a first order monadic
strict functional language and analogous enough to the SSA intermediate form
of imperative compilers that one would find it quite comfy were one used
I would like to move jhc to more of a 'link-time-code-generation' model
though if I understand what you mean, right now jhc does a full
monolithic compilation which is pretty resource intensive. I would like
to switch to more of an 'incremental whole program compilation' (no,
that isn't a contridiction) whereby individual files will compile to .o
files, but then before the final linking a special pass will be done to
generate the appropriate specialized "glue" for putting the .o files
together, this should give a nice middle ground between fully monolithic
and the limitations of abiding by the standard C linker.
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell-Cafe