[Git][ghc/ghc][wip/T18232] Rip out CmmStackInfo(updfr_space)

Ben Gamari gitlab at gitlab.haskell.org
Tue May 26 18:17:35 UTC 2020



Ben Gamari pushed to branch wip/T18232 at Glasgow Haskell Compiler / GHC


Commits:
2d02613c by Ben Gamari at 2020-05-26T14:17:28-04:00
Rip out CmmStackInfo(updfr_space)

As noted in #18232, this field is currently completely unused and
moreover doesn't have a clear meaning.

- - - - -


5 changed files:

- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Ppr.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/StgToCmm/Monad.hs


Changes:

=====================================
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,


=====================================
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


=====================================
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}) =


=====================================
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
 


=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d02613c20928559c27869ed16c5d90048436fa9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d02613c20928559c27869ed16c5d90048436fa9
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200526/c847b38a/attachment-0001.html>


More information about the ghc-commits mailing list