summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/Llvm
Commit message (Collapse)AuthorAgeFilesLines
* Remove spurious extra brace in LLVM metadataPeter Wortmann2013-07-051-1/+1
| | | | | | | This actually caused a segfault in the optimized stage 2 compiler due to wrong TBAA data. Signed-off-by: David Terei <davidterei@gmail.com>
* LLVM refactor cleanupsPeter Wortmann2013-06-271-1/+0
| | | | | Slightly more documentation, removed unused label map (huh), removed MonadIO instance on LlvmM to improve encapsulation.
* Major Llvm refactoringPeter Wortmann2013-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* Use full contents size for arraysPeter Wortmann2013-06-271-1/+3
| | | | | | I am not quite sure at what point it makes sense to look at arrays as pointers, but I ran into at least one use case that strongly suggested doing it this way (calculating the actual size of structures, to be exact).
* Rewrite ppLlvmBlock to use standard library "break"Peter Wortmann2013-06-271-13/+8
|
* Extend globals to aliasesPeter Wortmann2013-06-272-15/+19
| | | | | Also give them a proper constructor - getGlobalVar and getGlobalValue map directly to the accessors.
* Use SDoc for all LLVM pretty-printingPeter Wortmann2013-06-273-269/+267
| | | | | | | This patch reworks some parts of the LLVM pretty-printing code that were still using Show and String. Now we should be using SDoc and Outputable throughout. Note that many get*Name functions become pp*Name here as a side-effect.
* Iteration on dterei's metadata designPeter Wortmann2013-06-274-81/+32
| | | | | | | | | | | | | | | | | | | | | - MetaArgs is not needed, as variables are already meta data - Same goes for MetaVal - its only reason for existing seems to be to support LLVM's strange pretty-printing for meta-data annotations, and I feel that is better to keep the data structure clean and handle it in the pretty-printing instead. - Rename "MetaData" to "MetaAnnot". Meta-data is still meta-data when it is not associated with an expression or statement - for example compile unit data for debugging. I feel the old name was a bit misleading. - Make the renamed MetaAnnot a proper data type instead of a type alias for a pair. - Rename "MetaExpr" constructor to "MetaStruct". As the data is much more like a LLVM structure (not array, as it can contain values). - Fix a warning
* Add ability to call functions with metadata as arguments to LLVMDavid Terei2013-06-274-15/+50
| | | | backend.
* Rework LLVM metadata representation to be more accurate.David Terei2013-06-274-60/+141
|
* Fixed moer tyopsGabor Greif2013-04-251-8/+8
|
* Tell LLVM that all vector stores and loads are potentially unaligned.Geoffrey Mainland2013-02-011-3/+22
|
* Add support for LLVM vectors.Geoffrey Mainland2013-02-013-26/+70
| | | | | This patch adds support for LLVM vectors and vector operations to our internal LLVM abstract syntax data types.
* Fix floating point constants in LLVM backend (#7600).David Terei2013-01-171-8/+30
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-2/+1
|
* Pass DynFlags down to llvmWordIan Lynagh2012-09-161-16/+17
|
* Use SDoc rather than Doc in LLVMIan Lynagh2012-06-121-57/+49
| | | | | In particular, this makes life simpler when we want to use a general GHC SDoc in the middle of some LLVM.
* Improve support for LLVM >= 3.0 write barrier. (#5814)David Terei2012-01-302-13/+26
|
* llvmGen: Use new fence instructionBen Gamari2012-01-302-0/+22
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Incorrect type conversion in LLVM backend (#5785).Ubuntu2012-01-181-1/+4
|
* Add Metadata support to LLVM bindings.David Terei2012-01-123-6/+109
|
* More improvements to llvm output style (#5750)David Terei2012-01-121-13/+14
|
* Improve style of '-ddump-llvm' output. (#5750)David Terei2012-01-101-15/+33
|
* Fix printing of llvm IR to work with llvm-3.0David Terei2011-07-052-48/+40
|
* Add new mem{cpy,set,move} cmm prim ops.David Terei2011-05-312-0/+7
|
* LLVM: Fix printing of local vars so LLVM works with -fnew-codegenDavid Terei2010-07-201-1/+2
|
* LLVM: Add inline assembly to binding.David Terei2010-07-142-0/+26
|
* Remove unnecessary #includeIan Lynagh2010-07-131-1/+0
|
* LLVM: Allow getelementptr to use LlvmVar for indexes.David Terei2010-07-122-6/+4
|
* LLVM: Fix various typos in commentsDavid Terei2010-07-072-5/+5
|
* LLVM: Add alias type defenitions to LlvmModule.David Terei2010-07-073-30/+30
|
* LLVM: Use packed structure type instead of structure typeDavid Terei2010-07-071-4/+4
| | | | | | | The regular structure type adds padding to conform to the platform ABI, which causes problems with structures storing doubles under windows since we don't conform to the platform ABI there. So we use packed structures instead now that don't do any padding.
* LLVM: Add in literal undefined value to bindingDavid Terei2010-07-051-0/+4
|
* LLVM: Add a literal NULL value to bindingDavid Terei2010-07-051-0/+4
| | | | Patch from Erik de Castro Lopo <erikd@mega-nerd.com>.
* LLVM: Use the inbounds keyword for getelementptr instructions.David Terei2010-07-022-5/+7
|
* LLVM: Update to use new fp ops introduced in 2.7David Terei2010-06-281-5/+14
|
* LLVM: Fix bug with calling tail with empty listDavid Terei2010-06-251-8/+14
|
* Allow for stg registers to have pointer type in llvm BE.David Terei2010-06-211-0/+3
| | | | | | | | 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-15/+85
| | | | | | 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.
* Fix handling of float literals in llvm BEDavid Terei2010-06-221-1/+11
|
* Declare some top level globals to be constant when appropriateDavid Terei2010-06-213-50/+33
| | | | | | | 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.
* Fix negate op not working for -0 in llvm backendDavid Terei2010-06-211-15/+7
|
* Add support of TNTC to llvm backendDavid Terei2010-06-183-159/+161
| | | | | | | 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-153-0/+1253
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.