summaryrefslogtreecommitdiff
path: root/compiler/cmm/Cmm.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-07-19 10:03:06 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-07-30 11:55:17 +0100
commitf1ed6a1052331b6d5b001983925bdab66f99b0f6 (patch)
treed7c494a8e9bff22a5d91ca7765792a9ce13dac4a /compiler/cmm/Cmm.hs
parentfe3753e75f2f140c6c2554e3e255d8f4c6f254be (diff)
downloadhaskell-f1ed6a1052331b6d5b001983925bdab66f99b0f6.tar.gz
New codegen: do not split proc-points when using the NCG
Proc-point splitting is only required by backends that do not support having proc-points within a code block (that is, everything except the native backend, i.e. LLVM and C). Not doing proc-point splitting saves some compilation time, and might produce slightly better code in some cases.
Diffstat (limited to 'compiler/cmm/Cmm.hs')
-rw-r--r--compiler/cmm/Cmm.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs
index 315e582878..2dedee0d52 100644
--- a/compiler/cmm/Cmm.hs
+++ b/compiler/cmm/Cmm.hs
@@ -14,7 +14,7 @@ module Cmm (
CmmReplGraph, GenCmmReplGraph, CmmFwdRewrite, CmmBwdRewrite,
-- * Info Tables
- CmmTopInfo(..), CmmStackInfo(..), CmmInfoTable(..),
+ CmmTopInfo(..), CmmStackInfo(..), CmmInfoTable(..), topInfoTable,
ClosureTypeInfo(..),
C_SRT(..), needsSRT,
ProfilingInfo(..), ConstrDescription,
@@ -96,17 +96,23 @@ type CmmBwdRewrite f = BwdRewrite UniqSM CmmNode f
-- Info Tables
-----------------------------------------------------------------------------
-data CmmTopInfo = TopInfo { info_tbl :: CmmInfoTable
+data CmmTopInfo = TopInfo { info_tbls :: BlockEnv CmmInfoTable
, stack_info :: CmmStackInfo }
+topInfoTable :: GenCmmDecl a CmmTopInfo (GenCmmGraph n) -> Maybe CmmInfoTable
+topInfoTable (CmmProc infos _ g) = mapLookup (g_entry g) (info_tbls infos)
+topInfoTable _ = Nothing
+
data CmmStackInfo
= StackInfo {
arg_space :: ByteOff,
-- number of bytes of arguments on the stack on entry to the
-- the proc. This is filled in by StgCmm.codeGen, and used
-- by the stack allocator later.
- updfr_space :: Maybe ByteOff -- XXX: comment?
- }
+ updfr_space :: Maybe ByteOff
+ -- XXX: this never contains anything useful, but it should.
+ -- See comment in CmmLayoutStack.
+ }
-- | Info table as a haskell data type
data CmmInfoTable
@@ -116,7 +122,6 @@ data CmmInfoTable
cit_prof :: ProfilingInfo,
cit_srt :: C_SRT
}
- | CmmNonInfoTable -- Procedure doesn't need an info table
data ProfilingInfo
= NoProfilingInfo