- 27 Jun, 2013 2 commits
-
-
Peter Wortmann authored
This combined patch reworks the LLVM backend in a number of ways: 1. Most prominently, we introduce a LlvmM monad carrying the contents of the old LlvmEnv around. This patch completely removes LlvmEnv and refactors towards standard library monad combinators wherever possible. 2. Support for streaming - we can now generate chunks of Llvm for Cmm as it comes in. This might improve our speed. 3. To allow streaming, we need a more flexible way to handle forward references. The solution (getGlobalPtr) unifies LlvmCodeGen.Data and getHsFunc as well. 4. Skip alloca-allocation for registers that are actually never written. LLVM will automatically eliminate these, but output is smaller and friendlier to human eyes this way. 5. We use LlvmM to collect references for llvm.used. This allows places other than cmmProcLlvmGens to generate entries.
-
Peter Wortmann authored
Also give them a proper constructor - getGlobalVar and getGlobalValue map directly to the accessors.
-
- 12 Jun, 2013 1 commit
-
-
gmainlan@microsoft.com authored
LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't define llvm.used at all when it would be empty.
-
- 17 Jan, 2013 2 commits
-
-
dterei authored
-
mad.one@gmail.com authored
This controls whether or not the compiler warns if we're using an LLVM version that's too old or too new. It's mostly useful when building the compiler knowingly with an unsupported version, so you don't get a lot of warnings in the build process. There's no documentation for this since it's a flag only a few developers would care about anyway. Signed-off-by:
Austin Seipp <mad.one@gmail.com>
-
- 12 Nov, 2012 2 commits
-
-
Simon Marlow authored
-
Simon Marlow authored
This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
-
- 30 Oct, 2012 2 commits
-
-
gmainlan@microsoft.com authored
We now have accurate global register liveness information attached to all Cmm procedures and jumps. With this patch, the LLVM back end uses this information to pass only the live floating point (F and D) registers on tail calls. This makes the LLVM back end compatible with the new register allocation strategy. Ideally the GHC LLVM calling convention would put all registers that are always live first in the parameter sequence. Unfortunately the specification is written so that on x86-64 SpLim (always live) is passed after the R registers. Therefore we must always pass *something* in the R registers, so we pass the LLVM value undef.
-
gmainlan@microsoft.com authored
All Cmm procedures now include the set of global registers that are live on procedure entry, i.e., the global registers used to pass arguments to the procedure. Only global registers that are use to pass arguments are included in this list.
-
- 12 Sep, 2012 1 commit
-
-
ian@well-typed.com authored
I've switched to passing DynFlags rather than Platform, as (a) it's simpler to not have to extract targetPlatform in so many places, and (b) it may be useful to have DynFlags around in future.
-
- 21 Aug, 2012 1 commit
-
-
ian@well-typed.com authored
-
- 07 Aug, 2012 1 commit
-
-
ian@well-typed.com authored
To explicitly choose whether you want an unregisterised build you now need to use the "--enable-unregisterised"/"--disable-unregisterised" configure flags.
-
- 30 Jul, 2012 1 commit
-
-
Simon Marlow authored
Proc-point splitting is only required by backends that do not support having proc-points within a code block (that is, everything except the native backend, i.e. LLVM and C). Not doing proc-point splitting saves some compilation time, and might produce slightly better code in some cases.
-
- 25 Jun, 2012 2 commits
- 20 Jun, 2012 1 commit
-
-
Ian Lynagh authored
-
- 12 Jun, 2012 2 commits
-
-
Ian Lynagh authored
-
Ian Lynagh authored
In particular, this makes life simpler when we want to use a general GHC SDoc in the middle of some LLVM.
-
- 17 Jan, 2012 1 commit
-
-
dterei authored
-
- 13 Jan, 2012 1 commit
-
-
dterei authored
is used for optimisation. (enabled by default)
-
- 10 Jan, 2012 1 commit
-
-
dterei authored
-
- 04 Dec, 2011 2 commits
- 22 Nov, 2011 1 commit
-
-
dterei authored
-
- 02 Oct, 2011 1 commit
-
-
Ian Lynagh authored
And some knock-on changes
-
- 25 Aug, 2011 2 commits
-
-
Simon Peyton Jones authored
CmmTop -> CmmDecl CmmPgm -> CmmGroup
-
Simon Marlow authored
-
- 15 Jul, 2011 1 commit
-
-
Ian Lynagh authored
There's now a variant of the Outputable class that knows what platform we're targetting: class PlatformOutputable a where pprPlatform :: Platform -> a -> SDoc pprPlatformPrec :: Platform -> Rational -> a -> SDoc and various instances have had to be converted to use that class, and we pass Platform around accordingly.
-
- 06 Jul, 2011 2 commits
-
-
batterseapower authored
I introduced this to support explicitly recording the info table label in RawCmm for another patch I am working on, but it turned out to lead to significant simplification in those parts of the compiler that consume RawCmm. Now, instead of lots of tests for null [CmmStatic] we have a simple test of a Maybe, and have reduced the number of guys that need to know how to convert entry->info labels by a TON. There are only 3 callers of that function now!
-
dterei authored
-
- 05 Jul, 2011 1 commit
-
-
batterseapower authored
I observed that the [CmmStatics] within CmmData uses the list in a very stylised way. The first item in the list is almost invariably a CmmDataLabel. Many parts of the compiler pattern match on this list and fail if this is not true. This patch makes the invariant explicit by introducing a structured type CmmStatics that holds the label and the list of remaining [CmmStatic]. There is one wrinkle: the x86 backend sometimes wants to output an alignment directive just before the label. However, this can be easily fixed up by parameterising the native codegen over the type of CmmStatics (though the GenCmmTop parameterisation) and using a pair (Alignment, CmmStatics) there instead. As a result, I think we will be able to remove CmmAlign and CmmDataLabel from the CmmStatic data type, thus nuking a lot of code and failing pattern matches. This change will come as part of my next patch.
-
- 31 May, 2011 1 commit
-
-
dterei authored
-
- 24 Jan, 2011 1 commit
-
-
Simon Marlow authored
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.
-
- 18 Jul, 2010 1 commit
-
-
dterei authored
-
- 13 Jul, 2010 1 commit
-
-
dterei authored
-
- 07 Jul, 2010 1 commit
-
-
dterei authored
-
- 21 Jun, 2010 2 commits
- 18 Jun, 2010 1 commit
-
-
dterei authored
We do this through a gnu as feature called subsections, where you can put data/code into a numbered subsection and those subsections will be joined together in descending order by gas at compile time.
-
- 15 Jun, 2010 1 commit
-
-
dterei authored
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.
-