| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
| |
TBAA allows us to specify a type hierachy in metadata with
the property that nodes on different branches don't alias.
This should somewhat improve the optimizations LLVM does that
rely on alias information.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
LLVM has a problem when the user imports some FFI types
like memcpy and memset in a manner that conflicts with
the types that GHC uses internally.
So now we pre-initialise the environment with the most
general types for these functions.
|
| |
|
|
|
|
|
|
|
|
| |
Compile time still isn't as good as I'd like but no easy changes
available. LLVM backend could do with a big rewrite to improve
performance as there are some ugly designs in it.
At least the test case isn't 10min anymore, just a few seconds now.
|
| |
|
| |
|
|
|
|
|
| |
This field was doing nothing. I think it originally appeared in a
very old incarnation of the new code generator.
|
|
|
|
|
|
|
|
|
| |
In GHC, this provides an easy way to call a C function via a C wrapper.
This is important when the function is really defined by CPP.
Requires the new CApiFFI extension.
Not documented yet, as it's still an experimental feature at this stage.
|
| |
|
|
|
|
|
|
|
|
| |
Better to specifically list the unsupported cases in code
than to have a catch all that panics. The later method hides
problems when new constructors are added such as the recent
additions to the supported Cmm prim ops that weren't ported
to the C backend since no one noticed.
|
| |
|
|
|
|
| |
And some knock-on changes
|
|
|
|
|
| |
CmmTop -> CmmDecl
CmmPgm -> CmmGroup
|
|
|
|
|
|
|
|
|
|
| |
This patch is allowed by the 'on ARMv7 with VFPv3[D16] support pass
appropriate -mattr value to LLVM llc' patch. The trick is that LLVM
by default (probably!) does not enable VFP, but GHC requires it
so LLVM's llc asserts on unavailable floating point register. i.e. GHC/LLVM
backend compiles into LLVM code which is using floats, but llc thinks
no float regs for this are available. Passing appropriate llc option
which is implemented in patch mentioned above fixes this issue.
|
| |
|
|
|
|
|
|
|
|
| |
This patch disables ARM specific target data layout and triple.
The reason for this is that LLVM asserts on some files if this
is in use. The assert looks:
Formal argument #8 has unhandled type i32UNREACHABLE executed at
/llvm-ghc-arm/lib/CodeGen/CallingConvLower.cpp:81!
|
|
|
|
|
|
| |
This patch fixes ARM/LLVM target data layout specification based
on what Clang is using itself. I've modified Clang's used triple
a little bit from armv4t-* to arm-* though
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
calling convention.
Patch based on one by Karel Gardas.
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
| |
|
|
|
|
|
| |
Instead of using the GNU As subsection feature on Linux/Windows
for TNTC we now use the LLVM Mangler on all platforms.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 is already handled by the Cmm code generator so LLVM is simply
duplicating work. LLVM also doesn't know which ones are actually live
so saves them all which causes a fair performance overhead for C calls
on x64. We stop llvm saving them across the call by storing undef to
them just before the call.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
LLVM supports creating pointers in two ways, firstly through
pointer arithmetic (by casting between pointers and ints)
and secondly using the getelementptr instruction. The second way
is preferable as it gives LLVM more information to work with.
This patch changes a lot of pointer related code from the first
method to the getelementptr method.
|
|
|
|
|
|
|
|
| |
Instead of calling the C library for these Cmm functions
we use intrinsic functions provided by llvm. LLVM will
then either create a compile time constant if possible, or
use a cpu instruction or as a last resort call the C
library.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
At the moment this gives a very slight performance boost of around 1 - 2%.
Future changes to the generated code though so that pointers are kept as
pointers more often instead of being cast to integer types straight away
should hopefully improve the benefit this brings.
|