- 10 Feb, 2015 1 commit
-
-
Ben Gamari authored
Summary: Rework llvmGen to use LLVM 3.6 exclusively. The plans for the 7.12 release are to ship LLVM alongside GHC in the interests of user (and developer) sanity. Along the way, refactor TNTC support to take advantage of the new `prefix` data support in LLVM 3.6. This allows us to drop the section-reordering component of the LLVM mangler. Test Plan: Validate, look at emitted code Reviewers: dterei, austin, scpmw Reviewed By: austin Subscribers: erikd, awson, spacekitteh, thomie, carter Differential Revision: https://phabricator.haskell.org/D530 GHC Trac Issues: #10074
-
- 28 Dec, 2014 1 commit
-
-
Erik de Castro Lopo authored
Summary: * Throw an error when cross-compiling without a target definition. When cross compiling via LLVM, a target 'datalayout' and 'triple' must be defined or LLVM will generate code for the compile host instead of the compile target. * Add aarch64-unknown-linux-gnu target. The datalayout and triple lines were found by using clang to compile a small C program and -emit-llvm to get the LLVM IR output. Signed-off-by:
Erik de Castro Lopo <erikd@mega-nerd.com> Test Plan: validate Reviewers: rwbarton, carter, hvr, bgamari, austin Reviewed By: austin Subscribers: carter, thomie, garious Differential Revision: https://phabricator.haskell.org/D585 GHC Trac Issues: #9895
-
- 21 Nov, 2014 1 commit
-
-
Ben Gamari authored
Due to changes in LLVM 3.5 aliases now may only refer to definitions. Previously to handle symbols defined outside of the current commpilation unit GHC would emit both an `external` declaration, as well as an alias pointing to it, e.g., @stg_BCO_info = external global i8 @stg_BCO_info$alias = alias private i8* @stg_BCO_info Where references to `stg_BCO_info` will use the alias `stg_BCO_info$alias`. This is not permitted under the new alias behavior, resulting in errors resembling, Alias must point to a definition i8* @"stg_BCO_info$alias" To fix this, we invert the naming relationship between aliases and definitions. That is, now the symbol definition takes the name `@stg_BCO_info$def` and references use the actual name, `@stg_BCO_info`. This means the external symbols can be handled by simply emitting an `external` declaration, @stg_BCO_info = external global i8 Whereas in the case of a forward declaration we emit, @stg_BCO_info = alias private i8* @stg_BCO_info$def Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D155
-
- 19 Nov, 2014 2 commits
-
-
lukexi authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Moritz Angermann authored
Summary: This allows to link objects produced with the llvm code generator to be linked with -dead_strip. This applies to at least the iOS cross compiler and OS X compiler. Signed-off-by:
Moritz Angermann <moritz@lichtzwerge.de> Test Plan: Create a ffi library and link it with -dead_strip. If the resulting binary does not crash, the patch works as advertised. Reviewers: rwbarton, simonmar, hvr, dterei, mzero, ezyang, austin Reviewed By: dterei, ezyang, austin Subscribers: thomie, mzero, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D206
-
- 15 May, 2014 1 commit
-
-
Herbert Valerio Riedel authored
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.
-
- 24 Aug, 2013 2 commits
-
-
thoughtpolice authored
Signed-off-by:
Austin Seipp <aseipp@pobox.com>
-
thoughtpolice authored
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>
-
- 27 Jun, 2013 2 commits
-
-
Peter Wortmann authored
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.
-
Peter Wortmann authored
Also give them a proper constructor - getGlobalVar and getGlobalValue map directly to the accessors.
-
- 20 Jun, 2013 1 commit
-
-
singpolyma authored
Signed-off-by:
Austin Seipp <aseipp@pobox.com>
-
- 02 Mar, 2013 1 commit
-
-
ian@well-typed.com authored
Patch from Stephen Blackheath
-
- 25 Jan, 2013 1 commit
-
-
RudolfVonKrugstein authored
Signed-off-by:
David Terei <davidterei@gmail.com>
-
- 12 Nov, 2012 1 commit
-
-
Simon Marlow authored
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.
-
- 30 Oct, 2012 2 commits
-
-
gmainlan@microsoft.com authored
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.
-
gmainlan@microsoft.com authored
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.
-
- 16 Sep, 2012 2 commits
-
-
ian@well-typed.com authored
-
ian@well-typed.com authored
-
- 28 Aug, 2012 1 commit
-
-
ian@well-typed.com authored
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.
-
- 12 Jun, 2012 1 commit
-
-
Ian Lynagh authored
In particular, this makes life simpler when we want to use a general GHC SDoc in the middle of some LLVM.
-
- 12 Jan, 2012 2 commits
- 06 Dec, 2011 1 commit
-
-
dterei authored
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.
-
- 02 Oct, 2011 1 commit
-
-
Ian Lynagh authored
And some knock-on changes
-
- 25 Aug, 2011 1 commit
-
-
Simon Peyton Jones authored
CmmTop -> CmmDecl CmmPgm -> CmmGroup
-
- 21 Aug, 2011 1 commit
-
-
kgardas authored
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.
-
- 10 Aug, 2011 3 commits
-
-
kgardas authored
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!
-
kgardas authored
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
-
kgardas authored
-
- 06 Jul, 2011 1 commit
-
-
batterseapower authored
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!
-
- 05 Jul, 2011 1 commit
-
-
batterseapower authored
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.
-
- 04 May, 2011 1 commit
-
-
dterei authored
Instead of using the GNU As subsection feature on Linux/Windows for TNTC we now use the LLVM Mangler on all platforms.
-
- 24 Jan, 2011 1 commit
-
-
Simon Marlow authored
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.
-
- 18 Jul, 2010 1 commit
-
-
dterei authored
-
- 14 Jul, 2010 1 commit
-
-
dterei authored
-
- 13 Jul, 2010 1 commit
-
-
dterei authored
-
- 07 Jul, 2010 1 commit
-
-
dterei authored
-
- 24 Jun, 2010 1 commit
-
-
dterei authored
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.
-
- 22 Jun, 2010 2 commits