| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Currently no NCGs support it
|
|
|
|
| |
No special-casing in any NCGs yet
|
|
|
|
| |
Only amd64 has an efficient implementation currently.
|
|
|
|
|
| |
This means we no longer do a division twice when we are using quotRem
(on platforms on which the op is supported; currently only amd64).
|
|
|
|
|
|
|
|
|
| |
We now carry around with CmmJump statements a list of
the STG registers that are live at that jump site.
This is used by the LLVM backend so it can avoid
unnesecarily passing around dead registers, improving
perfromance. This gives us the framework to finally
fix trac #4308.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This field was doing nothing. I think it originally appeared in a
very old incarnation of the new code generator.
|
|
|
|
|
| |
Based on a patch from Arnaud Degroote <degroote@NetBSD.org> in
trac #5480.
|
| |
|
|
|
|
| |
10.5 and Linux. For both: compiler/nativeGen/PPC/Instr.hs compiler/nativeGen/SPARC/Instr.hs failed to (stage1) build. For Mac OS X, but mysteriously not for Linux: compiler/basicTypes/Id.lhs compiler/basicTypes/Name.lhs failed during haddock'ing.
|
| |
|
|
|
|
|
| |
We only use it for "compiler" sources, i.e. not for libraries.
Many modules have a -fno-warn-tabs kludge for now.
|
| |
|
| |
|
| |
|
|
|
|
| |
We now use the value from the targetPlatform instead.
|
|
|
|
|
|
|
| |
This reverts commit f75f26cc4eed3c3cfc256ebfb9e77b8e82a766fc.
On second thoughts, this does make sense, for unregisterised via-C
OSes at least.
|
|
|
|
|
|
| |
It doesn't make sense. If platformOS is OSUnknown then we don't know the
answer to any questions about the OS. So now if we don't recognise the
OS we just fail, and the new OS will need to be added to the datatype.
|
| |
|
|
|
|
| |
And some knock-on changes
|
|
|
|
|
| |
CmmTop -> CmmDecl
CmmPgm -> CmmGroup
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
| |
|
| |
|
|
|
|
| |
It is in the NatM monad, which has DynFlags as part of its state.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
In particular, the "#error" for platforms without a NCG is gone,
which means the module should now build on all platforms again.
I'm not sure if this is the nicest way to handle multiple platforms
here, but it works for now.
|
| |
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We achieve this by splitting up instruction selection for case
switches into two parts: the actual code generation, and the
generation of the accompanying jump table. With this scheme,
the jump fixup code can modify the contents of the jump table
stored within the JMP_TBL (or BCTL) instruction, before the
actual data section is created.
SPARC and PPC patches are untested; they might not work!
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|