summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmCodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Specify unsupported ops, don't just use a catch allDavid Terei2011-11-221-14/+58
| | | | | | | | 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.
* Remove CPP from llvmGen/LlvmCodeGen/CodeGen.hsIan Lynagh2011-10-151-11/+9
|
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-024-37/+43
| | | | And some knock-on changes
* Renaming onlySimon Peyton Jones2011-08-253-17/+17
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* enable ARM specific target data layout and triple againKarel Gardas2011-08-211-5/+5
| | | | | | | | | | 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.
* Add popcnt support to LLVM backendDavid Terei2011-08-201-0/+24
|
* disable for now ARM specific target data layout and tripleKarel Gardas2011-08-101-5/+5
| | | | | | | | 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!
* fix ARM/LLVM target data layout specification together with target tripleKarel Gardas2011-08-101-2/+2
| | | | | | 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
* LLVM: set target data layout for arm-unknown-linux tripletKarel Gardas2011-08-101-1/+8
|
* Refactoring: explicitly mark whether we have an info table in RawCmmMax Bolingbroke2011-07-062-11/+11
| | | | | | | | | | | | 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!
* Some general code cleaning in LLVM backendDavid Terei2011-07-061-15/+6
|
* Remove the unused CmmAlign and CmmDataLabel from CmmStaticMax Bolingbroke2011-07-051-7/+0
|
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-053-7/+5
| | | | | | | | | | | | | | | | | | 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.
* Fix LLVM backend in unregisterised build to use CDavid Terei2011-06-271-1/+3
| | | | | | calling convention. Patch based on one by Karel Gardas.
* Remove type synonyms for CmmFormals, CmmActuals (and hinted versions).Edward Z. Yang2011-06-131-2/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add new mem{cpy,set,move} cmm prim ops.David Terei2011-05-312-94/+178
|
* LLVM: Support LLVM 2.9 (#5103)David Terei2011-05-041-20/+11
| | | | | Instead of using the GNU As subsection feature on Linux/Windows for TNTC we now use the LLVM Mangler on all platforms.
* LLVM: Fix #5131. Add support for missing stg regsDavid Terei2011-04-191-0/+2
|
* Merge in new code generator branch.Simon Marlow2011-01-244-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* LLVM: Fix compilation of writebarrier, #4308David Terei2010-10-041-0/+5
|
* LLVM: Code and speed improvement to dominateAllocs pass.David Terei2010-07-211-7/+5
|
* LLVM: Use mangler to fix up stack alignment issues on OSXDavid Terei2010-07-182-18/+34
|
* LLVM: Fix mistype in last commit which broke TNTC under win/linux.David Terei2010-07-141-1/+1
|
* LLVM: Add in new LLVM mangler for implementing TNTC on OSXDavid Terei2010-07-131-11/+23
|
* LLVM: Allow getelementptr to use LlvmVar for indexes.David Terei2010-07-121-14/+18
|
* LLVM: Fix various typos in commentsDavid Terei2010-07-073-20/+20
|
* LLVM: Add alias type defenitions to LlvmModule.David Terei2010-07-072-2/+6
|
* LLVM: Stop llvm saving stg caller-save regs across C callsDavid Terei2010-07-051-8/+29
| | | | | | | | 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: Use the inbounds keyword for getelementptr instructions.David Terei2010-07-021-3/+3
|
* LLVM: Change more operations to use getelementptrDavid Terei2010-07-011-24/+55
|
* LLVM: Use getelementptr instruction for a lot of situationsDavid Terei2010-06-302-31/+171
| | | | | | | | | | 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.
* LLVM: Use intrinsic functions for pow, sqrt, sin, cosDavid Terei2010-06-281-8/+8
| | | | | | | | 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.
* LLVM: Fix test '2047' under linux-x64David Terei2010-06-281-5/+5
|
* LLVM: Fix test 'ffi005' under linux-x64David Terei2010-06-281-2/+2
|
* LLVM: Update to use new fp ops introduced in 2.7David Terei2010-06-281-4/+4
|
* Add noalias and nocapture attributes to pointer stg registersDavid Terei2010-06-281-3/+7
| | | | | | | | 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.
* LLVM: Fix bug with calling tail with empty listDavid Terei2010-06-251-1/+2
|
* Allow for stg registers to have pointer type in llvm BE.David Terei2010-06-212-32/+57
| | | | | | | | Before all the stg registers were simply a bit type or floating point type but now they can be declared to have a pointer type to one of these. This will allow various optimisations in the future in llvm since the type is more accurate.
* Add support for parameter attributes to the llvm BE bindingDavid Terei2010-06-243-13/+22
| | | | | | These allow annotations of the code produced by the backend which should bring some perforamnce gains. At the moment the attributes aren't being used though.
* More updates to datalayout description in llvm BEDavid Terei2010-06-221-7/+9
|
* Update datalayout info in llvm BEDavid Terei2010-06-221-2/+2
|
* Declare some top level globals to be constant when appropriateDavid Terei2010-06-214-31/+47
| | | | | | | This involved removing the old constant handling mechanism which was fairly hard to use. Now being constant or not is simply a property of a global variable instead of a separate type.
* Reduce the number of passes over the cmm in llvm BEDavid Terei2010-06-213-26/+25
|
* Fix negate op not working for -0 in llvm backendDavid Terei2010-06-212-3/+4
|
* Add win32 datalayout support to llvm backendDavid Terei2010-06-181-3/+6
|
* Add support of TNTC to llvm backendDavid Terei2010-06-184-64/+97
| | | | | | | 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.
* Add new LLVM code generator to GHC. (Version 2)David Terei2010-06-155-0/+1457
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.