Merge in new code generator branch. This changes the new code generator to make use of the Hoopl package for dataflow analysis. Hoopl is a new boot package, and is maintained in a separate upstream git repository (as usual, GHC has its own lagging darcs mirror in http://darcs.haskell.org/packages/hoopl). During this merge I squashed recent history into one patch. I tried to rebase, but the history had some internal conflicts of its own which made rebase extremely confusing, so I gave up. The history I squashed was: - Update new codegen to work with latest Hoopl - Add some notes on new code gen to cmm-notes - Enable Hoopl lag package. - Add SPJ note to cmm-notes - Improve GC calls on new code generator. Work in this branch was done by: - Milan Straka <fox@ucw.cz> - John Dias <dias@cs.tufts.edu> - David Terei <davidterei@gmail.com> Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD and fixed a few bugs.
Add new LLVM code generator to GHC. (Version 2) This was done as part of an honours thesis at UNSW, the paper describing the work and results can be found at: http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf A Homepage for the backend can be found at: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM Quick summary of performance is that for the 'nofib' benchmark suite, runtimes are within 5% slower than the NCG and generally better than the C code generator. For some code though, such as the DPH projects benchmark, the LLVM code generator outperforms the NCG and C code generator by about a 25% reduction in run times.
Fix warnings in CmmUtils
Removed warnings, made Haddock happy, added examples in documentation The interesting examples talk about our story with heap checks in case alternatives and our story with the case scrutinee as a Boolean.
Merging in the new codegen branch This merge does not turn on the new codegen (which only compiles a select few programs at this point), but it does introduce some changes to the old code generator. The high bits: 1. The Rep Swamp patch is finally here. The highlight is that the representation of types at the machine level has changed. Consequently, this patch contains updates across several back ends. 2. The new Stg -> Cmm path is here, although it appears to have a fair number of bugs lurking. 3. Many improvements along the CmmCPSZ path, including: o stack layout o some code for infotables, half of which is right and half wrong o proc-point splitting
replace Cmm 'hint' with 'kind' C-- no longer has 'hints'; to guide parameter passing, it has 'kinds'. Renamed type constructor, data constructor, and record fields accordingly
minor changes to Cmm left over from September 2007 Nothing too deep here; primarily tinking with prettyprinting and names. Also eliminated some warnings. This patch covers most (but not all) of the code NR changed at the very end of September 2007, just before ICFP hit...
change CmmActual, CmmFormal to use a data CmmHinted rather than tuple (#1405) This allows the instance of UserOfLocalRegs to be within Haskell98, and IMHO makes the code a little cleaner generally. This is one small (though tedious) step towards making GHC's code more portable...
Move OPTIONS pragmas above comments Fixes building with -Werror (i.e. validate) and GHC < 6.6
a good deal of salutory renaming I've renamed a number of type and data constructors within Cmm so that the names used in the compiler may more closely reflect the C-- specification 2.1. I've done a bit of other renaming as well. Highlights: CmmFormal and CmmActual now bear a CmmKind (which for now is a MachHint as before) CmmFormals = [CmmFormal] and CmmActuals = [CmmActual] suitable changes have been made to both code and nonterminals in the Cmm parser (which is as yet untested) For reasons I don't understand, parts of the code generator use a sequence of 'formal parameters' with no C-- kinds. For these we now have the types type CmmFormalWithoutKind = LocalReg type CmmFormalsWithoutKinds = [CmmFormalWithoutKind] A great many appearances of (Tau, MachHint) have been simplified to the appropriate CmmFormal or CmmActual, though I'm sure there are more opportunities. Kind and its data constructors are now renamed to data GCKind = GCKindPtr | GCKindNonPtr to avoid confusion with the Kind used in the type checker and with CmmKind. Finally, in a somewhat unrelated bit (and in honor of Simon PJ, who thought of the name), the Whalley/Davidson 'transaction limit' is now called 'OptimizationFuel' with the net effect that there are no longer two unrelated uses of the abbreviation 'tx'.
Fix CodingStyle#Warnings URLs
Use OPTIONS rather than OPTIONS_GHC for pragmas Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
Finished support for foreign calls in the CPS pass
Module header tidyup, phase 1 This patch is a start on removing import lists and generally tidying up the top of each module. In addition to removing import lists: - Change DATA.IOREF -> Data.IORef etc. - Change List -> Data.List etc. - Remove $Id$ - Update copyrights - Re-order imports to put non-GHC imports last - Remove some unused and duplicate imports
Reorganisation of the source tree Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.