summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmMangler.hs
Commit message (Collapse)AuthorAgeFilesLines
* LlvmMangler: Be more selective when mangling object typesBen Gamari2014-08-151-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We previously did a wholesale replace of `%function` to `%object` to mangle object `.type` annotations. This is bad as it can end up replacing appearances of `"%function"` in the user's code. We now look for a proper `.type` keyword before performing the replacement. Thanks to @rwbarton for pointing out the bug. Test Plan: Previously, $ echo 'main = putStrLn "@function"' > test.hs $ ghc -fllvm test.hs $ ./test @object Now, $ echo 'main = putStrLn "@function"' > test.hs $ ghc -fllvm test.hs $ ./test @function Reviewers: rwbarton, austin Reviewed By: rwbarton, austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D150 GHC Trac Issues: #9439
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-0/+2
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix validate failure.Austin Seipp2014-01-071-4/+4
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Remove trailing whitespace.Austin Seipp2014-01-071-3/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* LlvmMangler: Make sure no symbols slip through re-.typingBen Gamari2014-01-071-7/+12
| | | | | | | | | Previously a few symbols weren't flipped from %function to %object as the section splitter was emitting them without processes. This may be a bug in itself but for now let's just work around the issue but rewriting all symbol `.types`. Signed-off-by: Austin Seipp <austin@well-typed.com>
* LlvmMangler: Rewrite @function symbols to @objectBen Gamari2014-01-071-5/+11
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* LLVM mangler: fix AVX instruction rewriter.Austin Seipp2014-01-071-1/+1
| | | | | | | This was pretty badly broken... Authored-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Typo: s/LlVM/LlVM/Joachim Breitner2013-11-171-1/+1
|
* Fixup stack spills when generating AVX instructions.Geoffrey Mainland2013-09-221-1/+38
| | | | | | | | | LLVM uses aligned AVX moves to spill values onto the stack, which requires 32-bye aligned stacks. Since the stack in only 16-byte aligned, LLVM inserts extra instructions that munge the stack pointer. This is very very bad for the GHC calling convention, so we tell LLVM to assume the stack is 32-byte aligned. This patch rewrites the spill instructions that LLVM generates so they do not require an aligned stack.
* Add CCS for llvmDavid Terei2011-12-031-1/+1
|
* Clean up LLVM Mangler.David Terei2011-11-221-48/+14
|
* Show LLVM mangler and code gen passes at v2David Terei2011-11-221-2/+5
|
* Fix #4211: No need to fixup stack using mangler on OSXDavid Terei2011-11-171-42/+4
| | | | | | | We now manage the stack correctly on both x86 and i386, keeping the stack align at (16n bytes - word size) on function entry and at (16n bytes) on function calls. This gives us compatability with LLVM and GCC.
* Change stack alignment to 16+8 bytes in STG codeDavid M Peixotto2011-11-011-2/+4
| | | | | | | | | | | | | | | | | This patch changes the STG code so that %rsp to be aligned to a 16-byte boundary + 8. This is the alignment required by the x86_64 ABI on entry to a function. Previously we kept %rsp aligned to a 16-byte boundary, but this was causing problems for the LLVM backend (see #4211). We now don't need to invoke llvm stack mangler on x86_64 targets. Since the stack is now 16+8 byte algined in STG land on x86_64, we don't need to mangle the stack manipulations with the llvm mangler. This patch only modifies the alignement for x86_64 backends. Signed-off-by: David Terei <davidterei@gmail.com>
* Warning policeManuel M T Chakravarty2011-08-101-1/+1
|
* Stephen Blackheath's GHC/ARM registerised portKarel Gardas2011-08-101-1/+5
| | | | | | This is the Stephen Blackheath's GHC/ARM registerised port which is using modified version of LLVM and which provides basic registerised build functionality
* Improve LLVM Mangler to handle debug information.David Terei2011-07-181-47/+76
| | | | Patch by Peter Wortmann!
* Fix silly mistake in last commitDavid Terei2011-06-251-5/+5
|
* Speed improvement to LLVM Mangler for large sections.David Terei2011-06-251-8/+9
| | | | Patch by Peter Wortmann!
* LLVM: Support LLVM 2.9 (#5103)David Terei2011-05-041-19/+33
| | | | | Instead of using the GNU As subsection feature on Linux/Windows for TNTC we now use the LLVM Mangler on all platforms.
* LLVM: Add support for 64bit OSX. (partial #4210)David Terei2011-05-041-4/+12
|
* LLVM: Fix bug with osx mangler and jump tables.David Terei2011-05-011-4/+6
|
* LLVM: Fix #4995, llvm mangler broken for large compilesDavid Terei2011-03-091-5/+8
|
* LLVM: Huge improvement to mangler speed.David Terei2011-02-131-179/+102
| | | | | | | The old llvm mangler was horrible! Very slow due to bad design and code. New version is linear complexity as it should be and far lower coefficients. This fixes trac 4838.
* Defensify naked read in LLVM manglerBen Lippmeier2010-12-101-10/+27
|
* Formatting onlyBen Lippmeier2010-12-101-19/+19
|
* LLVM: Fix OSX to work again with TNTC disabled.David Terei2010-07-201-6/+12
|
* LLVM: Fix up botched last commitDavid Terei2010-07-191-2/+2
|
* LLVM: Fix warning introduce in last commit.David Terei2010-07-191-2/+2
|
* LLVM: Use mangler to fix up stack alignment issues on OSXDavid Terei2010-07-181-13/+66
|
* LLVM: Add in new LLVM mangler for implementing TNTC on OSXDavid Terei2010-07-131-0/+129