summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmCodeGen/Ppr.hs
Commit message (Collapse)AuthorAgeFilesLines
* Delete trailing whitespace in LlvmCodeGen/Ppr.hsAustin Seipp2013-08-241-2/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add support for iOS simulator (issue #8152).Austin Seipp2013-08-241-0/+3
| | | | | | | | The iOS simulator is essentially an iOS target but for an x86 machine instead. It doesn't support the native code generator either, though. Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Major Llvm refactoringPeter Wortmann2013-06-271-45/+37
| | | | | | | | | | | | | | | | | | | | | | 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.
* Extend globals to aliasesPeter Wortmann2013-06-271-4/+4
| | | | | Also give them a proper constructor - getGlobalVar and getGlobalValue map directly to the accessors.
* Support QNXNTO for arm under LLVMStephen Paul Weber2013-06-201-0/+3
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add iOS specific module layout entry to LLVM codegen; fixes #7721Ian Lynagh2013-03-021-0/+3
| | | | Patch from Stephen Blackheath
* Added support to cross-compile to androidNathan2013-01-241-0/+3
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Generate correct LLVM for the new register allocation scheme.Geoffrey Mainland2012-10-301-2/+2
| | | | | | | | | | | | | 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.
* Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-301-1/+1
| | | | | | | 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.
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-2/+3
|
* Pass DynFlags down to llvmWordIan Lynagh2012-09-161-2/+2
|
* Remove some CPP from llvmGen/LlvmCodeGen/Ppr.hsIan Lynagh2012-08-281-35/+24
| | | | | | I changed the behaviour slightly, e.g. i386/FreeBSD will no longer fall through and use the Linux "i386-pc-linux-gnu", but will get the final empty case instead. I assume that that's the right thing to do.
* Use SDoc rather than Doc in LLVMIan Lynagh2012-06-121-7/+6
| | | | | In particular, this makes life simpler when we want to use a general GHC SDoc in the middle of some LLVM.
* Use Type Based Alias Analysis (TBAA) in LLVM backend (#5567)David Terei2012-01-121-5/+11
| | | | | | | 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.
* More improvements to llvm output style (#5750)David Terei2012-01-121-1/+1
|
* Fix trac # 5486David Terei2011-12-051-2/+2
| | | | | | | | | 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.
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-021-3/+3
| | | | And some knock-on changes
* Renaming onlySimon Peyton Jones2011-08-251-4/+4
| | | | | 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.
* 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-061-10/+10
| | | | | | | | | | | | 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!
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-051-2/+2
| | | | | | | | | | | | | | | | | | 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.
* 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.
* Merge in new code generator branch.Simon Marlow2011-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use mangler to fix up stack alignment issues on OSXDavid Terei2010-07-181-5/+20
|
* 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: Add alias type defenitions to LlvmModule.David Terei2010-07-071-1/+5
|
* Add support for parameter attributes to the llvm BE bindingDavid Terei2010-06-241-2/+1
| | | | | | 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-211-11/+14
| | | | | | | 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-211-13/+12
|
* Add win32 datalayout support to llvm backendDavid Terei2010-06-181-3/+6
|
* Add support of TNTC to llvm backendDavid Terei2010-06-181-30/+57
| | | | | | | 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-151-0/+91
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.