From 16e1948802edf1d3a57516644e1c5d1506bfa545 Mon Sep 17 00:00:00 2001 From: chak Date: Tue, 6 Nov 2001 05:08:52 +0000 Subject: [PATCH] [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 --- ghc/docs/comm/index.html | 5 +++-- ghc/docs/comm/the-beast/driver.html | 37 ++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ghc/docs/comm/index.html b/ghc/docs/comm/index.html index 4799151..9f0aeb1 100644 --- a/ghc/docs/comm/index.html +++ b/ghc/docs/comm/index.html @@ -6,7 +6,7 @@ -

The Glasgow Haskell Compiler (GHC) Commentary [v0.3]

+

The Glasgow Haskell Compiler (GHC) Commentary [v0.4]

Manuel M. T. Chakravarty
Simon Marlow
+ Simon Peyton Jones
Reuben Thomas
 

@@ -75,7 +76,7 @@

-Last modified: Fri Aug 24 16:17:11 EST 2001 +Last modified: Tue Nov 6 15:07:39 EST 2001 diff --git a/ghc/docs/comm/the-beast/driver.html b/ghc/docs/comm/the-beast/driver.html index 6b9a768..6f6e784 100644 --- a/ghc/docs/comm/the-beast/driver.html +++ b/ghc/docs/comm/the-beast/driver.html @@ -70,6 +70,41 @@ HsVersions.h. +

Scheduling Optimisations Phases

+

+ 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 DriverState.hs. + First of all, there is the variable hsc_minusNoO_flags that + determines the -f options that you get without + -O (aka optimisation level 0) as well as + hsc_minusO_flags and hsc_minusO2_flags for + -O and -O2. +

+ However, most of the strategic decisions about optimisations on the + intermediate language Core are encoded in the value produced by + buildCoreToDo, which is a list with elements of type + CoreToDo. Each element of this list specifies one step in + the sequence of core optimisations executed by the Mighty Simplifier. The type + CoreToDo is defined in CmdLineOpts.lhs. + The actual execution of the optimisation plan produced by + buildCoreToDo is performed by SimpleCore.doCorePasses. + 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 buildStgToDo :: [StgToDo]. However, this is a + lot less complex than the arrangement for Core optimisations. +

Linking the RTS and libHSstd

Since the RTS and HSstd refer to each other, there is a Cunning @@ -122,7 +157,7 @@

-Last modified: Fri Aug 24 23:12:33 EST 2001 +Last modified: Tue Nov 6 16:08:59 EST 2001 -- 1.7.10.4