summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-25 13:27:51 -0400
committerBen Gamari <ben@smart-cactus.org>2020-05-26 14:17:28 -0400
commit2d02613c20928559c27869ed16c5d90048436fa9 (patch)
tree433adc3890762ed66fa0a13e7109a026755d425b
parentb8c014ce27c279e0d506d5391a4e9bfa7f1c31f2 (diff)
downloadhaskell-wip/T18232.tar.gz
Rip out CmmStackInfo(updfr_space)wip/T18232
As noted in #18232, this field is currently completely unused and moreover doesn't have a clear meaning.
-rw-r--r--compiler/GHC/Cmm.hs3
-rw-r--r--compiler/GHC/Cmm/LayoutStack.hs7
-rw-r--r--compiler/GHC/Cmm/Ppr.hs5
-rw-r--r--compiler/GHC/Cmm/ProcPoint.hs1
-rw-r--r--compiler/GHC/StgToCmm/Monad.hs4
5 files changed, 6 insertions, 14 deletions
diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs
index 440b6fd9d0..6f69525dc7 100644
--- a/compiler/GHC/Cmm.hs
+++ b/compiler/GHC/Cmm.hs
@@ -132,9 +132,6 @@ data CmmStackInfo
-- number of bytes of arguments on the stack on entry to the
-- the proc. This is filled in by GHC.StgToCmm.codeGen, and
-- used by the stack allocator later.
- updfr_space :: Maybe ByteOff,
- -- XXX: this never contains anything useful, but it should.
- -- See comment in GHC.Cmm.LayoutStack.
do_layout :: Bool
-- Do automatic stack layout for this proc. This is
-- True for all code generated by the code generator,
diff --git a/compiler/GHC/Cmm/LayoutStack.hs b/compiler/GHC/Cmm/LayoutStack.hs
index 232ab7934d..b8fcf65b58 100644
--- a/compiler/GHC/Cmm/LayoutStack.hs
+++ b/compiler/GHC/Cmm/LayoutStack.hs
@@ -357,10 +357,9 @@ isGcJump _something_else = False
-- This doesn't seem right somehow. We need to find out whether this
-- proc will push some update frame material at some point, so that we
--- can avoid using that area of the stack for spilling. The
--- updfr_space field of the CmmProc *should* tell us, but it doesn't
--- (I think maybe it gets filled in later when we do proc-point
--- splitting).
+-- can avoid using that area of the stack for spilling. Ideally we would
+-- capture this information in the CmmProc (e.g. in CmmStackInfo; see #18232
+-- for details on one ill-fated attempt at this).
--
-- So we'll just take the max of all the cml_ret_offs. This could be
-- unnecessarily pessimistic, but probably not in the code we
diff --git a/compiler/GHC/Cmm/Ppr.hs b/compiler/GHC/Cmm/Ppr.hs
index 91bdfb40aa..f451550ed1 100644
--- a/compiler/GHC/Cmm/Ppr.hs
+++ b/compiler/GHC/Cmm/Ppr.hs
@@ -103,9 +103,8 @@ instance Outputable CmmGraph where
-- Outputting types Cmm contains
pprStackInfo :: CmmStackInfo -> SDoc
-pprStackInfo (StackInfo {arg_space=arg_space, updfr_space=updfr_space}) =
- text "arg_space: " <> ppr arg_space <+>
- text "updfr_space: " <> ppr updfr_space
+pprStackInfo (StackInfo {arg_space=arg_space}) =
+ text "arg_space: " <> ppr arg_space
pprTopInfo :: CmmTopInfo -> SDoc
pprTopInfo (TopInfo {info_tbls=info_tbl, stack_info=stack_info}) =
diff --git a/compiler/GHC/Cmm/ProcPoint.hs b/compiler/GHC/Cmm/ProcPoint.hs
index f9dc3a8334..fbefc544dc 100644
--- a/compiler/GHC/Cmm/ProcPoint.hs
+++ b/compiler/GHC/Cmm/ProcPoint.hs
@@ -356,7 +356,6 @@ splitAtProcPoints dflags entry_label callPPs procPoints procMap
g' = replacePPIds g
live = ppLiveness (g_entry g')
stack_info = StackInfo { arg_space = 0
- , updfr_space = Nothing
, do_layout = True }
-- cannot use panic, this is printed by -ddump-cmm
diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs
index 7d948e4c5a..280a71674b 100644
--- a/compiler/GHC/StgToCmm/Monad.hs
+++ b/compiler/GHC/StgToCmm/Monad.hs
@@ -762,8 +762,7 @@ emitProcWithConvention conv mb_info lbl args blocks
emitProc :: Maybe CmmInfoTable -> CLabel -> [GlobalReg] -> CmmAGraphScoped
-> Int -> Bool -> FCode ()
emitProc mb_info lbl live blocks offset do_layout
- = do { platform <- getPlatform
- ; l <- newBlockId
+ = do { l <- newBlockId
; let
blks :: CmmGraph
blks = labelAGraph l blocks
@@ -772,7 +771,6 @@ emitProc mb_info lbl live blocks offset do_layout
| otherwise = mapEmpty
sinfo = StackInfo { arg_space = offset
- , updfr_space = Just (initUpdFrameOff platform)
, do_layout = do_layout }
tinfo = TopInfo { info_tbls = infos