[Git][ghc/ghc][master] Add -ddump-stg-final to dump stg as it is used for codegen.

Marge Bot gitlab at gitlab.haskell.org
Fri Apr 12 18:46:48 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
885d2e04 by klebinger.andreas at gmx.at at 2019-04-12T18:40:04Z
Add -ddump-stg-final to dump stg as it is used for codegen.

Intermediate STG does not contain free variables which can be useful
sometimes. So adding a flag to dump that info.

- - - - -


3 changed files:

- compiler/main/DynFlags.hs
- compiler/main/HscMain.hs
- docs/users_guide/debugging.rst


Changes:

=====================================
compiler/main/DynFlags.hs
=====================================
@@ -384,6 +384,7 @@ data DumpFlag
    | Opt_D_dump_spec
    | Opt_D_dump_prep
    | Opt_D_dump_stg
+   | Opt_D_dump_stg_final
    | Opt_D_dump_call_arity
    | Opt_D_dump_exitify
    | Opt_D_dump_stranal
@@ -3339,6 +3340,8 @@ dynamic_flags_deps = [
         (setDumpFlag Opt_D_dump_prep)
   , make_ord_flag defGhcFlag "ddump-stg"
         (setDumpFlag Opt_D_dump_stg)
+  , make_ord_flag defGhcFlag "ddump-stg-final"
+        (setDumpFlag Opt_D_dump_stg_final)
   , make_ord_flag defGhcFlag "ddump-call-arity"
         (setDumpFlag Opt_D_dump_call_arity)
   , make_ord_flag defGhcFlag "ddump-exitify"


=====================================
compiler/main/HscMain.hs
=====================================
@@ -1470,6 +1470,8 @@ doCodeGen hsc_env this_mod data_tycons
     let dflags = hsc_dflags hsc_env
 
     let stg_binds_w_fvs = annTopBindingsFreeVars stg_binds
+    dumpIfSet_dyn dflags Opt_D_dump_stg_final
+                  "STG for code gen:" (pprGenStgTopBindings stg_binds_w_fvs)
     let cmm_stream :: Stream IO CmmGroup ()
         cmm_stream = {-# SCC "StgCmm" #-}
             StgCmm.codeGen dflags this_mod data_tycons


=====================================
docs/users_guide/debugging.rst
=====================================
@@ -380,6 +380,11 @@ These flags dump various phases of GHC's STG pipeline.
 
     Show the output of the intermediate STG-to-STG pass. (*lots* of output!)
 
+.. ghc-flag:: -ddump-stg-final
+    :shortdesc: Show output of last STG pass.
+    :type: dynamic
+
+    Show the output of the last STG pass before we generate Cmm.
 
 C-\\- representation
 ~~~~~~~~~~~~~~~~~~~~



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/885d2e04854f038fbb899ab545df2b57d9b8bba4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/885d2e04854f038fbb899ab545df2b57d9b8bba4
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/20190412/67994f1a/attachment-0001.html>


More information about the ghc-commits mailing list