Commit 16e19488 authored by chak's avatar chak
Browse files

[project @ 2001-11-06 05:08:52 by chak]

* added SPJ to authors list and bumped the version number

* documented the buildCoreToDo story and related issues
parent d5f79e6e
......@@ -6,7 +6,7 @@
<h1>The Glasgow Haskell Compiler (GHC) Commentary [v0.3]</h1>
<h1>The Glasgow Haskell Compiler (GHC) Commentary [v0.4]</h1>
<!-- Contributors: Whoever makes substantial additions or changes to the
document, please add your name and keep the order alphabetic. Moreover,
......@@ -15,6 +15,7 @@
<strong>Manuel M. T. Chakravarty</strong><br>
<strong>Simon Marlow</strong><br>
<strong>Simon Peyton Jones</strong><br>
<strong>Reuben Thomas</strong><br>
......@@ -75,7 +76,7 @@
<!-- hhmts start -->
Last modified: Fri Aug 24 16:17:11 EST 2001
Last modified: Tue Nov 6 15:07:39 EST 2001
<!-- hhmts end -->
......@@ -70,6 +70,41 @@
<h2>Scheduling Optimisations Phases</h2>
GHC has a large variety of optimisations at its disposal, many of which
have subtle interdependencies. The overall plan for program
optimisation is fixed in <a
First of all, there is the variable <code>hsc_minusNoO_flags</code> that
determines the <code>-f</code> options that you get without
<code>-O</code> (aka optimisation level 0) as well as
<code>hsc_minusO_flags</code> and <code>hsc_minusO2_flags</code> for
<code>-O</code> and <code>-O2</code>.
However, most of the strategic decisions about optimisations on the
intermediate language Core are encoded in the value produced by
<code>buildCoreToDo</code>, which is a list with elements of type
<code>CoreToDo</code>. Each element of this list specifies one step in
the sequence of core optimisations executed by the <a
href="simplifier.html">Mighty Simplifier</a>. The type
<code>CoreToDo</code> is defined in <a
The actual execution of the optimisation plan produced by
<code>buildCoreToDo</code> is performed by <a
Core optimisation plans consist of a number of simplification phases
(currently, three for optimisation levels of 1 or higher) with
decreasing phase numbers (the lowest, corresponding to the last phase,
namely 0). Before and after these phases, optimisations such as
specialisation, let floating, worker/wrapper, and so on are executed.
The sequence of phases is such that the synergistic effect of the phases
is maximised -- however, this is a fairly fragile arrangement.
There is a similar construction for optimisations on STG level stored in
the variable <code>buildStgToDo :: [StgToDo]</code>. However, this is a
lot less complex than the arrangement for Core optimisations.
<h2>Linking the <code>RTS</code> and <code>libHSstd</code></h2>
Since the RTS and HSstd refer to each other, there is a Cunning
......@@ -122,7 +157,7 @@
<!-- hhmts start -->
Last modified: Fri Aug 24 23:12:33 EST 2001
Last modified: Tue Nov 6 16:08:59 EST 2001
<!-- hhmts end -->
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment