X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Fdocs%2Fcomm%2Fthe-beast%2Fdriver.html;h=6f6e78473e35aa957c44cb8d3324c7d94627d4bf;hp=6b9a76868b7fad0b094567ad7619691ce5e1fe7e;hb=16e1948802edf1d3a57516644e1c5d1506bfa545;hpb=d5f79e6e7bab767de9c528ac343132d8daeab0da 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