summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-02-17 16:21:11 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-18 20:18:12 -0500
commit1500f0898e85316c7c97a2f759d83278a072ab0e (patch)
tree7246f4905a279679b1c5106ba6989d6e0e637f6b /compiler
parent192caf58ca1fc42806166872260d30bdb34dbace (diff)
downloadhaskell-1500f0898e85316c7c97a2f759d83278a072ab0e.tar.gz
Modules: Llvm (#13009)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/CmmToLlvm.hs (renamed from compiler/llvmGen/LlvmCodeGen.hs)22
-rw-r--r--compiler/GHC/CmmToLlvm/Base.hs (renamed from compiler/llvmGen/LlvmCodeGen/Base.hs)6
-rw-r--r--compiler/GHC/CmmToLlvm/CodeGen.hs (renamed from compiler/llvmGen/LlvmCodeGen/CodeGen.hs)16
-rw-r--r--compiler/GHC/CmmToLlvm/Data.hs (renamed from compiler/llvmGen/LlvmCodeGen/Data.hs)6
-rw-r--r--compiler/GHC/CmmToLlvm/Mangler.hs (renamed from compiler/llvmGen/LlvmMangler.hs)2
-rw-r--r--compiler/GHC/CmmToLlvm/Ppr.hs (renamed from compiler/llvmGen/LlvmCodeGen/Ppr.hs)8
-rw-r--r--compiler/GHC/CmmToLlvm/Regs.hs (renamed from compiler/llvmGen/LlvmCodeGen/Regs.hs)18
-rw-r--r--compiler/GHC/Llvm.hs (renamed from compiler/llvmGen/Llvm.hs)10
-rw-r--r--compiler/GHC/Llvm/MetaData.hs (renamed from compiler/llvmGen/Llvm/MetaData.hs)4
-rw-r--r--compiler/GHC/Llvm/Ppr.hs (renamed from compiler/llvmGen/Llvm/PpLlvm.hs)8
-rw-r--r--compiler/GHC/Llvm/Syntax.hs (renamed from compiler/llvmGen/Llvm/AbsSyn.hs)6
-rw-r--r--compiler/GHC/Llvm/Types.hs (renamed from compiler/llvmGen/Llvm/Types.hs)4
-rw-r--r--compiler/ghc.cabal.in25
-rw-r--r--compiler/main/CodeOutput.hs2
-rw-r--r--compiler/main/DriverPipeline.hs2
-rw-r--r--compiler/main/SysTools/Tasks.hs2
16 files changed, 73 insertions, 68 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/GHC/CmmToLlvm.hs
index fb53f4caf8..f84c2901a5 100644
--- a/compiler/llvmGen/LlvmCodeGen.hs
+++ b/compiler/GHC/CmmToLlvm.hs
@@ -3,19 +3,25 @@
-- -----------------------------------------------------------------------------
-- | This is the top-level module in the LLVM code generator.
--
-module LlvmCodeGen ( LlvmVersion, llvmVersionList, llvmCodeGen, llvmFixupAsm ) where
+module GHC.CmmToLlvm
+ ( LlvmVersion
+ , llvmVersionList
+ , llvmCodeGen
+ , llvmFixupAsm
+ )
+where
#include "HsVersions.h"
import GhcPrelude
-import Llvm
-import LlvmCodeGen.Base
-import LlvmCodeGen.CodeGen
-import LlvmCodeGen.Data
-import LlvmCodeGen.Ppr
-import LlvmCodeGen.Regs
-import LlvmMangler
+import GHC.Llvm
+import GHC.CmmToLlvm.Base
+import GHC.CmmToLlvm.CodeGen
+import GHC.CmmToLlvm.Data
+import GHC.CmmToLlvm.Ppr
+import GHC.CmmToLlvm.Regs
+import GHC.CmmToLlvm.Mangler
import GHC.StgToCmm.CgUtils ( fixStgRegisters )
import GHC.Cmm
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs
index 0da437ef18..c0bd742840 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/GHC/CmmToLlvm/Base.hs
@@ -9,7 +9,7 @@
-- Contains functions useful through out the code generator.
--
-module LlvmCodeGen.Base (
+module GHC.CmmToLlvm.Base (
LlvmCmmDecl, LlvmBasicBlock,
LiveGlobalRegs,
@@ -43,8 +43,8 @@ module LlvmCodeGen.Base (
import GhcPrelude
-import Llvm
-import LlvmCodeGen.Regs
+import GHC.Llvm
+import GHC.CmmToLlvm.Regs
import GHC.Cmm.CLabel
import GHC.Platform.Regs ( activeStgRegs )
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs
index e46e0f787f..33dd82c418 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/GHC/CmmToLlvm/CodeGen.hs
@@ -4,15 +4,15 @@
-- ----------------------------------------------------------------------------
-- | Handle conversion of CmmProc to LLVM code.
--
-module LlvmCodeGen.CodeGen ( genLlvmProc ) where
+module GHC.CmmToLlvm.CodeGen ( genLlvmProc ) where
#include "HsVersions.h"
import GhcPrelude
-import Llvm
-import LlvmCodeGen.Base
-import LlvmCodeGen.Regs
+import GHC.Llvm
+import GHC.CmmToLlvm.Base
+import GHC.CmmToLlvm.Regs
import GHC.Cmm.BlockId
import GHC.Platform.Regs ( activeStgRegs )
@@ -422,8 +422,8 @@ genCall target res args = runStmtsDecls $ do
_ -> CC_Ccc
CCallConv -> CC_Ccc
CApiConv -> CC_Ccc
- PrimCallConv -> panic "LlvmCodeGen.CodeGen.genCall: PrimCallConv"
- JavaScriptCallConv -> panic "LlvmCodeGen.CodeGen.genCall: JavaScriptCallConv"
+ PrimCallConv -> panic "GHC.CmmToLlvm.CodeGen.genCall: PrimCallConv"
+ JavaScriptCallConv -> panic "GHC.CmmToLlvm.CodeGen.genCall: JavaScriptCallConv"
PrimTarget _ -> CC_Ccc
@@ -1927,10 +1927,10 @@ toIWord dflags = mkIntLit (llvmWord dflags)
-- | Error functions
panic :: String -> a
-panic s = Outputable.panic $ "LlvmCodeGen.CodeGen." ++ s
+panic s = Outputable.panic $ "GHC.CmmToLlvm.CodeGen." ++ s
pprPanic :: String -> SDoc -> a
-pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d
+pprPanic s d = Outputable.pprPanic ("GHC.CmmToLlvm.CodeGen." ++ s) d
-- | Returns TBAA meta data by unique
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
index d44ecaea20..b20c9bd360 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/GHC/CmmToLlvm/Data.hs
@@ -3,7 +3,7 @@
-- | Handle conversion of CmmData to LLVM code.
--
-module LlvmCodeGen.Data (
+module GHC.CmmToLlvm.Data (
genLlvmData, genData
) where
@@ -11,8 +11,8 @@ module LlvmCodeGen.Data (
import GhcPrelude
-import Llvm
-import LlvmCodeGen.Base
+import GHC.Llvm
+import GHC.CmmToLlvm.Base
import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
diff --git a/compiler/llvmGen/LlvmMangler.hs b/compiler/GHC/CmmToLlvm/Mangler.hs
index 8215781860..1cdad2009f 100644
--- a/compiler/llvmGen/LlvmMangler.hs
+++ b/compiler/GHC/CmmToLlvm/Mangler.hs
@@ -9,7 +9,7 @@
-- instructions require 32-byte alignment.
--
-module LlvmMangler ( llvmFixupAsm ) where
+module GHC.CmmToLlvm.Mangler ( llvmFixupAsm ) where
import GhcPrelude
diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/GHC/CmmToLlvm/Ppr.hs
index 576e84dda4..45a8285ec6 100644
--- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ b/compiler/GHC/CmmToLlvm/Ppr.hs
@@ -3,7 +3,7 @@
-- ----------------------------------------------------------------------------
-- | Pretty print helpers for the LLVM Code generator.
--
-module LlvmCodeGen.Ppr (
+module GHC.CmmToLlvm.Ppr (
pprLlvmCmmDecl, pprLlvmData, infoSection
) where
@@ -11,9 +11,9 @@ module LlvmCodeGen.Ppr (
import GhcPrelude
-import Llvm
-import LlvmCodeGen.Base
-import LlvmCodeGen.Data
+import GHC.Llvm
+import GHC.CmmToLlvm.Base
+import GHC.CmmToLlvm.Data
import GHC.Cmm.CLabel
import GHC.Cmm
diff --git a/compiler/llvmGen/LlvmCodeGen/Regs.hs b/compiler/GHC/CmmToLlvm/Regs.hs
index 4b1a15674e..60c27c8f44 100644
--- a/compiler/llvmGen/LlvmCodeGen/Regs.hs
+++ b/compiler/GHC/CmmToLlvm/Regs.hs
@@ -4,7 +4,7 @@
-- | Deal with Cmm registers
--
-module LlvmCodeGen.Regs (
+module GHC.CmmToLlvm.Regs (
lmGlobalRegArg, lmGlobalRegVar, alwaysLive,
stgTBAA, baseN, stackN, heapN, rxN, topN, tbaa, getTBAA
) where
@@ -13,7 +13,7 @@ module LlvmCodeGen.Regs (
import GhcPrelude
-import Llvm
+import GHC.Llvm
import GHC.Cmm.Expr
import DynFlags
@@ -79,7 +79,7 @@ lmGlobalReg dflags suf reg
ZmmReg 5 -> zmmGlobal $ "ZMM5" ++ suf
ZmmReg 6 -> zmmGlobal $ "ZMM6" ++ suf
MachSp -> wordGlobal $ "MachSp" ++ suf
- _other -> panic $ "LlvmCodeGen.Reg: GlobalReg (" ++ (show reg)
+ _other -> panic $ "GHC.CmmToLlvm.Reg: GlobalReg (" ++ (show reg)
++ ") not supported!"
-- LongReg, HpLim, CCSS, CurrentTSO, CurrentNusery, HpAlloc
-- EagerBlackholeInfo, GCEnter1, GCFun, BaseReg, PicBaseReg
@@ -116,12 +116,12 @@ stgTBAA
-- hierarchy and as of LLVM 4.0 should *only* be referenced by other nodes. It
-- should never occur in any LLVM instruction statement.
rootN, topN, stackN, heapN, rxN, baseN :: Unique
-rootN = getUnique (fsLit "LlvmCodeGen.Regs.rootN")
-topN = getUnique (fsLit "LlvmCodeGen.Regs.topN")
-stackN = getUnique (fsLit "LlvmCodeGen.Regs.stackN")
-heapN = getUnique (fsLit "LlvmCodeGen.Regs.heapN")
-rxN = getUnique (fsLit "LlvmCodeGen.Regs.rxN")
-baseN = getUnique (fsLit "LlvmCodeGen.Regs.baseN")
+rootN = getUnique (fsLit "GHC.CmmToLlvm.Regs.rootN")
+topN = getUnique (fsLit "GHC.CmmToLlvm.Regs.topN")
+stackN = getUnique (fsLit "GHC.CmmToLlvm.Regs.stackN")
+heapN = getUnique (fsLit "GHC.CmmToLlvm.Regs.heapN")
+rxN = getUnique (fsLit "GHC.CmmToLlvm.Regs.rxN")
+baseN = getUnique (fsLit "GHC.CmmToLlvm.Regs.baseN")
-- | The TBAA metadata identifier
tbaa :: LMString
diff --git a/compiler/llvmGen/Llvm.hs b/compiler/GHC/Llvm.hs
index 8104a3a61e..65389a7a5b 100644
--- a/compiler/llvmGen/Llvm.hs
+++ b/compiler/GHC/Llvm.hs
@@ -9,7 +9,7 @@
-- (EHC) project (<http://www.cs.uu.nl/wiki/Ehc/WebHome>).
--
-module Llvm (
+module GHC.Llvm (
-- * Modules, Functions and Blocks
LlvmModule(..),
@@ -57,8 +57,8 @@ module Llvm (
) where
-import Llvm.AbsSyn
-import Llvm.MetaData
-import Llvm.PpLlvm
-import Llvm.Types
+import GHC.Llvm.Syntax
+import GHC.Llvm.MetaData
+import GHC.Llvm.Ppr
+import GHC.Llvm.Types
diff --git a/compiler/llvmGen/Llvm/MetaData.hs b/compiler/GHC/Llvm/MetaData.hs
index 97e8086f42..3e319c7036 100644
--- a/compiler/llvmGen/Llvm/MetaData.hs
+++ b/compiler/GHC/Llvm/MetaData.hs
@@ -1,10 +1,10 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-module Llvm.MetaData where
+module GHC.Llvm.MetaData where
import GhcPrelude
-import Llvm.Types
+import GHC.Llvm.Types
import Outputable
-- The LLVM Metadata System.
diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/GHC/Llvm/Ppr.hs
index b534276f08..0e8d279a50 100644
--- a/compiler/llvmGen/Llvm/PpLlvm.hs
+++ b/compiler/GHC/Llvm/Ppr.hs
@@ -4,7 +4,7 @@
-- | Pretty print LLVM IR Code.
--
-module Llvm.PpLlvm (
+module GHC.Llvm.Ppr (
-- * Top level LLVM objects.
ppLlvmModule,
@@ -27,9 +27,9 @@ module Llvm.PpLlvm (
import GhcPrelude
-import Llvm.AbsSyn
-import Llvm.MetaData
-import Llvm.Types
+import GHC.Llvm.Syntax
+import GHC.Llvm.MetaData
+import GHC.Llvm.Types
import Data.List ( intersperse )
import Outputable
diff --git a/compiler/llvmGen/Llvm/AbsSyn.hs b/compiler/GHC/Llvm/Syntax.hs
index a89ee35706..d048215a0b 100644
--- a/compiler/llvmGen/Llvm/AbsSyn.hs
+++ b/compiler/GHC/Llvm/Syntax.hs
@@ -2,12 +2,12 @@
-- | The LLVM abstract syntax.
--
-module Llvm.AbsSyn where
+module GHC.Llvm.Syntax where
import GhcPrelude
-import Llvm.MetaData
-import Llvm.Types
+import GHC.Llvm.MetaData
+import GHC.Llvm.Types
import Unique
diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/GHC/Llvm/Types.hs
index fee5af9160..f4fa9a9a56 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/GHC/Llvm/Types.hs
@@ -4,7 +4,7 @@
-- | The LLVM Type System.
--
-module Llvm.Types where
+module GHC.Llvm.Types where
#include "HsVersions.h"
@@ -372,7 +372,7 @@ llvmWidthInBits _ (LMStructU _) =
-- It's not trivial to calculate the bit width of the unpacked structs,
-- since they will be aligned depending on the specified datalayout (
-- http://llvm.org/docs/LangRef.html#data-layout ). One way we could support
- -- this could be to make the LlvmCodeGen.Ppr.moduleLayout be a data type
+ -- this could be to make the GHC.CmmToLlvm.Ppr.moduleLayout be a data type
-- that exposes the alignment information. However, currently the only place
-- we use unpacked structs is LLVM intrinsics that return them (e.g.,
-- llvm.sadd.with.overflow.*), so we don't actually need to compute their
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 2f27d7d116..04dfa692f3 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -165,7 +165,6 @@ Library
cmm
coreSyn
iface
- llvmGen
main
nativeGen
parser
@@ -212,18 +211,18 @@ Library
Predicate
Lexeme
Literal
- Llvm
- Llvm.AbsSyn
- Llvm.MetaData
- Llvm.PpLlvm
- Llvm.Types
- LlvmCodeGen
- LlvmCodeGen.Base
- LlvmCodeGen.CodeGen
- LlvmCodeGen.Data
- LlvmCodeGen.Ppr
- LlvmCodeGen.Regs
- LlvmMangler
+ GHC.Llvm
+ GHC.Llvm.Syntax
+ GHC.Llvm.MetaData
+ GHC.Llvm.Ppr
+ GHC.Llvm.Types
+ GHC.CmmToLlvm
+ GHC.CmmToLlvm.Base
+ GHC.CmmToLlvm.CodeGen
+ GHC.CmmToLlvm.Data
+ GHC.CmmToLlvm.Ppr
+ GHC.CmmToLlvm.Regs
+ GHC.CmmToLlvm.Mangler
MkId
Module
Name
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs
index 6656a4f4d8..de5452740e 100644
--- a/compiler/main/CodeOutput.hs
+++ b/compiler/main/CodeOutput.hs
@@ -13,7 +13,7 @@ module CodeOutput( codeOutput, outputForeignStubs ) where
import GhcPrelude
import AsmCodeGen ( nativeCodeGen )
-import LlvmCodeGen ( llvmCodeGen )
+import GHC.CmmToLlvm ( llvmCodeGen )
import UniqSupply ( mkSplitUniqSupply )
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 6fbf019456..6fe8bc0d35 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -57,7 +57,7 @@ import StringBuffer ( hGetStringBuffer, hPutStringBuffer )
import BasicTypes ( SuccessFlag(..) )
import Maybes ( expectJust )
import SrcLoc
-import LlvmCodeGen ( llvmFixupAsm, llvmVersionList )
+import GHC.CmmToLlvm ( llvmFixupAsm, llvmVersionList )
import MonadUtils
import GHC.Platform
import TcRnTypes
diff --git a/compiler/main/SysTools/Tasks.hs b/compiler/main/SysTools/Tasks.hs
index ee6824327a..d006a84b99 100644
--- a/compiler/main/SysTools/Tasks.hs
+++ b/compiler/main/SysTools/Tasks.hs
@@ -22,7 +22,7 @@ import System.IO
import System.Process
import GhcPrelude
-import LlvmCodeGen.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersion, parseLlvmVersion)
+import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersion, parseLlvmVersion)
import SysTools.Process
import SysTools.Info