summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/Llvm.hs
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2010-06-15 09:47:14 +0000
committerDavid Terei <davidterei@gmail.com>2010-06-15 09:47:14 +0000
commit49a8e5c021009430d373d6224b29004c7d18c408 (patch)
tree5e49c02cc6ad756d92ef71d4ab16338b278352a6 /compiler/llvmGen/Llvm.hs
parent0c41772cba7ec3f558cd2619716c7db771eae935 (diff)
downloadhaskell-49a8e5c021009430d373d6224b29004c7d18c408.tar.gz
Add new LLVM code generator to GHC. (Version 2)
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.
Diffstat (limited to 'compiler/llvmGen/Llvm.hs')
-rw-r--r--compiler/llvmGen/Llvm.hs52
1 files changed, 52 insertions, 0 deletions
diff --git a/compiler/llvmGen/Llvm.hs b/compiler/llvmGen/Llvm.hs
new file mode 100644
index 0000000000..7a322bd86f
--- /dev/null
+++ b/compiler/llvmGen/Llvm.hs
@@ -0,0 +1,52 @@
+-- ----------------------------------------------------------------------------
+-- | This module supplies bindings to generate Llvm IR from Haskell
+-- (<http://www.llvm.org/docs/LangRef.html>).
+--
+-- Note: this module is developed in a demand driven way. It is no complete
+-- LLVM binding library in Haskell, but enough to generate code for GHC.
+--
+-- This code is derived from code taken from the Essential Haskell Compiler
+-- (EHC) project (<http://www.cs.uu.nl/wiki/Ehc/WebHome>).
+--
+
+module Llvm (
+
+ -- * Modules, Functions and Blocks
+ LlvmModule(..),
+
+ LlvmFunction(..), LlvmFunctionDecl(..),
+ LlvmFunctions, LlvmFunctionDecls,
+ LlvmStatement(..), LlvmExpression(..),
+ LlvmBlocks, LlvmBlock(..), LlvmBlockId,
+
+ -- * Call Handling
+ LlvmCallConvention(..), LlvmCallType(..), LlvmParameterListType(..),
+ LlvmLinkageType(..), LlvmFuncAttr(..),
+
+ -- * Operations and Comparisons
+ LlvmCmpOp(..), LlvmMachOp(..), LlvmCastOp(..),
+
+ -- * Variables and Type System
+ LlvmVar(..), LlvmStatic(..), LlvmLit(..), LlvmType(..),
+ LMGlobal, LMString, LMConstant,
+
+ -- ** Some basic types
+ i64, i32, i16, i8, i1, llvmWord, llvmWordPtr,
+
+ -- ** Operations on the type system.
+ isGlobal, getLitType, getLit, getName, getPlainName, getVarType,
+ getStatType, getGlobalVar, getGlobalType, pVarLower, pLift, pLower,
+ isInt, isFloat, isPointer, llvmWidthInBits,
+
+ -- * Pretty Printing
+ ppLlvmModule, ppLlvmComments, ppLlvmComment, ppLlvmConstants,
+ ppLlvmConstant, ppLlvmGlobals, ppLlvmGlobal, ppLlvmFunctionDecls,
+ ppLlvmFunctionDecl, ppLlvmFunctions, ppLlvmFunction, ppLlvmType,
+ ppLlvmTypes, llvmSDoc
+
+ ) where
+
+import Llvm.AbsSyn
+import Llvm.PpLlvm
+import Llvm.Types
+