summaryrefslogtreecommitdiff
path: root/compiler/cmm/Cmm.hs
diff options
context:
space:
mode:
authorGeoffrey Mainland <gmainlan@microsoft.com>2012-10-17 18:20:29 +0100
committerGeoffrey Mainland <gmainlan@microsoft.com>2012-10-30 20:50:48 +0000
commit5ee08ddffbbe596d7716a09306888004e6baf2b1 (patch)
treeace546c8fd030cdfe3332f9a29873e3757dca33b /compiler/cmm/Cmm.hs
parent82ede42607140f8e8a05579a43fb4e7376a430db (diff)
downloadhaskell-5ee08ddffbbe596d7716a09306888004e6baf2b1.tar.gz
Attach global register liveness info to Cmm procedures.
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.
Diffstat (limited to 'compiler/cmm/Cmm.hs')
-rw-r--r--compiler/cmm/Cmm.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs
index 8409f0dbeb..e1701bd4c5 100644
--- a/compiler/cmm/Cmm.hs
+++ b/compiler/cmm/Cmm.hs
@@ -71,6 +71,14 @@ data GenCmmDecl d h g
= CmmProc -- A procedure
h -- Extra header such as the info table
CLabel -- Entry label
+ [GlobalReg] -- Registers live on entry. Note that the set of live
+ -- registers will be correct in generated C-- code, but
+ -- not in hand-written C-- code. However,
+ -- splitAtProcPoints calculates correct liveness
+ -- information for CmmProc's. Right now only the LLVM
+ -- back-end relies on correct liveness information and
+ -- for that back-end we always call splitAtProcPoints, so
+ -- all is good.
g -- Control-flow graph for the procedure's code
| CmmData -- Static data
@@ -100,8 +108,8 @@ 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
+topInfoTable (CmmProc infos _ _ g) = mapLookup (g_entry g) (info_tbls infos)
+topInfoTable _ = Nothing
data CmmStackInfo
= StackInfo {