[commit: ghc] master: Major Llvm refactoring (a948fe8)
David Terei
davidterei at gmail.com
Fri Jun 28 03:56:35 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/a948fe838bc79363d7565033d6ee42bf24d52fdc
>---------------------------------------------------------------
commit a948fe838bc79363d7565033d6ee42bf24d52fdc
Author: Peter Wortmann <scpmw at leeds.ac.uk>
Date: Wed Jun 26 15:45:16 2013 +0100
Major Llvm refactoring
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.
compiler/llvmGen/Llvm/Types.hs | 2 +
compiler/llvmGen/LlvmCodeGen.hs | 253 ++++---
compiler/llvmGen/LlvmCodeGen/Base.hs | 393 ++++++++---
compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 1103 ++++++++++++++++---------------
compiler/llvmGen/LlvmCodeGen/Data.hs | 153 ++---
compiler/llvmGen/LlvmCodeGen/Ppr.hs | 82 ++-
compiler/llvmGen/LlvmCodeGen/Regs.hs | 55 +-
compiler/main/CodeOutput.lhs | 6 +-
8 files changed, 1103 insertions(+), 944 deletions(-)
Diff suppressed because of size. To see it, use:
git show a948fe838bc79363d7565033d6ee42bf24d52fdc
More information about the ghc-commits
mailing list